refactor(测试计划): 返回值新增测试集名称

This commit is contained in:
WangXu10 2024-06-17 18:47:49 +08:00 committed by Craftsman
parent 0335e86a42
commit c96d6126ca
6 changed files with 23 additions and 4 deletions

View File

@ -66,6 +66,9 @@ public class TestPlanApiCasePageResponse implements Serializable {
@Schema(description = "测试集id") @Schema(description = "测试集id")
private String testPlanCollectionId; private String testPlanCollectionId;
@Schema(description = "测试集名称")
private String testPlanCollectionName;
@Schema(description = "报告id") @Schema(description = "报告id")
private String lastExecReportId; private String lastExecReportId;

View File

@ -62,6 +62,9 @@ public class TestPlanApiScenarioPageResponse implements Serializable {
@Schema(description = "测试集id") @Schema(description = "测试集id")
private String testPlanCollectionId; private String testPlanCollectionId;
@Schema(description = "测试集名称")
private String testPlanCollectionName;
@Schema(description = "报告id") @Schema(description = "报告id")
private String lastExecReportId; private String lastExecReportId;

View File

@ -94,4 +94,10 @@ public class TestPlanCasePageResponse implements Serializable {
@Schema(description = "测试计划id") @Schema(description = "测试计划id")
private String testPlanId; private String testPlanId;
@Schema(description = "测试集id")
private String testPlanCollectionId;
@Schema(description = "测试集名称")
private String testPlanCollectionName;
} }

View File

@ -421,11 +421,13 @@
t.last_exec_time, t.last_exec_time,
t.last_exec_report_id, t.last_exec_report_id,
atc.status, atc.status,
atc.id as apiTestCaseId atc.id as apiTestCaseId,
test_plan_collection.name as testPlanCollectionName
FROM FROM
api_test_case atc api_test_case atc
INNER JOIN api_definition a ON atc.api_definition_id = a.id 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_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} WHERE atc.deleted =#{deleted}
and t.test_plan_id = #{request.testPlanId} and t.test_plan_id = #{request.testPlanId}
<include refid="queryApiCaseWhereCondition"/> <include refid="queryApiCaseWhereCondition"/>

View File

@ -100,10 +100,12 @@
test_plan_api_scenario.last_exec_result, test_plan_api_scenario.last_exec_result,
test_plan_api_scenario.execute_user, test_plan_api_scenario.execute_user,
test_plan_api_scenario.last_exec_time, 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 FROM
test_plan_api_scenario test_plan_api_scenario
inner join api_scenario on api_scenario.id = test_plan_api_scenario.api_scenario_id 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} WHERE api_scenario.deleted =#{deleted}
and test_plan_api_scenario.test_plan_id = #{request.testPlanId} and test_plan_api_scenario.test_plan_id = #{request.testPlanId}
<include refid="queryApiScenarioWhereCondition"/> <include refid="queryApiScenarioWhereCondition"/>

View File

@ -111,12 +111,15 @@
test_plan_functional_case.test_plan_id as testPlanId, test_plan_functional_case.test_plan_id as testPlanId,
test_plan_functional_case.id, test_plan_functional_case.id,
project.name as projectName, 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 FROM
functional_case functional_case
inner join project on functional_case.project_id = project.id 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 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} where functional_case.deleted = #{deleted}
and test_plan_functional_case.test_plan_id = #{request.testPlanId} and test_plan_functional_case.test_plan_id = #{request.testPlanId}
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>