refactor(测试跟踪): 优化测试跟踪首页查询
This commit is contained in:
parent
b2560a8496
commit
ce0a688130
|
@ -31,4 +31,11 @@ public interface ExtTestPlanTestCaseMapper {
|
||||||
|
|
||||||
List<String> getTestPlanTestCaseIds(String testId);
|
List<String> getTestPlanTestCaseIds(String testId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目 ids 查询 TestPlanCaseDTO 列表
|
||||||
|
* @param ids project id list
|
||||||
|
* @return List<TestPlanCaseDTO>
|
||||||
|
*/
|
||||||
|
List<TestPlanCaseDTO> listTestCaseByProjectIds(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,6 +210,14 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listTestCaseByProjectIds" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
|
select distinct * from test_plan_test_case, test_case
|
||||||
|
where test_plan_test_case.case_id = test_case.id
|
||||||
|
and test_case.project_id in
|
||||||
|
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
<select id="listByNode" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
<select id="listByNode" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
select test_plan_test_case.*, test_case.*
|
select test_plan_test_case.*, test_case.*
|
||||||
from test_plan_test_case
|
from test_plan_test_case
|
||||||
|
|
|
@ -12,4 +12,11 @@ public interface ExtTestReviewCaseMapper {
|
||||||
List<TestReviewCaseDTO> list(@Param("request") QueryCaseReviewRequest request);
|
List<TestReviewCaseDTO> list(@Param("request") QueryCaseReviewRequest request);
|
||||||
List<String> getStatusByReviewId(String reviewId);
|
List<String> getStatusByReviewId(String reviewId);
|
||||||
List<String> findRelateTestReviewId(@Param("userId") String userId, @Param("workspaceId") String workspaceId);
|
List<String> findRelateTestReviewId(@Param("userId") String userId, @Param("workspaceId") String workspaceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目 ids 查询 TestReviewCaseDTO 列表
|
||||||
|
* @param ids project id list
|
||||||
|
* @return List<TestReviewCaseDTO>
|
||||||
|
*/
|
||||||
|
List<TestReviewCaseDTO> listTestCaseByProjectIds(@Param("ids") List<String> ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,4 +195,12 @@
|
||||||
where test_case_review_test_case.review_id = #{userId}
|
where test_case_review_test_case.review_id = #{userId}
|
||||||
and project.workspace_id = #{workspaceId}
|
and project.workspace_id = #{workspaceId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listTestCaseByProjectIds" resultType="io.metersphere.track.dto.TestReviewCaseDTO">
|
||||||
|
select distinct * from test_case_review_test_case, test_case
|
||||||
|
where test_case_review_test_case.case_id = test_case.id
|
||||||
|
and test_case.project_id in
|
||||||
|
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -484,7 +484,7 @@ public class TestCaseReviewService {
|
||||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
request.setReviewIds(extTestReviewCaseMapper.findRelateTestReviewId(user.getId(), SessionUtils.getCurrentWorkspaceId()));
|
request.setReviewIds(extTestReviewCaseMapper.findRelateTestReviewId(user.getId(), SessionUtils.getCurrentWorkspaceId()));
|
||||||
|
|
||||||
List<String> projectIds = extProjectMapper.getProjectIdByWorkspaceId(SessionUtils.getCurrentOrganizationId());
|
List<String> projectIds = extProjectMapper.getProjectIdByWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
|
||||||
List<TestReviewDTOWithMetric> testReviews = extTestCaseReviewMapper.listRelate(request);
|
List<TestReviewDTOWithMetric> testReviews = extTestCaseReviewMapper.listRelate(request);
|
||||||
|
|
||||||
|
@ -553,10 +553,11 @@ public class TestCaseReviewService {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestReviewCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
private List<TestReviewCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
||||||
QueryCaseReviewRequest request = new QueryCaseReviewRequest();
|
if (CollectionUtils.isEmpty(projectIds)) {
|
||||||
request.setProjectIds(projectIds);
|
return new ArrayList<>();
|
||||||
return extTestReviewCaseMapper.list(request);
|
}
|
||||||
|
return extTestReviewCaseMapper.listTestCaseByProjectIds(projectIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*编辑,新建,完成,删除通知内容*/
|
/*编辑,新建,完成,删除通知内容*/
|
||||||
|
|
|
@ -365,7 +365,7 @@ public class TestPlanService {
|
||||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
request.setPlanIds(extTestPlanTestCaseMapper.findRelateTestPlanId(user.getId(), SessionUtils.getCurrentWorkspaceId()));
|
request.setPlanIds(extTestPlanTestCaseMapper.findRelateTestPlanId(user.getId(), SessionUtils.getCurrentWorkspaceId()));
|
||||||
|
|
||||||
List<String> projectIds = extProjectMapper.getProjectIdByWorkspaceId(SessionUtils.getCurrentOrganizationId());
|
List<String> projectIds = extProjectMapper.getProjectIdByWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
|
|
||||||
List<TestPlanDTOWithMetric> testPlans = extTestPlanMapper.listRelate(request);
|
List<TestPlanDTOWithMetric> testPlans = extTestPlanMapper.listRelate(request);
|
||||||
|
|
||||||
|
@ -411,10 +411,11 @@ public class TestPlanService {
|
||||||
return testPlanTestCaseService.list(request);
|
return testPlanTestCaseService.list(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestPlanCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
private List<TestPlanCaseDTO> listTestCaseByProjectIds(List<String> projectIds) {
|
||||||
QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest();
|
if (CollectionUtils.isEmpty(projectIds)) {
|
||||||
request.setProjectIds(projectIds);
|
return new ArrayList<>();
|
||||||
return extTestPlanTestCaseMapper.list(request);
|
}
|
||||||
|
return extTestPlanTestCaseMapper.listTestCaseByProjectIds(projectIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestCaseReportMetricDTO getMetric(String planId) {
|
public TestCaseReportMetricDTO getMetric(String planId) {
|
||||||
|
|
Loading…
Reference in New Issue