From c96d6126ca2169f2784a006c6563187d1a7112c1 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 17 Jun 2024 18:47:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E8=BF=94=E5=9B=9E=E5=80=BC=E6=96=B0=E5=A2=9E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=9B=86=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/dto/response/TestPlanApiCasePageResponse.java | 3 +++ .../plan/dto/response/TestPlanApiScenarioPageResponse.java | 3 +++ .../plan/dto/response/TestPlanCasePageResponse.java | 6 ++++++ .../metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml | 4 +++- .../plan/mapper/ExtTestPlanApiScenarioMapper.xml | 4 +++- .../plan/mapper/ExtTestPlanFunctionalCaseMapper.xml | 7 +++++-- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java index 03cac22453..0493a88439 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java @@ -66,6 +66,9 @@ public class TestPlanApiCasePageResponse implements Serializable { @Schema(description = "测试集id") private String testPlanCollectionId; + @Schema(description = "测试集名称") + private String testPlanCollectionName; + @Schema(description = "报告id") private String lastExecReportId; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java index cdb1432894..6ee1adef00 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiScenarioPageResponse.java @@ -62,6 +62,9 @@ public class TestPlanApiScenarioPageResponse implements Serializable { @Schema(description = "测试集id") private String testPlanCollectionId; + @Schema(description = "测试集名称") + private String testPlanCollectionName; + @Schema(description = "报告id") private String lastExecReportId; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java index ebacc1c9f7..1ff361bd4f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanCasePageResponse.java @@ -94,4 +94,10 @@ public class TestPlanCasePageResponse implements Serializable { @Schema(description = "测试计划id") private String testPlanId; + + @Schema(description = "测试集id") + private String testPlanCollectionId; + + @Schema(description = "测试集名称") + private String testPlanCollectionName; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml index b45d301c71..4e1f218a15 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml @@ -421,11 +421,13 @@ t.last_exec_time, t.last_exec_report_id, atc.status, - atc.id as apiTestCaseId + atc.id as apiTestCaseId, + test_plan_collection.name as testPlanCollectionName FROM api_test_case atc INNER JOIN api_definition a ON atc.api_definition_id = a.id inner join test_plan_api_case t on atc.id = t.api_case_id + inner join test_plan_collection on test_plan_collection.id = t.test_plan_collection_id WHERE atc.deleted =#{deleted} and t.test_plan_id = #{request.testPlanId} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml index 2eff675cf2..29a979ba42 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiScenarioMapper.xml @@ -100,10 +100,12 @@ test_plan_api_scenario.last_exec_result, test_plan_api_scenario.execute_user, test_plan_api_scenario.last_exec_time, - test_plan_api_scenario.last_exec_report_id + test_plan_api_scenario.last_exec_report_id, + test_plan_collection.name as testPlanCollectionName FROM test_plan_api_scenario inner join api_scenario on api_scenario.id = test_plan_api_scenario.api_scenario_id + inner join test_plan_collection on test_plan_collection.id = test_plan_api_scenario.test_plan_collection_id WHERE api_scenario.deleted =#{deleted} and test_plan_api_scenario.test_plan_id = #{request.testPlanId} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml index bd74e1555e..b67dd19953 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml @@ -111,12 +111,15 @@ test_plan_functional_case.test_plan_id as testPlanId, test_plan_functional_case.id, project.name as projectName, - project.id as projectId + project.id as projectId, + test_plan_functional_case.test_plan_collection_id as testPlanCollectionId, + test_plan_collection.name as testPlanCollectionName FROM functional_case inner join project on functional_case.project_id = project.id inner join test_plan_functional_case on functional_case.id = test_plan_functional_case.functional_case_id - LEFT JOIN project_version ON functional_case.version_id = project_version.id + inner JOIN project_version ON functional_case.version_id = project_version.id + inner join test_plan_collection on test_plan_collection.id = test_plan_functional_case.test_plan_collection_id where functional_case.deleted = #{deleted} and test_plan_functional_case.test_plan_id = #{request.testPlanId}