diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java index a4dee6858b..533b9b152b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCase.java @@ -24,6 +24,14 @@ public class TestPlanReportApiCase implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_api_case.test_plan_report_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanReportId; + @Schema(description = "测试集ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_api_case.test_plan_collection_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_api_case.test_plan_collection_id.length_range}", groups = {Created.class, Updated.class}) + private String testPlanCollectionId; + + @Schema(description = "环境ID") + private String environmentId; + @Schema(description = "测试计划接口用例关联ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan_report_api_case.test_plan_api_case_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{test_plan_report_api_case.test_plan_api_case_id.length_range}", groups = {Created.class, Updated.class}) @@ -52,16 +60,19 @@ public class TestPlanReportApiCase implements Serializable { @Schema(description = "接口用例执行人") private String apiCaseExecuteUser; - @Schema(description = "接口用例执行结果", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_report_api_case.api_case_execute_result.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_report_api_case.api_case_execute_result.length_range}", groups = {Created.class, Updated.class}) + @Schema(description = "接口用例执行结果") private String apiCaseExecuteResult; + @Schema(description = "接口用例执行报告ID") + private String apiCaseExecuteReportId; + private static final long serialVersionUID = 1L; public enum Column { id("id", "id", "VARCHAR", false), testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false), + testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false), + environmentId("environment_id", "environmentId", "VARCHAR", false), testPlanApiCaseId("test_plan_api_case_id", "testPlanApiCaseId", "VARCHAR", false), apiCaseId("api_case_id", "apiCaseId", "VARCHAR", false), apiCaseNum("api_case_num", "apiCaseNum", "BIGINT", false), @@ -69,7 +80,8 @@ public class TestPlanReportApiCase implements Serializable { apiCaseModule("api_case_module", "apiCaseModule", "VARCHAR", false), apiCasePriority("api_case_priority", "apiCasePriority", "VARCHAR", false), apiCaseExecuteUser("api_case_execute_user", "apiCaseExecuteUser", "VARCHAR", false), - apiCaseExecuteResult("api_case_execute_result", "apiCaseExecuteResult", "VARCHAR", false); + apiCaseExecuteResult("api_case_execute_result", "apiCaseExecuteResult", "VARCHAR", false), + apiCaseExecuteReportId("api_case_execute_report_id", "apiCaseExecuteReportId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java index d99b348f51..194b0cd79e 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiCaseExample.java @@ -244,6 +244,146 @@ public class TestPlanReportApiCaseExample { return (Criteria) this; } + public Criteria andTestPlanCollectionIdIsNull() { + addCriterion("test_plan_collection_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIsNotNull() { + addCriterion("test_plan_collection_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdEqualTo(String value) { + addCriterion("test_plan_collection_id =", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotEqualTo(String value) { + addCriterion("test_plan_collection_id <>", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThan(String value) { + addCriterion("test_plan_collection_id >", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id >=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThan(String value) { + addCriterion("test_plan_collection_id <", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id <=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLike(String value) { + addCriterion("test_plan_collection_id like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotLike(String value) { + addCriterion("test_plan_collection_id not like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIn(List values) { + addCriterion("test_plan_collection_id in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotIn(List values) { + addCriterion("test_plan_collection_id not in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdBetween(String value1, String value2) { + addCriterion("test_plan_collection_id between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotBetween(String value1, String value2) { + addCriterion("test_plan_collection_id not between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNull() { + addCriterion("environment_id is null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNotNull() { + addCriterion("environment_id is not null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdEqualTo(String value) { + addCriterion("environment_id =", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotEqualTo(String value) { + addCriterion("environment_id <>", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThan(String value) { + addCriterion("environment_id >", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { + addCriterion("environment_id >=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThan(String value) { + addCriterion("environment_id <", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { + addCriterion("environment_id <=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLike(String value) { + addCriterion("environment_id like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotLike(String value) { + addCriterion("environment_id not like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIn(List values) { + addCriterion("environment_id in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotIn(List values) { + addCriterion("environment_id not in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdBetween(String value1, String value2) { + addCriterion("environment_id between", value1, value2, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotBetween(String value1, String value2) { + addCriterion("environment_id not between", value1, value2, "environmentId"); + return (Criteria) this; + } + public Criteria andTestPlanApiCaseIdIsNull() { addCriterion("test_plan_api_case_id is null"); return (Criteria) this; @@ -793,6 +933,76 @@ public class TestPlanReportApiCaseExample { addCriterion("api_case_execute_result not between", value1, value2, "apiCaseExecuteResult"); return (Criteria) this; } + + public Criteria andApiCaseExecuteReportIdIsNull() { + addCriterion("api_case_execute_report_id is null"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdIsNotNull() { + addCriterion("api_case_execute_report_id is not null"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdEqualTo(String value) { + addCriterion("api_case_execute_report_id =", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdNotEqualTo(String value) { + addCriterion("api_case_execute_report_id <>", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdGreaterThan(String value) { + addCriterion("api_case_execute_report_id >", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdGreaterThanOrEqualTo(String value) { + addCriterion("api_case_execute_report_id >=", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdLessThan(String value) { + addCriterion("api_case_execute_report_id <", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdLessThanOrEqualTo(String value) { + addCriterion("api_case_execute_report_id <=", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdLike(String value) { + addCriterion("api_case_execute_report_id like", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdNotLike(String value) { + addCriterion("api_case_execute_report_id not like", value, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdIn(List values) { + addCriterion("api_case_execute_report_id in", values, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdNotIn(List values) { + addCriterion("api_case_execute_report_id not in", values, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdBetween(String value1, String value2) { + addCriterion("api_case_execute_report_id between", value1, value2, "apiCaseExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiCaseExecuteReportIdNotBetween(String value1, String value2) { + addCriterion("api_case_execute_report_id not between", value1, value2, "apiCaseExecuteReportId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java index b72fde9194..c52089a5ab 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenario.java @@ -24,6 +24,17 @@ public class TestPlanReportApiScenario implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_api_scenario.test_plan_report_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanReportId; + @Schema(description = "测试集ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_api_scenario.test_plan_collection_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_api_scenario.test_plan_collection_id.length_range}", groups = {Created.class, Updated.class}) + private String testPlanCollectionId; + + @Schema(description = "是否环境组") + private Boolean grouped; + + @Schema(description = "环境ID") + private String environmentId; + @Schema(description = "测试计划场景用例关联ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan_report_api_scenario.test_plan_api_scenario_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{test_plan_report_api_scenario.test_plan_api_scenario_id.length_range}", groups = {Created.class, Updated.class}) @@ -52,16 +63,20 @@ public class TestPlanReportApiScenario implements Serializable { @Schema(description = "场景用例执行人") private String apiScenarioExecuteUser; - @Schema(description = "场景用例执行结果", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{test_plan_report_api_scenario.api_scenario_execute_result.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{test_plan_report_api_scenario.api_scenario_execute_result.length_range}", groups = {Created.class, Updated.class}) + @Schema(description = "场景用例执行结果") private String apiScenarioExecuteResult; + @Schema(description = "场景用例执行报告ID") + private String apiScenarioExecuteReportId; + private static final long serialVersionUID = 1L; public enum Column { id("id", "id", "VARCHAR", false), testPlanReportId("test_plan_report_id", "testPlanReportId", "VARCHAR", false), + testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false), + grouped("grouped", "grouped", "BIT", false), + environmentId("environment_id", "environmentId", "VARCHAR", false), testPlanApiScenarioId("test_plan_api_scenario_id", "testPlanApiScenarioId", "VARCHAR", false), apiScenarioId("api_scenario_id", "apiScenarioId", "VARCHAR", false), apiScenarioNum("api_scenario_num", "apiScenarioNum", "BIGINT", false), @@ -69,7 +84,8 @@ public class TestPlanReportApiScenario implements Serializable { apiScenarioModule("api_scenario_module", "apiScenarioModule", "VARCHAR", false), apiScenarioPriority("api_scenario_priority", "apiScenarioPriority", "VARCHAR", false), apiScenarioExecuteUser("api_scenario_execute_user", "apiScenarioExecuteUser", "VARCHAR", false), - apiScenarioExecuteResult("api_scenario_execute_result", "apiScenarioExecuteResult", "VARCHAR", false); + apiScenarioExecuteResult("api_scenario_execute_result", "apiScenarioExecuteResult", "VARCHAR", false), + apiScenarioExecuteReportId("api_scenario_execute_report_id", "apiScenarioExecuteReportId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java index bc65d950cf..bc65945b57 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportApiScenarioExample.java @@ -244,6 +244,206 @@ public class TestPlanReportApiScenarioExample { return (Criteria) this; } + public Criteria andTestPlanCollectionIdIsNull() { + addCriterion("test_plan_collection_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIsNotNull() { + addCriterion("test_plan_collection_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdEqualTo(String value) { + addCriterion("test_plan_collection_id =", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotEqualTo(String value) { + addCriterion("test_plan_collection_id <>", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThan(String value) { + addCriterion("test_plan_collection_id >", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id >=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThan(String value) { + addCriterion("test_plan_collection_id <", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id <=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLike(String value) { + addCriterion("test_plan_collection_id like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotLike(String value) { + addCriterion("test_plan_collection_id not like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIn(List values) { + addCriterion("test_plan_collection_id in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotIn(List values) { + addCriterion("test_plan_collection_id not in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdBetween(String value1, String value2) { + addCriterion("test_plan_collection_id between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotBetween(String value1, String value2) { + addCriterion("test_plan_collection_id not between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andGroupedIsNull() { + addCriterion("grouped is null"); + return (Criteria) this; + } + + public Criteria andGroupedIsNotNull() { + addCriterion("grouped is not null"); + return (Criteria) this; + } + + public Criteria andGroupedEqualTo(Boolean value) { + addCriterion("grouped =", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedNotEqualTo(Boolean value) { + addCriterion("grouped <>", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedGreaterThan(Boolean value) { + addCriterion("grouped >", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedGreaterThanOrEqualTo(Boolean value) { + addCriterion("grouped >=", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedLessThan(Boolean value) { + addCriterion("grouped <", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedLessThanOrEqualTo(Boolean value) { + addCriterion("grouped <=", value, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedIn(List values) { + addCriterion("grouped in", values, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedNotIn(List values) { + addCriterion("grouped not in", values, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedBetween(Boolean value1, Boolean value2) { + addCriterion("grouped between", value1, value2, "grouped"); + return (Criteria) this; + } + + public Criteria andGroupedNotBetween(Boolean value1, Boolean value2) { + addCriterion("grouped not between", value1, value2, "grouped"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNull() { + addCriterion("environment_id is null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIsNotNull() { + addCriterion("environment_id is not null"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdEqualTo(String value) { + addCriterion("environment_id =", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotEqualTo(String value) { + addCriterion("environment_id <>", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThan(String value) { + addCriterion("environment_id >", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdGreaterThanOrEqualTo(String value) { + addCriterion("environment_id >=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThan(String value) { + addCriterion("environment_id <", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLessThanOrEqualTo(String value) { + addCriterion("environment_id <=", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdLike(String value) { + addCriterion("environment_id like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotLike(String value) { + addCriterion("environment_id not like", value, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdIn(List values) { + addCriterion("environment_id in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotIn(List values) { + addCriterion("environment_id not in", values, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdBetween(String value1, String value2) { + addCriterion("environment_id between", value1, value2, "environmentId"); + return (Criteria) this; + } + + public Criteria andEnvironmentIdNotBetween(String value1, String value2) { + addCriterion("environment_id not between", value1, value2, "environmentId"); + return (Criteria) this; + } + public Criteria andTestPlanApiScenarioIdIsNull() { addCriterion("test_plan_api_scenario_id is null"); return (Criteria) this; @@ -793,6 +993,76 @@ public class TestPlanReportApiScenarioExample { addCriterion("api_scenario_execute_result not between", value1, value2, "apiScenarioExecuteResult"); return (Criteria) this; } + + public Criteria andApiScenarioExecuteReportIdIsNull() { + addCriterion("api_scenario_execute_report_id is null"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdIsNotNull() { + addCriterion("api_scenario_execute_report_id is not null"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdEqualTo(String value) { + addCriterion("api_scenario_execute_report_id =", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdNotEqualTo(String value) { + addCriterion("api_scenario_execute_report_id <>", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdGreaterThan(String value) { + addCriterion("api_scenario_execute_report_id >", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdGreaterThanOrEqualTo(String value) { + addCriterion("api_scenario_execute_report_id >=", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdLessThan(String value) { + addCriterion("api_scenario_execute_report_id <", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdLessThanOrEqualTo(String value) { + addCriterion("api_scenario_execute_report_id <=", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdLike(String value) { + addCriterion("api_scenario_execute_report_id like", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdNotLike(String value) { + addCriterion("api_scenario_execute_report_id not like", value, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdIn(List values) { + addCriterion("api_scenario_execute_report_id in", values, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdNotIn(List values) { + addCriterion("api_scenario_execute_report_id not in", values, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdBetween(String value1, String value2) { + addCriterion("api_scenario_execute_report_id between", value1, value2, "apiScenarioExecuteReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioExecuteReportIdNotBetween(String value1, String value2) { + addCriterion("api_scenario_execute_report_id not between", value1, value2, "apiScenarioExecuteReportId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java index ff2b75b8c8..79a0a893d6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCase.java @@ -24,7 +24,7 @@ public class TestPlanReportFunctionCase implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_report_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanReportId; - @Schema(description = "测试计划功能用例关联ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "测试计划功能用例关联ID(同一计划下可重复关联, 暂时保留)", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_plan_report_function_case.test_plan_function_case_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_function_case_id.length_range}", groups = {Created.class, Updated.class}) private String testPlanFunctionCaseId; @@ -60,6 +60,11 @@ public class TestPlanReportFunctionCase implements Serializable { @Size(min = 1, max = 50, message = "{test_plan_report_function_case.function_case_execute_result.length_range}", groups = {Created.class, Updated.class}) private String functionCaseExecuteResult; + @Schema(description = "测试集ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_report_function_case.test_plan_collection_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_report_function_case.test_plan_collection_id.length_range}", groups = {Created.class, Updated.class}) + private String testPlanCollectionId; + private static final long serialVersionUID = 1L; public enum Column { @@ -73,7 +78,8 @@ public class TestPlanReportFunctionCase implements Serializable { functionCasePriority("function_case_priority", "functionCasePriority", "VARCHAR", false), functionCaseExecuteUser("function_case_execute_user", "functionCaseExecuteUser", "VARCHAR", false), functionCaseBugCount("function_case_bug_count", "functionCaseBugCount", "BIGINT", false), - functionCaseExecuteResult("function_case_execute_result", "functionCaseExecuteResult", "VARCHAR", false); + functionCaseExecuteResult("function_case_execute_result", "functionCaseExecuteResult", "VARCHAR", false), + testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java index f380f83944..695aca85ae 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanReportFunctionCaseExample.java @@ -853,6 +853,76 @@ public class TestPlanReportFunctionCaseExample { addCriterion("function_case_execute_result not between", value1, value2, "functionCaseExecuteResult"); return (Criteria) this; } + + public Criteria andTestPlanCollectionIdIsNull() { + addCriterion("test_plan_collection_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIsNotNull() { + addCriterion("test_plan_collection_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdEqualTo(String value) { + addCriterion("test_plan_collection_id =", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotEqualTo(String value) { + addCriterion("test_plan_collection_id <>", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThan(String value) { + addCriterion("test_plan_collection_id >", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id >=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThan(String value) { + addCriterion("test_plan_collection_id <", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id <=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLike(String value) { + addCriterion("test_plan_collection_id like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotLike(String value) { + addCriterion("test_plan_collection_id not like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIn(List values) { + addCriterion("test_plan_collection_id in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotIn(List values) { + addCriterion("test_plan_collection_id not in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdBetween(String value1, String value2) { + addCriterion("test_plan_collection_id between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotBetween(String value1, String value2) { + addCriterion("test_plan_collection_id not between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml index ae14713ec9..2e6bfd4b99 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiCaseMapper.xml @@ -4,6 +4,8 @@ + + @@ -12,6 +14,7 @@ + @@ -72,8 +75,9 @@ - id, test_plan_report_id, test_plan_api_case_id, api_case_id, api_case_num, api_case_name, - api_case_module, api_case_priority, api_case_execute_user, api_case_execute_result + id, test_plan_report_id, test_plan_collection_id, environment_id, test_plan_api_case_id, + api_case_id, api_case_num, api_case_name, api_case_module, api_case_priority, api_case_execute_user, + api_case_execute_result, api_case_execute_report_id @@ -197,6 +221,12 @@ test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + + + environment_id = #{record.environmentId,jdbcType=VARCHAR}, + test_plan_api_case_id = #{record.testPlanApiCaseId,jdbcType=VARCHAR}, @@ -221,6 +251,9 @@ api_case_execute_result = #{record.apiCaseExecuteResult,jdbcType=VARCHAR}, + + api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR}, + @@ -230,6 +263,8 @@ update test_plan_report_api_case set id = #{record.id,jdbcType=VARCHAR}, test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + environment_id = #{record.environmentId,jdbcType=VARCHAR}, test_plan_api_case_id = #{record.testPlanApiCaseId,jdbcType=VARCHAR}, api_case_id = #{record.apiCaseId,jdbcType=VARCHAR}, api_case_num = #{record.apiCaseNum,jdbcType=BIGINT}, @@ -237,7 +272,8 @@ api_case_module = #{record.apiCaseModule,jdbcType=VARCHAR}, api_case_priority = #{record.apiCasePriority,jdbcType=VARCHAR}, api_case_execute_user = #{record.apiCaseExecuteUser,jdbcType=VARCHAR}, - api_case_execute_result = #{record.apiCaseExecuteResult,jdbcType=VARCHAR} + api_case_execute_result = #{record.apiCaseExecuteResult,jdbcType=VARCHAR}, + api_case_execute_report_id = #{record.apiCaseExecuteReportId,jdbcType=VARCHAR} @@ -248,6 +284,12 @@ test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + + + environment_id = #{environmentId,jdbcType=VARCHAR}, + test_plan_api_case_id = #{testPlanApiCaseId,jdbcType=VARCHAR}, @@ -272,12 +314,17 @@ api_case_execute_result = #{apiCaseExecuteResult,jdbcType=VARCHAR}, + + api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update test_plan_report_api_case set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + environment_id = #{environmentId,jdbcType=VARCHAR}, test_plan_api_case_id = #{testPlanApiCaseId,jdbcType=VARCHAR}, api_case_id = #{apiCaseId,jdbcType=VARCHAR}, api_case_num = #{apiCaseNum,jdbcType=BIGINT}, @@ -285,21 +332,23 @@ api_case_module = #{apiCaseModule,jdbcType=VARCHAR}, api_case_priority = #{apiCasePriority,jdbcType=VARCHAR}, api_case_execute_user = #{apiCaseExecuteUser,jdbcType=VARCHAR}, - api_case_execute_result = #{apiCaseExecuteResult,jdbcType=VARCHAR} + api_case_execute_result = #{apiCaseExecuteResult,jdbcType=VARCHAR}, + api_case_execute_report_id = #{apiCaseExecuteReportId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_api_case - (id, test_plan_report_id, test_plan_api_case_id, api_case_id, api_case_num, api_case_name, - api_case_module, api_case_priority, api_case_execute_user, api_case_execute_result - ) + (id, test_plan_report_id, test_plan_collection_id, environment_id, test_plan_api_case_id, + api_case_id, api_case_num, api_case_name, api_case_module, api_case_priority, api_case_execute_user, + api_case_execute_result, api_case_execute_report_id) values - (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanApiCaseId,jdbcType=VARCHAR}, + (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanCollectionId,jdbcType=VARCHAR}, + #{item.environmentId,jdbcType=VARCHAR}, #{item.testPlanApiCaseId,jdbcType=VARCHAR}, #{item.apiCaseId,jdbcType=VARCHAR}, #{item.apiCaseNum,jdbcType=BIGINT}, #{item.apiCaseName,jdbcType=VARCHAR}, #{item.apiCaseModule,jdbcType=VARCHAR}, #{item.apiCasePriority,jdbcType=VARCHAR}, - #{item.apiCaseExecuteUser,jdbcType=VARCHAR}, #{item.apiCaseExecuteResult,jdbcType=VARCHAR} - ) + #{item.apiCaseExecuteUser,jdbcType=VARCHAR}, #{item.apiCaseExecuteResult,jdbcType=VARCHAR}, + #{item.apiCaseExecuteReportId,jdbcType=VARCHAR}) @@ -318,6 +367,12 @@ #{item.testPlanReportId,jdbcType=VARCHAR} + + #{item.testPlanCollectionId,jdbcType=VARCHAR} + + + #{item.environmentId,jdbcType=VARCHAR} + #{item.testPlanApiCaseId,jdbcType=VARCHAR} @@ -342,6 +397,9 @@ #{item.apiCaseExecuteResult,jdbcType=VARCHAR} + + #{item.apiCaseExecuteReportId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml index aa03f8e8e7..1ee3b2582b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportApiScenarioMapper.xml @@ -4,6 +4,9 @@ + + + @@ -12,6 +15,7 @@ + @@ -72,9 +76,9 @@ - id, test_plan_report_id, test_plan_api_scenario_id, api_scenario_id, api_scenario_num, - api_scenario_name, api_scenario_module, api_scenario_priority, api_scenario_execute_user, - api_scenario_execute_result + id, test_plan_report_id, test_plan_collection_id, grouped, environment_id, test_plan_api_scenario_id, + api_scenario_id, api_scenario_num, api_scenario_name, api_scenario_module, api_scenario_priority, + api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id @@ -200,6 +230,15 @@ test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + + + grouped = #{record.grouped,jdbcType=BIT}, + + + environment_id = #{record.environmentId,jdbcType=VARCHAR}, + test_plan_api_scenario_id = #{record.testPlanApiScenarioId,jdbcType=VARCHAR}, @@ -224,6 +263,9 @@ api_scenario_execute_result = #{record.apiScenarioExecuteResult,jdbcType=VARCHAR}, + + api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR}, + @@ -233,6 +275,9 @@ update test_plan_report_api_scenario set id = #{record.id,jdbcType=VARCHAR}, test_plan_report_id = #{record.testPlanReportId,jdbcType=VARCHAR}, + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + grouped = #{record.grouped,jdbcType=BIT}, + environment_id = #{record.environmentId,jdbcType=VARCHAR}, test_plan_api_scenario_id = #{record.testPlanApiScenarioId,jdbcType=VARCHAR}, api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR}, api_scenario_num = #{record.apiScenarioNum,jdbcType=BIGINT}, @@ -240,7 +285,8 @@ api_scenario_module = #{record.apiScenarioModule,jdbcType=VARCHAR}, api_scenario_priority = #{record.apiScenarioPriority,jdbcType=VARCHAR}, api_scenario_execute_user = #{record.apiScenarioExecuteUser,jdbcType=VARCHAR}, - api_scenario_execute_result = #{record.apiScenarioExecuteResult,jdbcType=VARCHAR} + api_scenario_execute_result = #{record.apiScenarioExecuteResult,jdbcType=VARCHAR}, + api_scenario_execute_report_id = #{record.apiScenarioExecuteReportId,jdbcType=VARCHAR} @@ -251,6 +297,15 @@ test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + + + grouped = #{grouped,jdbcType=BIT}, + + + environment_id = #{environmentId,jdbcType=VARCHAR}, + test_plan_api_scenario_id = #{testPlanApiScenarioId,jdbcType=VARCHAR}, @@ -275,12 +330,18 @@ api_scenario_execute_result = #{apiScenarioExecuteResult,jdbcType=VARCHAR}, + + api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} update test_plan_report_api_scenario set test_plan_report_id = #{testPlanReportId,jdbcType=VARCHAR}, + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + grouped = #{grouped,jdbcType=BIT}, + environment_id = #{environmentId,jdbcType=VARCHAR}, test_plan_api_scenario_id = #{testPlanApiScenarioId,jdbcType=VARCHAR}, api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR}, api_scenario_num = #{apiScenarioNum,jdbcType=BIGINT}, @@ -288,21 +349,25 @@ api_scenario_module = #{apiScenarioModule,jdbcType=VARCHAR}, api_scenario_priority = #{apiScenarioPriority,jdbcType=VARCHAR}, api_scenario_execute_user = #{apiScenarioExecuteUser,jdbcType=VARCHAR}, - api_scenario_execute_result = #{apiScenarioExecuteResult,jdbcType=VARCHAR} + api_scenario_execute_result = #{apiScenarioExecuteResult,jdbcType=VARCHAR}, + api_scenario_execute_report_id = #{apiScenarioExecuteReportId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_api_scenario - (id, test_plan_report_id, test_plan_api_scenario_id, api_scenario_id, api_scenario_num, - api_scenario_name, api_scenario_module, api_scenario_priority, api_scenario_execute_user, - api_scenario_execute_result) + (id, test_plan_report_id, test_plan_collection_id, grouped, environment_id, test_plan_api_scenario_id, + api_scenario_id, api_scenario_num, api_scenario_name, api_scenario_module, api_scenario_priority, + api_scenario_execute_user, api_scenario_execute_result, api_scenario_execute_report_id + ) values - (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanApiScenarioId,jdbcType=VARCHAR}, + (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanCollectionId,jdbcType=VARCHAR}, + #{item.grouped,jdbcType=BIT}, #{item.environmentId,jdbcType=VARCHAR}, #{item.testPlanApiScenarioId,jdbcType=VARCHAR}, #{item.apiScenarioId,jdbcType=VARCHAR}, #{item.apiScenarioNum,jdbcType=BIGINT}, #{item.apiScenarioName,jdbcType=VARCHAR}, #{item.apiScenarioModule,jdbcType=VARCHAR}, #{item.apiScenarioPriority,jdbcType=VARCHAR}, #{item.apiScenarioExecuteUser,jdbcType=VARCHAR}, - #{item.apiScenarioExecuteResult,jdbcType=VARCHAR}) + #{item.apiScenarioExecuteResult,jdbcType=VARCHAR}, #{item.apiScenarioExecuteReportId,jdbcType=VARCHAR} + ) @@ -321,6 +386,15 @@ #{item.testPlanReportId,jdbcType=VARCHAR} + + #{item.testPlanCollectionId,jdbcType=VARCHAR} + + + #{item.grouped,jdbcType=BIT} + + + #{item.environmentId,jdbcType=VARCHAR} + #{item.testPlanApiScenarioId,jdbcType=VARCHAR} @@ -345,6 +419,9 @@ #{item.apiScenarioExecuteResult,jdbcType=VARCHAR} + + #{item.apiScenarioExecuteReportId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml index 4052247d25..20ac2d878a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanReportFunctionCaseMapper.xml @@ -13,6 +13,7 @@ + @@ -75,7 +76,7 @@ id, test_plan_report_id, test_plan_function_case_id, function_case_id, function_case_num, function_case_name, function_case_module, function_case_priority, function_case_execute_user, - function_case_bug_count, function_case_execute_result + function_case_bug_count, function_case_execute_result, test_plan_collection_id @@ -234,6 +243,9 @@ function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR}, + + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + @@ -251,7 +263,8 @@ function_case_priority = #{record.functionCasePriority,jdbcType=VARCHAR}, function_case_execute_user = #{record.functionCaseExecuteUser,jdbcType=VARCHAR}, function_case_bug_count = #{record.functionCaseBugCount,jdbcType=BIGINT}, - function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR} + function_case_execute_result = #{record.functionCaseExecuteResult,jdbcType=VARCHAR}, + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR} @@ -289,6 +302,9 @@ function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR}, + + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -303,22 +319,23 @@ function_case_priority = #{functionCasePriority,jdbcType=VARCHAR}, function_case_execute_user = #{functionCaseExecuteUser,jdbcType=VARCHAR}, function_case_bug_count = #{functionCaseBugCount,jdbcType=BIGINT}, - function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR} + function_case_execute_result = #{functionCaseExecuteResult,jdbcType=VARCHAR}, + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into test_plan_report_function_case (id, test_plan_report_id, test_plan_function_case_id, function_case_id, function_case_num, function_case_name, function_case_module, function_case_priority, function_case_execute_user, - function_case_bug_count, function_case_execute_result) + function_case_bug_count, function_case_execute_result, test_plan_collection_id) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanReportId,jdbcType=VARCHAR}, #{item.testPlanFunctionCaseId,jdbcType=VARCHAR}, #{item.functionCaseId,jdbcType=VARCHAR}, #{item.functionCaseNum,jdbcType=BIGINT}, #{item.functionCaseName,jdbcType=VARCHAR}, #{item.functionCaseModule,jdbcType=VARCHAR}, #{item.functionCasePriority,jdbcType=VARCHAR}, #{item.functionCaseExecuteUser,jdbcType=VARCHAR}, - #{item.functionCaseBugCount,jdbcType=BIGINT}, #{item.functionCaseExecuteResult,jdbcType=VARCHAR} - ) + #{item.functionCaseBugCount,jdbcType=BIGINT}, #{item.functionCaseExecuteResult,jdbcType=VARCHAR}, + #{item.testPlanCollectionId,jdbcType=VARCHAR}) @@ -364,6 +381,9 @@ #{item.functionCaseExecuteResult,jdbcType=VARCHAR} + + #{item.testPlanCollectionId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql index 4123129d8c..7f730f1438 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.1/ddl/V3.0.1_2__ga_ddl.sql @@ -179,6 +179,8 @@ ALTER TABLE `user` CREATE TABLE IF NOT EXISTS test_plan_report_api_case( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' , + `test_plan_collection_id` VARCHAR(50) NOT NULL COMMENT '测试集ID' , + `environment_id` VARCHAR(50) COMMENT '环境ID' , `test_plan_api_case_id` VARCHAR(50) NOT NULL COMMENT '测试计划接口用例关联ID' , `api_case_id` VARCHAR(50) NOT NULL COMMENT '接口用例ID' , `api_case_num` BIGINT NOT NULL COMMENT '接口用例业务ID' , @@ -186,15 +188,20 @@ CREATE TABLE IF NOT EXISTS test_plan_report_api_case( `api_case_module` VARCHAR(255) COMMENT '接口用例所属模块' , `api_case_priority` VARCHAR(255) COMMENT '接口用例等级' , `api_case_execute_user` VARCHAR(50) COMMENT '接口用例执行人' , - `api_case_execute_result` VARCHAR(50) NOT NULL COMMENT '接口用例执行结果' , + `api_case_execute_result` VARCHAR(50) COMMENT '接口用例执行结果' , + `api_case_execute_report_id` VARCHAR(50) COMMENT '接口用例执行报告ID' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容接口用例部分'; CREATE INDEX idx_test_plan_report_id ON test_plan_report_api_case(test_plan_report_id); +CREATE INDEX idx_test_plan_collection_id ON test_plan_report_api_case(test_plan_collection_id); -- 测试计划报告场景详情部分 CREATE TABLE IF NOT EXISTS test_plan_report_api_scenario( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `test_plan_report_id` VARCHAR(50) NOT NULL COMMENT '测试计划报告ID' , + `test_plan_collection_id` VARCHAR(50) NOT NULL COMMENT '测试集ID' , + `grouped` BIT(1) COMMENT '是否环境组' , + `environment_id` VARCHAR(50) COMMENT '环境ID' , `test_plan_api_scenario_id` VARCHAR(50) NOT NULL COMMENT '测试计划场景用例关联ID' , `api_scenario_id` VARCHAR(50) NOT NULL COMMENT '场景用例ID' , `api_scenario_num` BIGINT NOT NULL COMMENT '场景用例业务ID' , @@ -202,15 +209,21 @@ CREATE TABLE IF NOT EXISTS test_plan_report_api_scenario( `api_scenario_module` VARCHAR(255) COMMENT '场景用例所属模块' , `api_scenario_priority` VARCHAR(255) COMMENT '场景用例等级' , `api_scenario_execute_user` VARCHAR(50) COMMENT '场景用例执行人' , - `api_scenario_execute_result` VARCHAR(50) NOT NULL COMMENT '场景用例执行结果' , + `api_scenario_execute_result` VARCHAR(50) COMMENT '场景用例执行结果' , + `api_scenario_execute_report_id` VARCHAR(50) COMMENT '场景用例执行报告ID' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试计划报告内容接口场景部分'; CREATE INDEX idx_test_plan_report_id ON test_plan_report_api_scenario(test_plan_report_id); +CREATE INDEX idx_test_plan_collection_id ON test_plan_report_api_scenario(test_plan_collection_id); -- 测试计划报告 ALTER TABLE test_plan_report ADD `execute_rate` DECIMAL(10, 4) COMMENT '执行率'; ALTER TABLE test_plan_report ADD `parent_id` VARCHAR(50) COMMENT '独立报告的父级ID'; +-- 计划报告功能用例明细表 +ALTER TABLE test_plan_report_function_case ADD `test_plan_collection_id` VARCHAR(50) NOT NULL COMMENT '测试集ID'; +CREATE INDEX idx_test_plan_collection_id ON test_plan_report_function_case(test_plan_collection_id); + -- set innodb lock wait timeout to default SET SESSION innodb_lock_wait_timeout = DEFAULT; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java index 753c908cda..57b39ddc48 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java @@ -122,7 +122,7 @@ public class TestPlanReportController { @PostMapping("/detail/bug/page") @Operation(summary = "测试计划-报告-详情-缺陷分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) - @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report") + @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") public Pager> pageBug(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc"); @@ -132,7 +132,7 @@ public class TestPlanReportController { @PostMapping("/detail/functional/case/page") @Operation(summary = "测试计划-报告-详情-功能用例分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) - @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report") + @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") public Pager> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprfc.function_case_num, tprfc.id desc"); @@ -142,7 +142,7 @@ public class TestPlanReportController { @PostMapping("/detail/api/case/page") @Operation(summary = "测试计划-报告-详情-接口用例分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) - @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report") + @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") public Pager> pageApiCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprac.api_case_num, tprac.id desc"); @@ -152,7 +152,7 @@ public class TestPlanReportController { @PostMapping("/detail/scenario/case/page") @Operation(summary = "测试计划-报告-详情-场景用例分页查询") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ) - @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report") + @CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report") public Pager> pageScenarioCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tpras.api_scenario_num, tpras.id desc"); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java index 3c170f937b..204c66161e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/ReportDetailCasePageDTO.java @@ -1,5 +1,6 @@ package io.metersphere.plan.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** @@ -9,38 +10,22 @@ import lombok.Data; @Data public class ReportDetailCasePageDTO { - // ID、用例名称、所属模块、用例等级、执行人、执行结果、缺陷数 - - /** - * 用例ID - */ + @Schema(description = "用例ID") private String id; - /** - * 用例业务ID - */ + @Schema(description = "用例业务ID") private Long num; - /** - * 用例名称 - */ + @Schema(description = "用例名称") private String name; - /** - * 所属模块 - */ + @Schema(description = "所属模块") private String moduleName; - /** - * 用例等级 - */ + @Schema(description = "用例等级") private String priority; - /** - * 执行结果 - */ + @Schema(description = "执行结果") private String executeResult; - /** - * 执行人 - */ + @Schema(description = "执行人") private String executeUser; - /** - * 缺陷数 - */ + @Schema(description = "缺陷数") private Long bugCount; + @Schema(description = "报告详情ID") + private String reportId; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java index 10a1bcfdc3..5838b174b8 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanReportGenPreParam.java @@ -1,8 +1,11 @@ package io.metersphere.plan.dto; +import io.metersphere.plan.domain.TestPlan; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.util.List; + @Data public class TestPlanReportGenPreParam { @@ -30,8 +33,8 @@ public class TestPlanReportGenPreParam { @Schema(description = "是否集成报告") private Boolean integrated; - @Schema(description = "计划数量, 集成报告需要") - private Long planCount; + @Schema(description = "子计划, 集成报告需要") + private List childPlans; @Schema(description = "计划组报告ID, 独立报告需要") private String groupReportId; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.java index 57fb4c7d3d..4c9afd8041 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.java @@ -25,6 +25,13 @@ public interface ExtTestPlanReportApiCaseMapper { */ List getPlanExecuteCases(@Param("id") String planId); + /** + * 获取计划关联的接口用例 + * @param planIds 计划ID集合 + * @return 接口用例列表 + */ + List getGroupExecuteCases(@Param("ids") List planIds); + /** * 获取项目下接口用例所属模块集合 * @param projectId 计划ID diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml index 20fcb1c87f..0af02affae 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiCaseMapper.xml @@ -9,6 +9,7 @@ + + select distinct tprac.api_case_id as id, tprac.api_case_num as num, tprac.api_case_name as name, - tprac.api_case_module as moduleName, tprac.api_case_priority as priority, + tprac.api_case_module as moduleName, tprac.api_case_priority as priority, tprac.api_case_execute_report_id reportId, tprac.api_case_execute_result as executeResult, tprac.api_case_execute_user as executeUser from test_plan_report_api_case tprac where tprac.test_plan_report_id = #{request.reportId} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.java index e6e6fb8844..7e71cb87f6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.java @@ -25,6 +25,13 @@ public interface ExtTestPlanReportApiScenarioMapper { */ List getPlanExecuteCases(@Param("id") String planId); + /** + * 获取计划关联的场景用例 + * @param planIds 计划ID集合 + * @return 场景用例列表 + */ + List getGroupExecuteCases(@Param("ids") List planIds); + /** * 获取项目下场景用例所属模块集合 * @param projectId 计划ID diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml index d1d9445149..f8a2f1ca18 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportApiScenarioMapper.xml @@ -9,6 +9,7 @@ + + select distinct tpras.api_scenario_id as id, tpras.api_scenario_num as num, tpras.api_scenario_name as name, - tpras.api_scenario_module as moduleName, tpras.api_scenario_priority as priority, + tpras.api_scenario_module as moduleName, tpras.api_scenario_priority as priority, tpras.api_scenario_execute_report_id reportId, tpras.api_scenario_execute_result as executeResult, tpras.api_scenario_execute_user as executeUser from test_plan_report_api_scenario tpras where tpras.test_plan_report_id = #{request.reportId} diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java index 0ce9332405..dc2b1281d4 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.java @@ -16,6 +16,13 @@ public interface ExtTestPlanReportBugMapper { */ List getPlanBugs(@Param("id") String planId); + /** + * 获取计划的缺陷集合 + * @param planIds 计划ID集合 + * @return 缺陷集合 + */ + List getGroupBugs(@Param("ids") List planIds); + /** * 分页查询报告关联的缺陷 * @param request 请求参数 diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml index 961b03d319..8b76363fe6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanReportBugMapper.xml @@ -10,6 +10,17 @@ group by brc.bug_id + + - select tpfc.id as testPlanFunctionCaseId, fc.id as functionCaseId, fc.num as functionCaseNum, fc.name as functionCaseName, + select tpfc.id as testPlanFunctionCaseId, fc.id as functionCaseId, fc.num as functionCaseNum, fc.name as functionCaseName, tpfc.test_plan_collection_id testPlanCollectionId, if(fc.module_id = 'root','未规划用例', fc.module_id) as functionCaseModule, tpfc.execute_user as functionCaseExecuteUser, count(brc.id) as functionCaseBugCount, ifnull(tpfc.last_exec_result, 'PENDING') as functionCaseExecuteResult from test_plan_functional_case tpfc join functional_case fc on tpfc.functional_case_id = fc.id @@ -13,6 +13,20 @@ group by tpfc.id + +