build: use mybatis search all
This commit is contained in:
parent
477065f623
commit
3b6150f487
|
@ -3,9 +3,13 @@ package io.metersphere.project.mapper;
|
||||||
import io.metersphere.project.domain.ProjectApplication;
|
import io.metersphere.project.domain.ProjectApplication;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface ProjectApplicationMapper {
|
public interface ProjectApplicationMapper {
|
||||||
|
|
||||||
void update(@Param("application") ProjectApplication application);
|
void update(@Param("application") ProjectApplication application);
|
||||||
|
|
||||||
void insert(@Param("application") ProjectApplication application);
|
void insert(@Param("application") ProjectApplication application);
|
||||||
|
|
||||||
|
List<ProjectApplication> listByProjectId(String projectId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,8 @@
|
||||||
#{application.type,jdbcType=VARCHAR},
|
#{application.type,jdbcType=VARCHAR},
|
||||||
#{application.typeValue,jdbcType=VARCHAR})
|
#{application.typeValue,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="listByProjectId" resultType="io.metersphere.project.domain.ProjectApplication">
|
||||||
|
SELECT * FROM project_application WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -31,9 +31,8 @@ public class ProjectApplicationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProjectApplication> list(String projectId) {
|
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 projectApplicationMapper.listByProjectId(projectId);
|
||||||
return IterableUtils.toList(all);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue