build: use mybatis search all

This commit is contained in:
CaptainB 2023-05-23 17:32:39 +08:00
parent 477065f623
commit 3b6150f487
3 changed files with 10 additions and 3 deletions

View File

@ -3,9 +3,13 @@ package io.metersphere.project.mapper;
import io.metersphere.project.domain.ProjectApplication;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ProjectApplicationMapper {
void update(@Param("application") ProjectApplication application);
void insert(@Param("application") ProjectApplication application);
List<ProjectApplication> listByProjectId(String projectId);
}

View File

@ -15,4 +15,8 @@
#{application.type,jdbcType=VARCHAR},
#{application.typeValue,jdbcType=VARCHAR})
</insert>
<select id="listByProjectId" resultType="io.metersphere.project.domain.ProjectApplication">
SELECT * FROM project_application WHERE project_id = #{projectId,jdbcType=VARCHAR}
</select>
</mapper>

View File

@ -31,9 +31,8 @@ public class ProjectApplicationService {
}
public List<ProjectApplication> list(String projectId) {
Query query = Query.query(Criteria.where("project_id").is(projectId));
// Query query = Query.query(Criteria.where("project_id").is(projectId));
Iterable<ProjectApplication> all = jdbcAggregateTemplate.findAll(query, ProjectApplication.class);
return IterableUtils.toList(all);
return projectApplicationMapper.listByProjectId(projectId);
}
}