From 6e0c20771ee353fa9bec974428b1ee106f8da87f Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 18 Jul 2024 17:25:26 +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=E5=90=8C=E6=AD=A5=E5=85=B3=E8=81=94&?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=85=B3=E8=81=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/mapper/ExtApiScenarioMapper.java | 2 +- .../api/mapper/ExtApiScenarioMapper.xml | 5 +++++ .../api/mapper/ExtApiTestCaseMapper.java | 2 +- .../api/mapper/ExtApiTestCaseMapper.xml | 5 +++++ .../mapper/ExtFunctionalCaseMapper.java | 2 +- .../mapper/ExtFunctionalCaseMapper.xml | 5 +++++ .../mapper/ExtFunctionalCaseTestMapper.java | 4 ++-- .../mapper/ExtFunctionalCaseTestMapper.xml | 10 +++++++++ .../plan/service/TestPlanApiCaseService.java | 4 ++-- .../service/TestPlanApiScenarioService.java | 2 +- .../TestPlanFunctionalCaseService.java | 22 ++++++++++--------- 11 files changed, 45 insertions(+), 18 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java index 7282045d13..3b8d18ddd2 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java @@ -87,7 +87,7 @@ public interface ExtApiScenarioMapper { List selectAllCase(@Param("isRepeat") boolean isRepeat, @Param("projectId") String projectId, @Param("testPlanId") String testPlanId); - List getListBySelectModules(@Param("projectId") String projectId, @Param("moduleIds") List moduleIds, @Param("testPlanId") String testPlanId); + List getListBySelectModules(@Param("isRepeat") boolean isRepeat, @Param("projectId") String projectId, @Param("moduleIds") List moduleIds, @Param("testPlanId") String testPlanId); List getListBySelectIds(@Param("projectId") String projectId, @Param("ids") List ids, @Param("testPlanId") String testPlanId); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml index 574d8fee06..a03d1240b7 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml @@ -708,6 +708,11 @@ #{moduleId} + + AND api_scenario.id not in ( + select api_scenario_id from test_plan_api_scenario where test_plan_id = #{testPlanId} + ) + diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.java b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.java index a5586266e5..75a45f4fa9 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.java @@ -25,9 +25,9 @@ public interface ExtFunctionalCaseTestMapper { List getPlanExecuteHistoryList(@Param("caseId") String caseId, @Param("planId") String planId); - List selectApiCaseByCaseIds(@Param("caseIds") List caseIds); + List selectApiCaseByCaseIds(@Param("isRepeat") boolean isRepeat, @Param("caseIds") List caseIds, @Param("testPlanId") String testPlanId); - List selectApiScenarioByCaseIds(@Param("caseIds") List caseIds); + List selectApiScenarioByCaseIds(@Param("isRepeat") boolean isRepeat, @Param("caseIds") List caseIds, @Param("testPlanId") String testPlanId); List selectApiAndScenarioIdsFromCaseIds(@Param("caseIds") List functionalCaseIds); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml index 5dd803d3b2..e8bb08b7ff 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseTestMapper.xml @@ -223,6 +223,11 @@ #{caseId} + + AND api_test_case.id not in ( + select api_case_id from test_plan_api_case where test_plan_id = #{testPlanId} + ) + @@ -243,6 +248,11 @@ #{caseId} + + AND api_scenario.id not in ( + select api_scenario_id from test_plan_api_scenario where test_plan_id = #{testPlanId} + ) +