From 42c1e54d80fd9d4977716a3ceb4ef8fb5a5f9663 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 21 Feb 2024 10:34:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E8=AE=B0=E5=BD=95=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/domain/ApiReport.java | 6 - .../api/domain/ApiReportExample.java | 70 ---- .../api/domain/ApiScenarioRecord.java | 96 +++++ .../api/domain/ApiScenarioRecordExample.java | 340 ++++++++++++++++++ .../api/domain/ApiScenarioReport.java | 6 - .../api/domain/ApiScenarioReportExample.java | 70 ---- .../api/domain/ApiTestCaseRecord.java | 96 +++++ .../api/domain/ApiTestCaseRecordExample.java | 340 ++++++++++++++++++ .../api/mapper/ApiReportMapper.xml | 100 +++--- .../api/mapper/ApiReportStepMapper.java | 5 +- .../api/mapper/ApiScenarioRecordMapper.java | 28 ++ .../api/mapper/ApiScenarioRecordMapper.xml | 176 +++++++++ .../api/mapper/ApiScenarioReportMapper.xml | 100 +++--- .../api/mapper/ApiTestCaseRecordMapper.java | 28 ++ .../api/mapper/ApiTestCaseRecordMapper.xml | 173 +++++++++ .../3.0.0/ddl/V3.0.0_5__api_test.sql | 22 +- .../api/mapper/ExtApiDefinitionMapper.xml | 3 +- .../api/mapper/ExtApiReportMapper.xml | 3 +- .../api/mapper/ExtApiScenarioReportMapper.xml | 3 +- .../api/mapper/ExtApiTestCaseMapper.xml | 13 +- .../api/service/ApiTaskCenterService.java | 1 - .../scenario/ApiScenarioReportService.java | 3 +- .../src/main/resources/apiGeneratorConfig.xml | 4 +- .../controller/ApiReportControllerTests.java | 2 - .../controller/ApiReportSendNoticeTests.java | 4 +- .../ApiScenarioReportControllerTests.java | 6 +- .../ApiTaskCenterControllerTests.java | 2 - .../ApiTestCaseControllerTests.java | 11 +- .../api/controller/CleanupApiTests.java | 2 - .../resources/dml/init_api_definition.sql | 102 +++--- 30 files changed, 1471 insertions(+), 344 deletions(-) create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecord.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecordExample.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecord.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecordExample.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioRecordMapper.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioRecordMapper.xml create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiTestCaseRecordMapper.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiTestCaseRecordMapper.xml diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java index 47e2471b0c..5d98510151 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReport.java @@ -20,11 +20,6 @@ public class ApiReport implements Serializable { @Size(min = 1, max = 255, message = "{api_report.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "用例id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{api_report.resource_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{api_report.resource_id.length_range}", groups = {Created.class, Updated.class}) - private String resourceId; - @Schema(description = "测试计划id", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{api_report.test_plan_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{api_report.test_plan_id.length_range}", groups = {Created.class, Updated.class}) @@ -152,7 +147,6 @@ public class ApiReport implements Serializable { public enum Column { id("id", "id", "VARCHAR", false), name("name", "name", "VARCHAR", true), - resourceId("resource_id", "resourceId", "VARCHAR", false), testPlanId("test_plan_id", "testPlanId", "VARCHAR", false), createUser("create_user", "createUser", "VARCHAR", false), deleteTime("delete_time", "deleteTime", "BIGINT", false), diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java index 370ed54a48..5de467396f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiReportExample.java @@ -244,76 +244,6 @@ public class ApiReportExample { return (Criteria) this; } - public Criteria andResourceIdIsNull() { - addCriterion("resource_id is null"); - return (Criteria) this; - } - - public Criteria andResourceIdIsNotNull() { - addCriterion("resource_id is not null"); - return (Criteria) this; - } - - public Criteria andResourceIdEqualTo(String value) { - addCriterion("resource_id =", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotEqualTo(String value) { - addCriterion("resource_id <>", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdGreaterThan(String value) { - addCriterion("resource_id >", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdGreaterThanOrEqualTo(String value) { - addCriterion("resource_id >=", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLessThan(String value) { - addCriterion("resource_id <", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLessThanOrEqualTo(String value) { - addCriterion("resource_id <=", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLike(String value) { - addCriterion("resource_id like", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotLike(String value) { - addCriterion("resource_id not like", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdIn(List values) { - addCriterion("resource_id in", values, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotIn(List values) { - addCriterion("resource_id not in", values, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdBetween(String value1, String value2) { - addCriterion("resource_id between", value1, value2, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotBetween(String value1, String value2) { - addCriterion("resource_id not between", value1, value2, "resourceId"); - return (Criteria) this; - } - public Criteria andTestPlanIdIsNull() { addCriterion("test_plan_id is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecord.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecord.java new file mode 100644 index 0000000000..006a98721c --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecord.java @@ -0,0 +1,96 @@ +package io.metersphere.api.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class ApiScenarioRecord implements Serializable { + @Schema(description = "报告id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_scenario_record.api_scenario_report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_scenario_record.api_scenario_report_id.length_range}", groups = {Created.class, Updated.class}) + private String apiScenarioReportId; + + @Schema(description = "场景id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_scenario_record.api_scenario_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_scenario_record.api_scenario_id.length_range}", groups = {Created.class, Updated.class}) + private String apiScenarioId; + + private static final long serialVersionUID = 1L; + + public enum Column { + apiScenarioReportId("api_scenario_report_id", "apiScenarioReportId", "VARCHAR", false), + apiScenarioId("api_scenario_id", "apiScenarioId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecordExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecordExample.java new file mode 100644 index 0000000000..1139a7c55c --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioRecordExample.java @@ -0,0 +1,340 @@ +package io.metersphere.api.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiScenarioRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiScenarioRecordExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andApiScenarioReportIdIsNull() { + addCriterion("api_scenario_report_id is null"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdIsNotNull() { + addCriterion("api_scenario_report_id is not null"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdEqualTo(String value) { + addCriterion("api_scenario_report_id =", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdNotEqualTo(String value) { + addCriterion("api_scenario_report_id <>", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdGreaterThan(String value) { + addCriterion("api_scenario_report_id >", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdGreaterThanOrEqualTo(String value) { + addCriterion("api_scenario_report_id >=", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdLessThan(String value) { + addCriterion("api_scenario_report_id <", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdLessThanOrEqualTo(String value) { + addCriterion("api_scenario_report_id <=", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdLike(String value) { + addCriterion("api_scenario_report_id like", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdNotLike(String value) { + addCriterion("api_scenario_report_id not like", value, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdIn(List values) { + addCriterion("api_scenario_report_id in", values, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdNotIn(List values) { + addCriterion("api_scenario_report_id not in", values, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdBetween(String value1, String value2) { + addCriterion("api_scenario_report_id between", value1, value2, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioReportIdNotBetween(String value1, String value2) { + addCriterion("api_scenario_report_id not between", value1, value2, "apiScenarioReportId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdIsNull() { + addCriterion("api_scenario_id is null"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdIsNotNull() { + addCriterion("api_scenario_id is not null"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdEqualTo(String value) { + addCriterion("api_scenario_id =", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdNotEqualTo(String value) { + addCriterion("api_scenario_id <>", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdGreaterThan(String value) { + addCriterion("api_scenario_id >", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdGreaterThanOrEqualTo(String value) { + addCriterion("api_scenario_id >=", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdLessThan(String value) { + addCriterion("api_scenario_id <", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdLessThanOrEqualTo(String value) { + addCriterion("api_scenario_id <=", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdLike(String value) { + addCriterion("api_scenario_id like", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdNotLike(String value) { + addCriterion("api_scenario_id not like", value, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdIn(List values) { + addCriterion("api_scenario_id in", values, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdNotIn(List values) { + addCriterion("api_scenario_id not in", values, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdBetween(String value1, String value2) { + addCriterion("api_scenario_id between", value1, value2, "apiScenarioId"); + return (Criteria) this; + } + + public Criteria andApiScenarioIdNotBetween(String value1, String value2) { + addCriterion("api_scenario_id not between", value1, value2, "apiScenarioId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java index 6c49cc097c..ffaa9fbe48 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReport.java @@ -20,11 +20,6 @@ public class ApiScenarioReport implements Serializable { @Size(min = 1, max = 255, message = "{api_scenario_report.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "场景fk", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{api_scenario_report.scenario_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{api_scenario_report.scenario_id.length_range}", groups = {Created.class, Updated.class}) - private String scenarioId; - @Schema(description = "测试计划id", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{api_scenario_report.test_plan_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{api_scenario_report.test_plan_id.length_range}", groups = {Created.class, Updated.class}) @@ -152,7 +147,6 @@ public class ApiScenarioReport implements Serializable { public enum Column { id("id", "id", "VARCHAR", false), name("name", "name", "VARCHAR", true), - scenarioId("scenario_id", "scenarioId", "VARCHAR", false), testPlanId("test_plan_id", "testPlanId", "VARCHAR", false), createUser("create_user", "createUser", "VARCHAR", false), deleteTime("delete_time", "deleteTime", "BIGINT", false), diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java index 7e300046bd..a765c11a68 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiScenarioReportExample.java @@ -244,76 +244,6 @@ public class ApiScenarioReportExample { return (Criteria) this; } - public Criteria andScenarioIdIsNull() { - addCriterion("scenario_id is null"); - return (Criteria) this; - } - - public Criteria andScenarioIdIsNotNull() { - addCriterion("scenario_id is not null"); - return (Criteria) this; - } - - public Criteria andScenarioIdEqualTo(String value) { - addCriterion("scenario_id =", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdNotEqualTo(String value) { - addCriterion("scenario_id <>", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdGreaterThan(String value) { - addCriterion("scenario_id >", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdGreaterThanOrEqualTo(String value) { - addCriterion("scenario_id >=", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdLessThan(String value) { - addCriterion("scenario_id <", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdLessThanOrEqualTo(String value) { - addCriterion("scenario_id <=", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdLike(String value) { - addCriterion("scenario_id like", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdNotLike(String value) { - addCriterion("scenario_id not like", value, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdIn(List values) { - addCriterion("scenario_id in", values, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdNotIn(List values) { - addCriterion("scenario_id not in", values, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdBetween(String value1, String value2) { - addCriterion("scenario_id between", value1, value2, "scenarioId"); - return (Criteria) this; - } - - public Criteria andScenarioIdNotBetween(String value1, String value2) { - addCriterion("scenario_id not between", value1, value2, "scenarioId"); - return (Criteria) this; - } - public Criteria andTestPlanIdIsNull() { addCriterion("test_plan_id is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecord.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecord.java new file mode 100644 index 0000000000..d00e1bd014 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecord.java @@ -0,0 +1,96 @@ +package io.metersphere.api.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class ApiTestCaseRecord implements Serializable { + @Schema(description = "报告id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_test_case_record.api_report_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_test_case_record.api_report_id.length_range}", groups = {Created.class, Updated.class}) + private String apiReportId; + + @Schema(description = "用例id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{api_test_case_record.api_test_case_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{api_test_case_record.api_test_case_id.length_range}", groups = {Created.class, Updated.class}) + private String apiTestCaseId; + + private static final long serialVersionUID = 1L; + + public enum Column { + apiReportId("api_report_id", "apiReportId", "VARCHAR", false), + apiTestCaseId("api_test_case_id", "apiTestCaseId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecordExample.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecordExample.java new file mode 100644 index 0000000000..b0aedd568e --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiTestCaseRecordExample.java @@ -0,0 +1,340 @@ +package io.metersphere.api.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ApiTestCaseRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ApiTestCaseRecordExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andApiReportIdIsNull() { + addCriterion("api_report_id is null"); + return (Criteria) this; + } + + public Criteria andApiReportIdIsNotNull() { + addCriterion("api_report_id is not null"); + return (Criteria) this; + } + + public Criteria andApiReportIdEqualTo(String value) { + addCriterion("api_report_id =", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdNotEqualTo(String value) { + addCriterion("api_report_id <>", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdGreaterThan(String value) { + addCriterion("api_report_id >", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdGreaterThanOrEqualTo(String value) { + addCriterion("api_report_id >=", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdLessThan(String value) { + addCriterion("api_report_id <", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdLessThanOrEqualTo(String value) { + addCriterion("api_report_id <=", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdLike(String value) { + addCriterion("api_report_id like", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdNotLike(String value) { + addCriterion("api_report_id not like", value, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdIn(List values) { + addCriterion("api_report_id in", values, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdNotIn(List values) { + addCriterion("api_report_id not in", values, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdBetween(String value1, String value2) { + addCriterion("api_report_id between", value1, value2, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiReportIdNotBetween(String value1, String value2) { + addCriterion("api_report_id not between", value1, value2, "apiReportId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdIsNull() { + addCriterion("api_test_case_id is null"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdIsNotNull() { + addCriterion("api_test_case_id is not null"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdEqualTo(String value) { + addCriterion("api_test_case_id =", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdNotEqualTo(String value) { + addCriterion("api_test_case_id <>", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdGreaterThan(String value) { + addCriterion("api_test_case_id >", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdGreaterThanOrEqualTo(String value) { + addCriterion("api_test_case_id >=", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdLessThan(String value) { + addCriterion("api_test_case_id <", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdLessThanOrEqualTo(String value) { + addCriterion("api_test_case_id <=", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdLike(String value) { + addCriterion("api_test_case_id like", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdNotLike(String value) { + addCriterion("api_test_case_id not like", value, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdIn(List values) { + addCriterion("api_test_case_id in", values, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdNotIn(List values) { + addCriterion("api_test_case_id not in", values, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdBetween(String value1, String value2) { + addCriterion("api_test_case_id between", value1, value2, "apiTestCaseId"); + return (Criteria) this; + } + + public Criteria andApiTestCaseIdNotBetween(String value1, String value2) { + addCriterion("api_test_case_id not between", value1, value2, "apiTestCaseId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml index 552f62deb1..f9afd4c889 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiReportMapper.xml @@ -4,7 +4,6 @@ - @@ -95,12 +94,12 @@ - id, `name`, resource_id, test_plan_id, create_user, delete_time, delete_user, deleted, - update_user, update_time, start_time, end_time, request_duration, `status`, trigger_mode, - run_mode, pool_id, version_id, integrated, project_id, environment_id, error_count, - fake_error_count, pending_count, success_count, assertion_count, assertion_success_count, - request_error_rate, request_pending_rate, request_fake_error_rate, request_pass_rate, - assertion_pass_rate, script_identifier + id, `name`, test_plan_id, create_user, delete_time, delete_user, deleted, update_user, + update_time, start_time, end_time, request_duration, `status`, trigger_mode, run_mode, + pool_id, version_id, integrated, project_id, environment_id, error_count, fake_error_count, + pending_count, success_count, assertion_count, assertion_success_count, request_error_rate, + request_pending_rate, request_fake_error_rate, request_pass_rate, assertion_pass_rate, + script_identifier + select + + distinct + + + from api_scenario_record + + + + + order by ${orderByClause} + + + + delete from api_scenario_record + where api_scenario_report_id = #{apiScenarioReportId,jdbcType=VARCHAR} + and api_scenario_id = #{apiScenarioId,jdbcType=VARCHAR} + + + delete from api_scenario_record + + + + + + insert into api_scenario_record (api_scenario_report_id, api_scenario_id + ) + values (#{apiScenarioReportId,jdbcType=VARCHAR}, #{apiScenarioId,jdbcType=VARCHAR} + ) + + + insert into api_scenario_record + + + api_scenario_report_id, + + + api_scenario_id, + + + + + #{apiScenarioReportId,jdbcType=VARCHAR}, + + + #{apiScenarioId,jdbcType=VARCHAR}, + + + + + + update api_scenario_record + + + api_scenario_report_id = #{record.apiScenarioReportId,jdbcType=VARCHAR}, + + + api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR}, + + + + + + + + update api_scenario_record + set api_scenario_report_id = #{record.apiScenarioReportId,jdbcType=VARCHAR}, + api_scenario_id = #{record.apiScenarioId,jdbcType=VARCHAR} + + + + + + insert into api_scenario_record + (api_scenario_report_id, api_scenario_id) + values + + (#{item.apiScenarioReportId,jdbcType=VARCHAR}, #{item.apiScenarioId,jdbcType=VARCHAR} + ) + + + + insert into api_scenario_record ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.apiScenarioReportId,jdbcType=VARCHAR} + + + #{item.apiScenarioId,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml index 0172d3cb7d..ffd9576111 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiScenarioReportMapper.xml @@ -4,7 +4,6 @@ - @@ -95,12 +94,12 @@ - id, `name`, scenario_id, test_plan_id, create_user, delete_time, delete_user, deleted, - update_user, update_time, start_time, end_time, request_duration, `status`, trigger_mode, - run_mode, pool_id, version_id, integrated, project_id, environment_id, error_count, - fake_error_count, pending_count, success_count, assertion_count, assertion_success_count, - request_error_rate, request_pending_rate, request_fake_error_rate, request_pass_rate, - assertion_pass_rate, script_identifier + id, `name`, test_plan_id, create_user, delete_time, delete_user, deleted, update_user, + update_time, start_time, end_time, request_duration, `status`, trigger_mode, run_mode, + pool_id, version_id, integrated, project_id, environment_id, error_count, fake_error_count, + pending_count, success_count, assertion_count, assertion_success_count, request_error_rate, + request_pending_rate, request_fake_error_rate, request_pass_rate, assertion_pass_rate, + script_identifier + select + + distinct + + + from api_test_case_record + + + + + order by ${orderByClause} + + + + delete from api_test_case_record + where api_report_id = #{apiReportId,jdbcType=VARCHAR} + and api_test_case_id = #{apiTestCaseId,jdbcType=VARCHAR} + + + delete from api_test_case_record + + + + + + insert into api_test_case_record (api_report_id, api_test_case_id) + values (#{apiReportId,jdbcType=VARCHAR}, #{apiTestCaseId,jdbcType=VARCHAR}) + + + insert into api_test_case_record + + + api_report_id, + + + api_test_case_id, + + + + + #{apiReportId,jdbcType=VARCHAR}, + + + #{apiTestCaseId,jdbcType=VARCHAR}, + + + + + + update api_test_case_record + + + api_report_id = #{record.apiReportId,jdbcType=VARCHAR}, + + + api_test_case_id = #{record.apiTestCaseId,jdbcType=VARCHAR}, + + + + + + + + update api_test_case_record + set api_report_id = #{record.apiReportId,jdbcType=VARCHAR}, + api_test_case_id = #{record.apiTestCaseId,jdbcType=VARCHAR} + + + + + + insert into api_test_case_record + (api_report_id, api_test_case_id) + values + + (#{item.apiReportId,jdbcType=VARCHAR}, #{item.apiTestCaseId,jdbcType=VARCHAR}) + + + + insert into api_test_case_record ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.apiReportId,jdbcType=VARCHAR} + + + #{item.apiTestCaseId,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql index e906c14e47..b35adeadc4 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_5__api_test.sql @@ -101,7 +101,6 @@ CREATE INDEX idx_name ON api_definition(name); CREATE TABLE IF NOT EXISTS api_report( `id` VARCHAR(50) NOT NULL COMMENT '接口报告pk' , `name` VARCHAR(255) NOT NULL COMMENT '接口报告名称' , - `resource_id` VARCHAR(50) NOT NULL COMMENT '用例id' , `test_plan_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '测试计划id' , `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , `delete_time` BIGINT COMMENT '删除时间' , @@ -139,7 +138,6 @@ CREATE TABLE IF NOT EXISTS api_report( COLLATE = utf8mb4_general_ci COMMENT = 'API/CASE执行结果'; CREATE INDEX idx_project_id ON api_report(project_id); -CREATE INDEX idx_resource_id ON api_report(resource_id); CREATE INDEX idx_trigger_mode ON api_report(trigger_mode); CREATE INDEX idx_run_mode ON api_report(run_mode); CREATE INDEX idx_status ON api_report(status); @@ -150,7 +148,6 @@ CREATE INDEX idx_pool_id ON api_report(pool_id); CREATE INDEX idx_start_time ON api_report(start_time); CREATE INDEX idx_integrated ON api_report(integrated); CREATE INDEX idx_test_plan_id ON api_report(test_plan_id); -DROP TABLE IF EXISTS api_scenario_report; CREATE TABLE IF NOT EXISTS api_report_step( `step_id` VARCHAR(50) NOT NULL COMMENT '步骤id' , @@ -342,7 +339,6 @@ CREATE UNIQUE INDEX uq_name_project_parent_type ON api_scenario_module (project_ CREATE TABLE IF NOT EXISTS api_scenario_report( `id` VARCHAR(50) NOT NULL COMMENT '场景报告pk' , `name` VARCHAR(255) NOT NULL COMMENT '报告名称' , - `scenario_id` VARCHAR(50) NOT NULL COMMENT '场景fk' , `test_plan_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '测试计划id' , `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , `delete_time` BIGINT COMMENT '删除时间' , @@ -379,7 +375,6 @@ CREATE TABLE IF NOT EXISTS api_scenario_report( COLLATE = utf8mb4_general_ci COMMENT = '场景报告'; CREATE INDEX idx_project_id ON api_scenario_report(project_id); -CREATE INDEX idx_scenario_id ON api_scenario_report(scenario_id); CREATE INDEX idx_trigger_mode ON api_scenario_report(trigger_mode); CREATE INDEX idx_run_mode ON api_scenario_report(run_mode); CREATE INDEX idx_status ON api_scenario_report(status); @@ -626,5 +621,22 @@ CREATE TABLE api_scenario_csv_step CREATE INDEX idx_file_id ON api_scenario_csv_step(file_id); CREATE INDEX idx_step_id ON api_scenario_csv_step(step_id); +CREATE TABLE IF NOT EXISTS api_scenario_record( + `api_scenario_report_id` VARCHAR(50) NOT NULL COMMENT '报告id' , + `api_scenario_id` VARCHAR(50) NOT NULL COMMENT '场景id' , + PRIMARY KEY (api_scenario_report_id,api_scenario_id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '场景执行记录'; + + +CREATE TABLE IF NOT EXISTS api_test_case_record( + `api_report_id` VARCHAR(50) NOT NULL COMMENT '报告id' , + `api_test_case_id` VARCHAR(50) NOT NULL COMMENT '用例id' , + PRIMARY KEY (api_report_id,api_test_case_id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '用例执行记录'; + -- set innodb lock wait timeout to default SET SESSION innodb_lock_wait_timeout = DEFAULT; \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml index ab7ea2497b..981a873d15 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml @@ -57,7 +57,8 @@ CONCAT( FORMAT( SUM( IF ( t2.`status` = 'SUCCESS', 1, 0 ))/ COUNT( t1.id )* 100, 2 ), '%' ) casePassRate FROM api_test_case t1 - LEFT JOIN api_report t2 ON t1.id = t2.resource_id + LEFT JOIN api_test_case_record t3 on t1.id = t3.api_test_case_id + LEFT JOIN api_report t2 ON t2.id = t3.api_report_id WHERE t1.project_id = #{projectId} and t1.deleted = 0 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml index 2fed21844b..f9f1c7d3e5 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml @@ -155,7 +155,8 @@ t.NAME AS poolName FROM api_report - LEFT JOIN api_test_case c ON api_report.resource_id = c.id + LEFT JOIN api_test_case_record a ON api_report.id = a.api_report_id + LEFT JOIN api_test_case c ON a.api_test_case_id = c.id LEFT JOIN test_resource_pool t ON api_report.pool_id = t.id where api_report.deleted = false and api_report.test_plan_id = 'NONE' diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml index fe7e75511b..3fd00b5ffd 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioReportMapper.xml @@ -168,7 +168,8 @@ t.name as poolName from api_scenario_report - left JOIN api_scenario s on api_scenario_report.scenario_id = s.id + left join api_scenario_record a on api_scenario_report.id = a.api_scenario_report_id + left JOIN api_scenario s on a.api_scenario_id = s.id left JOIN test_resource_pool t on api_scenario_report.pool_id = t.id where api_scenario_report.deleted = false and api_scenario_report.test_plan_id = 'NONE' diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml index 0520187a98..428cb7bf6e 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml @@ -110,7 +110,7 @@