From eeda5334cef7cde5077f395271d2909e76ba35ee Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 18 Nov 2024 15:12:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1048906 --user=王旭 【测试计划】-筛选-使用计划名称与其他条件组合筛选,筛选结果错误 https://www.tapd.cn/55049933/s/1611266 --- .../dto/request/TestPlanTableRequest.java | 1 + .../plan/mapper/ExtTestPlanMapper.xml | 174 ++++++++++-------- .../service/TestPlanManagementService.java | 1 + 3 files changed, 99 insertions(+), 77 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanTableRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanTableRequest.java index c739547dbd..4b8ec90875 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanTableRequest.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanTableRequest.java @@ -29,6 +29,7 @@ public class TestPlanTableRequest extends BasePageRequest { @Schema(description = "通过其他条件查询出来的,必须要包含的测试计划ID") private List innerIds; private List combineInnerIds; + private String combineOperator; @Schema(description = "是否我的待办, 默认查询全部") private boolean myTodo = false; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml index e737a5b30a..c4c9c84ee8 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml @@ -137,7 +137,13 @@ --> - and t.id in + and t.id + + in + + + not in + #{id} @@ -214,44 +220,50 @@ - - - - - - or t.id in - ( - SELECT group_id - FROM test_plan - WHERE project_id = #{request.projectId} - AND - - - - - ) - - - - - - - - - - or t.id in - ( - SELECT group_id - FROM test_plan - WHERE project_id = #{request.projectId} - AND + - + - ) + + + or t.id in + ( + SELECT group_id + FROM test_plan + WHERE project_id = #{request.projectId} + AND + + + + + ) + - + + + + + + + + + + + or t.id in + ( + SELECT group_id + FROM test_plan + WHERE project_id = #{request.projectId} + AND + + + + + ) + + + @@ -278,31 +290,35 @@ - - - - - - or t.id in - ( - SELECT group_id - FROM test_plan - WHERE project_id = #{request.projectId} - AND + - + - ) - + + + or t.id in + ( + SELECT group_id + FROM test_plan + WHERE project_id = #{request.projectId} + AND + + + + + ) + + + - - - - + status in + + #{v} + @@ -976,18 +992,20 @@ - - or t.id in - ( - SELECT group_id - FROM test_plan - WHERE project_id = #{request.projectId} - AND - - - - - ) + + + or t.id in + ( + SELECT group_id + FROM test_plan + WHERE project_id = #{request.projectId} + AND + + + + + ) + @@ -1040,18 +1058,20 @@ - - or t.id in - ( - SELECT group_id - FROM test_plan - WHERE project_id = #{request.projectId} - AND - - - - - ) + + + or t.id in + ( + SELECT group_id + FROM test_plan + WHERE project_id = #{request.projectId} + AND + + + + + ) + diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java index 83665bfc2d..6e86d1a5bb 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanManagementService.java @@ -202,6 +202,7 @@ public class TestPlanManagementService { //目前未归档的测试计划只有3中类型。所以这里判断如果是3个的话等于直接查询未归档 if (statusList.size() < 3) { request.setCombineInnerIds(this.selectTestPlanIdByProjectIdAndStatus(request.getProjectId(), statusList)); + request.setCombineOperator(item.getOperator()); } } });