From ab848b47a7b63b34d8cb8f1cbcca54d9ae65dcb1 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 12 Nov 2024 16:25:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):?= =?UTF-8?q?=20=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=A1=A5=E5=85=85=E8=B5=84=E6=BA=90id&?= =?UTF-8?q?=E8=AE=A1=E5=88=92id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/ExecTaskItem.java | 12 +- .../system/domain/ExecTaskItemExample.java | 118 ++++++++++++++---- .../system/mapper/ExecTaskItemMapper.xml | 60 +++++---- .../migration/3.5.0/ddl/V3.5.0_2__ga_ddl.sql | 3 +- .../api/job/ApiScenarioScheduleJob.java | 1 + .../ApiTestCaseBatchRunService.java | 1 + .../definition/ApiTestCaseRunService.java | 1 + .../scenario/ApiScenarioBatchRunService.java | 1 + .../scenario/ApiScenarioRunService.java | 1 + .../BaseTaskHubControllerTests.java | 1 + .../plan/dto/TestPlanApiCaseBatchRunDTO.java | 1 + .../dto/TestPlanApiScenarioBatchRunDTO.java | 1 + .../plan/mapper/ExtTestPlanApiCaseMapper.xml | 4 +- .../mapper/ExtTestPlanApiScenarioMapper.xml | 4 +- .../TestPlanApiCaseBatchRunService.java | 1 + .../plan/service/TestPlanApiCaseService.java | 4 +- .../TestPlanApiScenarioBatchRunService.java | 1 + .../service/TestPlanApiScenarioService.java | 2 + .../plan/service/TestPlanReportService.java | 2 + 19 files changed, 164 insertions(+), 55 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItem.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItem.java index bf11e34937..072d71f63d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItem.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItem.java @@ -78,13 +78,16 @@ public class ExecTaskItem implements Serializable { @Size(min = 1, max = 50, message = "{exec_task_item.executor.length_range}", groups = {Created.class, Updated.class}) private String executor; - @Schema(description = "测试集ID") - private String collectionId; - @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{exec_task_item.deleted.not_blank}", groups = {Created.class}) private Boolean deleted; + @Schema(description = "测试集ID") + private String collectionId; + + @Schema(description = "用例表id") + private String caseId; + private static final long serialVersionUID = 1L; public enum Column { @@ -104,8 +107,9 @@ public class ExecTaskItem implements Serializable { startTime("start_time", "startTime", "BIGINT", false), endTime("end_time", "endTime", "BIGINT", false), executor("executor", "executor", "VARCHAR", false), + deleted("deleted", "deleted", "BIT", false), collectionId("collection_id", "collectionId", "VARCHAR", false), - deleted("deleted", "deleted", "BIT", false); + caseId("case_id", "caseId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItemExample.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItemExample.java index 3d0b793be8..ddb35d7e27 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItemExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ExecTaskItemExample.java @@ -1204,6 +1204,66 @@ public class ExecTaskItemExample { return (Criteria) this; } + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + return (Criteria) this; + } + public Criteria andCollectionIdIsNull() { addCriterion("collection_id is null"); return (Criteria) this; @@ -1274,63 +1334,73 @@ public class ExecTaskItemExample { return (Criteria) this; } - public Criteria andDeletedIsNull() { - addCriterion("deleted is null"); + public Criteria andCaseIdIsNull() { + addCriterion("case_id is null"); return (Criteria) this; } - public Criteria andDeletedIsNotNull() { - addCriterion("deleted is not null"); + public Criteria andCaseIdIsNotNull() { + addCriterion("case_id is not null"); return (Criteria) this; } - public Criteria andDeletedEqualTo(Boolean value) { - addCriterion("deleted =", value, "deleted"); + public Criteria andCaseIdEqualTo(String value) { + addCriterion("case_id =", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedNotEqualTo(Boolean value) { - addCriterion("deleted <>", value, "deleted"); + public Criteria andCaseIdNotEqualTo(String value) { + addCriterion("case_id <>", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedGreaterThan(Boolean value) { - addCriterion("deleted >", value, "deleted"); + public Criteria andCaseIdGreaterThan(String value) { + addCriterion("case_id >", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { - addCriterion("deleted >=", value, "deleted"); + public Criteria andCaseIdGreaterThanOrEqualTo(String value) { + addCriterion("case_id >=", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedLessThan(Boolean value) { - addCriterion("deleted <", value, "deleted"); + public Criteria andCaseIdLessThan(String value) { + addCriterion("case_id <", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedLessThanOrEqualTo(Boolean value) { - addCriterion("deleted <=", value, "deleted"); + public Criteria andCaseIdLessThanOrEqualTo(String value) { + addCriterion("case_id <=", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedIn(List values) { - addCriterion("deleted in", values, "deleted"); + public Criteria andCaseIdLike(String value) { + addCriterion("case_id like", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedNotIn(List values) { - addCriterion("deleted not in", values, "deleted"); + public Criteria andCaseIdNotLike(String value) { + addCriterion("case_id not like", value, "caseId"); return (Criteria) this; } - public Criteria andDeletedBetween(Boolean value1, Boolean value2) { - addCriterion("deleted between", value1, value2, "deleted"); + public Criteria andCaseIdIn(List values) { + addCriterion("case_id in", values, "caseId"); return (Criteria) this; } - public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { - addCriterion("deleted not between", value1, value2, "deleted"); + public Criteria andCaseIdNotIn(List values) { + addCriterion("case_id not in", values, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdBetween(String value1, String value2) { + addCriterion("case_id between", value1, value2, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdNotBetween(String value1, String value2) { + addCriterion("case_id not between", value1, value2, "caseId"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ExecTaskItemMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ExecTaskItemMapper.xml index 5b32e8fffc..bec38d19c7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ExecTaskItemMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ExecTaskItemMapper.xml @@ -18,8 +18,9 @@ - + + @@ -82,7 +83,7 @@ id, task_id, resource_id, resource_name, task_origin, `status`, `result`, resource_pool_id, resource_pool_node, resource_type, project_id, organization_id, thread_id, start_time, - end_time, executor, collection_id, deleted + end_time, executor, deleted, collection_id, case_id SELECT test_plan_api_scenario.id as id, test_plan_api_scenario.test_plan_collection_id as testPlanCollectionId, - api_scenario.name as name + api_scenario.name as name, api_scenario.id as caseId FROM test_plan_api_scenario INNER JOIN api_scenario on api_scenario.id = test_plan_api_scenario.api_scenario_id @@ -634,7 +634,7 @@