refactor(功能用例): 功能用例domain

This commit is contained in:
WangXu10 2023-10-11 17:03:13 +08:00 committed by Craftsman
parent 51ff627911
commit 9b69e41720
53 changed files with 2527 additions and 305 deletions

View File

@ -1,8 +1,10 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
@ -20,7 +22,9 @@ public class CaseReview implements Serializable {
@Size(min = 1, max = 200, message = "{case_review.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(description = "评审状态:未开始/进行中/已完成/已结束/已归档")
@Schema(description = "评审状态:未开始/进行中/已完成/已结束/已归档", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{case_review.status.not_blank}", groups = {Created.class})
@Size(min = 1, max = 64, message = "{case_review.status.length_range}", groups = {Created.class, Updated.class})
private String status;
@Schema(description = "创建时间")
@ -30,7 +34,8 @@ public class CaseReview implements Serializable {
private Long updateTime;
@Schema(description = "评审结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{case_review.end_time.not_blank}", groups = {Created.class})
@NotBlank(message = "{case_review.end_time.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{case_review.end_time.length_range}", groups = {Created.class, Updated.class})
private Long endTime;
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@ -44,7 +49,9 @@ public class CaseReview implements Serializable {
@Schema(description = "创建人")
private String createUser;
@Schema(description = "评审规则:单人通过/全部通过")
@Schema(description = "评审规则:单人通过/全部通过", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{case_review.review_pass_rule.not_blank}", groups = {Created.class})
@Size(min = 1, max = 64, message = "{case_review.review_pass_rule.length_range}", groups = {Created.class, Updated.class})
private String reviewPassRule;
@Schema(description = "描述")

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -19,4 +23,76 @@ public class CaseReviewFollower implements Serializable {
private String userId;
private static final long serialVersionUID = 1L;
public enum Column {
reviewId("review_id", "reviewId", "VARCHAR", false),
userId("user_id", "userId", "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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -38,12 +42,93 @@ public class CaseReviewFunctionalCase implements Serializable {
private String createUser;
@Schema(description = "自定义排序间隔5000", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{case_review_functional_case.pos.not_blank}", groups = {Created.class})
@NotBlank(message = "{case_review_functional_case.pos.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{case_review_functional_case.pos.length_range}", groups = {Created.class, Updated.class})
private Long pos;
@Schema(description = "关联的用例是否放入回收站", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{case_review_functional_case.deleted.not_blank}", groups = {Created.class})
@NotBlank(message = "{case_review_functional_case.deleted.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{case_review_functional_case.deleted.length_range}", groups = {Created.class, Updated.class})
private Boolean deleted;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
reviewId("review_id", "reviewId", "VARCHAR", false),
caseId("case_id", "caseId", "VARCHAR", false),
status("status", "status", "VARCHAR", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
pos("pos", "pos", "BIGINT", false),
deleted("deleted", "deleted", "BIT", 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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -24,4 +28,77 @@ public class CaseReviewFunctionalCaseUser implements Serializable {
private String userId;
private static final long serialVersionUID = 1L;
public enum Column {
caseId("case_id", "caseId", "VARCHAR", false),
reviewId("review_id", "reviewId", "VARCHAR", false),
userId("user_id", "userId", "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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -19,4 +23,76 @@ public class CaseReviewUser implements Serializable {
private String userId;
private static final long serialVersionUID = 1L;
public enum Column {
reviewId("review_id", "reviewId", "VARCHAR", false),
userId("user_id", "userId", "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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -14,7 +18,8 @@ public class FunctionalCase implements Serializable {
private String id;
@Schema(description = "业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case.num.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case.num.not_blank}", groups = {Created.class})
@Size(min = 1, max = 10, message = "{functional_case.num.length_range}", groups = {Created.class, Updated.class})
private Integer num;
@Schema(description = "自定义业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
@ -46,12 +51,13 @@ public class FunctionalCase implements Serializable {
private String tags;
@Schema(description = "编辑模式:步骤模式/文本模式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case.step_model.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case.step_model.length_range}", groups = {Created.class, Updated.class})
private String stepModel;
@NotBlank(message = "{functional_case.case_model.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case.case_model.length_range}", groups = {Created.class, Updated.class})
private String caseModel;
@Schema(description = "自定义排序间隔5000", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case.pos.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case.pos.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{functional_case.pos.length_range}", groups = {Created.class, Updated.class})
private Long pos;
@Schema(description = "版本ID", requiredMode = Schema.RequiredMode.REQUIRED)
@ -70,20 +76,26 @@ public class FunctionalCase implements Serializable {
private String lastExecuteResult;
@Schema(description = "是否在回收站0-否1-是", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case.deleted.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case.deleted.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{functional_case.deleted.length_range}", groups = {Created.class, Updated.class})
private Boolean deleted;
@Schema(description = "是否是公共用例0-否1-是", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case.public_case.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case.public_case.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{functional_case.public_case.length_range}", groups = {Created.class, Updated.class})
private Boolean publicCase;
@Schema(description = "是否为最新版本0-否1-是", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case.latest.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case.latest.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{functional_case.latest.length_range}", groups = {Created.class, Updated.class})
private Boolean latest;
@Schema(description = "创建人")
private String createUser;
@Schema(description = "更新人")
private String updateUser;
@Schema(description = "删除人")
private String deleteUser;
@ -97,4 +109,96 @@ public class FunctionalCase implements Serializable {
private Long deleteTime;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
num("num", "num", "INTEGER", false),
customNum("custom_num", "customNum", "VARCHAR", false),
moduleId("module_id", "moduleId", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
reviewStatus("review_status", "reviewStatus", "VARCHAR", false),
tags("tags", "tags", "VARCHAR", false),
caseModel("case_model", "caseModel", "VARCHAR", false),
pos("pos", "pos", "BIGINT", false),
versionId("version_id", "versionId", "VARCHAR", false),
refId("ref_id", "refId", "VARCHAR", false),
lastExecuteResult("last_execute_result", "lastExecuteResult", "VARCHAR", false),
deleted("deleted", "deleted", "BIT", false),
publicCase("public_case", "publicCase", "BIT", false),
latest("latest", "latest", "BIT", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
deleteUser("delete_user", "deleteUser", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
deleteTime("delete_time", "deleteTime", "BIGINT", 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<Column> 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();
}
}
}

View File

@ -1,17 +1,21 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
public class FunctionalCaseAttachment implements Serializable {
@Schema(description = "功能用例ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_attachment.functional_case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case_attachment.functional_case_id.length_range}", groups = {Created.class, Updated.class})
private String functionalCaseId;
@NotBlank(message = "{functional_case_attachment.case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case_attachment.case_id.length_range}", groups = {Created.class, Updated.class})
private String caseId;
@Schema(description = "文件的ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_attachment.file_id.not_blank}", groups = {Created.class})
@ -19,4 +23,76 @@ public class FunctionalCaseAttachment implements Serializable {
private String fileId;
private static final long serialVersionUID = 1L;
public enum Column {
caseId("case_id", "caseId", "VARCHAR", false),
fileId("file_id", "fileId", "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<Column> 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();
}
}
}

View File

@ -104,73 +104,73 @@ public class FunctionalCaseAttachmentExample {
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andFunctionalCaseIdIsNull() {
addCriterion("functional_case_id is null");
public Criteria andCaseIdIsNull() {
addCriterion("case_id is null");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdIsNotNull() {
addCriterion("functional_case_id is not null");
public Criteria andCaseIdIsNotNull() {
addCriterion("case_id is not null");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdEqualTo(String value) {
addCriterion("functional_case_id =", value, "functionalCaseId");
public Criteria andCaseIdEqualTo(String value) {
addCriterion("case_id =", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotEqualTo(String value) {
addCriterion("functional_case_id <>", value, "functionalCaseId");
public Criteria andCaseIdNotEqualTo(String value) {
addCriterion("case_id <>", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdGreaterThan(String value) {
addCriterion("functional_case_id >", value, "functionalCaseId");
public Criteria andCaseIdGreaterThan(String value) {
addCriterion("case_id >", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("functional_case_id >=", value, "functionalCaseId");
public Criteria andCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("case_id >=", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLessThan(String value) {
addCriterion("functional_case_id <", value, "functionalCaseId");
public Criteria andCaseIdLessThan(String value) {
addCriterion("case_id <", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLessThanOrEqualTo(String value) {
addCriterion("functional_case_id <=", value, "functionalCaseId");
public Criteria andCaseIdLessThanOrEqualTo(String value) {
addCriterion("case_id <=", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLike(String value) {
addCriterion("functional_case_id like", value, "functionalCaseId");
public Criteria andCaseIdLike(String value) {
addCriterion("case_id like", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotLike(String value) {
addCriterion("functional_case_id not like", value, "functionalCaseId");
public Criteria andCaseIdNotLike(String value) {
addCriterion("case_id not like", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdIn(List<String> values) {
addCriterion("functional_case_id in", values, "functionalCaseId");
public Criteria andCaseIdIn(List<String> values) {
addCriterion("case_id in", values, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotIn(List<String> values) {
addCriterion("functional_case_id not in", values, "functionalCaseId");
public Criteria andCaseIdNotIn(List<String> values) {
addCriterion("case_id not in", values, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdBetween(String value1, String value2) {
addCriterion("functional_case_id between", value1, value2, "functionalCaseId");
public Criteria andCaseIdBetween(String value1, String value2) {
addCriterion("case_id between", value1, value2, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotBetween(String value1, String value2) {
addCriterion("functional_case_id not between", value1, value2, "functionalCaseId");
public Criteria andCaseIdNotBetween(String value1, String value2) {
addCriterion("case_id not between", value1, value2, "caseId");
return (Criteria) this;
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -17,7 +21,7 @@ public class FunctionalCaseBlob implements Serializable {
private String steps;
@Schema(description = "步骤描述step_model 为 Text 时启用")
private String stepDescription;
private String textDescription;
@Schema(description = "预期结果step_model 为 Text 时启用")
private String expectedResult;
@ -29,4 +33,80 @@ public class FunctionalCaseBlob implements Serializable {
private String description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
steps("steps", "steps", "LONGVARCHAR", false),
textDescription("text_description", "textDescription", "LONGVARCHAR", false),
expectedResult("expected_result", "expectedResult", "LONGVARCHAR", false),
prerequisite("prerequisite", "prerequisite", "LONGVARCHAR", false),
description("description", "description", "LONGVARCHAR", 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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -21,7 +25,7 @@ public class FunctionalCaseComment implements Serializable {
@Schema(description = "评论人")
private String createUser;
@Schema(description = "论时添加的状态:通过/不通过/重新提审/通过标准变更标记/强制通过标记/强制不通过标记/状态变更标记")
@Schema(description = "审/测试计划执行状态:通过/不通过/重新提审/通过标准变更标记/强制通过标记/强制不通过标记/状态变更标记")
private String status;
@Schema(description = "评论类型:用例评论/测试计划用例评论/评审用例评论", requiredMode = Schema.RequiredMode.REQUIRED)
@ -29,7 +33,7 @@ public class FunctionalCaseComment implements Serializable {
@Size(min = 1, max = 64, message = "{functional_case_comment.type.length_range}", groups = {Created.class, Updated.class})
private String type;
@Schema(description = "当前评审所属的测试计划ID或评审ID")
@Schema(description = "评审ID")
private String belongId;
@Schema(description = "创建时间")
@ -38,8 +42,97 @@ public class FunctionalCaseComment implements Serializable {
@Schema(description = "更新时间")
private Long updateTime;
@Schema(description = "描述")
@Schema(description = "回复人")
private String replyUser;
@Schema(description = "父评论id")
private String parentId;
@Schema(description = "内容", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_comment.description.not_blank}", groups = {Created.class})
@Size(min = 1, max = 65535, message = "{functional_case_comment.description.length_range}", groups = {Created.class, Updated.class})
private String description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
caseId("case_id", "caseId", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
status("status", "status", "VARCHAR", true),
type("type", "type", "VARCHAR", true),
belongId("belong_id", "belongId", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
replyUser("reply_user", "replyUser", "VARCHAR", false),
parentId("parent_id", "parentId", "VARCHAR", false),
description("description", "description", "LONGVARCHAR", 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<Column> 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();
}
}
}

View File

@ -643,6 +643,146 @@ public class FunctionalCaseCommentExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andReplyUserIsNull() {
addCriterion("reply_user is null");
return (Criteria) this;
}
public Criteria andReplyUserIsNotNull() {
addCriterion("reply_user is not null");
return (Criteria) this;
}
public Criteria andReplyUserEqualTo(String value) {
addCriterion("reply_user =", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserNotEqualTo(String value) {
addCriterion("reply_user <>", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserGreaterThan(String value) {
addCriterion("reply_user >", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserGreaterThanOrEqualTo(String value) {
addCriterion("reply_user >=", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserLessThan(String value) {
addCriterion("reply_user <", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserLessThanOrEqualTo(String value) {
addCriterion("reply_user <=", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserLike(String value) {
addCriterion("reply_user like", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserNotLike(String value) {
addCriterion("reply_user not like", value, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserIn(List<String> values) {
addCriterion("reply_user in", values, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserNotIn(List<String> values) {
addCriterion("reply_user not in", values, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserBetween(String value1, String value2) {
addCriterion("reply_user between", value1, value2, "replyUser");
return (Criteria) this;
}
public Criteria andReplyUserNotBetween(String value1, String value2) {
addCriterion("reply_user not between", value1, value2, "replyUser");
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(String value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(String value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(String value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(String value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(String value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(String value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLike(String value) {
addCriterion("parent_id like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotLike(String value) {
addCriterion("parent_id not like", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<String> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<String> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(String value1, String value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(String value1, String value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -21,8 +25,82 @@ public class FunctionalCaseCustomField implements Serializable {
@Schema(description = "字段值")
private String value;
@Schema(description = "")
@Schema(description = "富文本类型字段值")
private String textValue;
private static final long serialVersionUID = 1L;
public enum Column {
caseId("case_id", "caseId", "VARCHAR", false),
fieldId("field_id", "fieldId", "VARCHAR", false),
value("value", "value", "VARCHAR", true),
textValue("text_value", "textValue", "LONGVARCHAR", 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<Column> 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();
}
}
}

View File

@ -654,73 +654,73 @@ public class FunctionalCaseExample {
return (Criteria) this;
}
public Criteria andStepModelIsNull() {
addCriterion("step_model is null");
public Criteria andCaseModelIsNull() {
addCriterion("case_model is null");
return (Criteria) this;
}
public Criteria andStepModelIsNotNull() {
addCriterion("step_model is not null");
public Criteria andCaseModelIsNotNull() {
addCriterion("case_model is not null");
return (Criteria) this;
}
public Criteria andStepModelEqualTo(String value) {
addCriterion("step_model =", value, "stepModel");
public Criteria andCaseModelEqualTo(String value) {
addCriterion("case_model =", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelNotEqualTo(String value) {
addCriterion("step_model <>", value, "stepModel");
public Criteria andCaseModelNotEqualTo(String value) {
addCriterion("case_model <>", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThan(String value) {
addCriterion("step_model >", value, "stepModel");
public Criteria andCaseModelGreaterThan(String value) {
addCriterion("case_model >", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelGreaterThanOrEqualTo(String value) {
addCriterion("step_model >=", value, "stepModel");
public Criteria andCaseModelGreaterThanOrEqualTo(String value) {
addCriterion("case_model >=", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelLessThan(String value) {
addCriterion("step_model <", value, "stepModel");
public Criteria andCaseModelLessThan(String value) {
addCriterion("case_model <", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelLessThanOrEqualTo(String value) {
addCriterion("step_model <=", value, "stepModel");
public Criteria andCaseModelLessThanOrEqualTo(String value) {
addCriterion("case_model <=", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelLike(String value) {
addCriterion("step_model like", value, "stepModel");
public Criteria andCaseModelLike(String value) {
addCriterion("case_model like", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelNotLike(String value) {
addCriterion("step_model not like", value, "stepModel");
public Criteria andCaseModelNotLike(String value) {
addCriterion("case_model not like", value, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelIn(List<String> values) {
addCriterion("step_model in", values, "stepModel");
public Criteria andCaseModelIn(List<String> values) {
addCriterion("case_model in", values, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelNotIn(List<String> values) {
addCriterion("step_model not in", values, "stepModel");
public Criteria andCaseModelNotIn(List<String> values) {
addCriterion("case_model not in", values, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelBetween(String value1, String value2) {
addCriterion("step_model between", value1, value2, "stepModel");
public Criteria andCaseModelBetween(String value1, String value2) {
addCriterion("case_model between", value1, value2, "caseModel");
return (Criteria) this;
}
public Criteria andStepModelNotBetween(String value1, String value2) {
addCriterion("step_model not between", value1, value2, "stepModel");
public Criteria andCaseModelNotBetween(String value1, String value2) {
addCriterion("case_model not between", value1, value2, "caseModel");
return (Criteria) this;
}
@ -1244,6 +1244,76 @@ public class FunctionalCaseExample {
return (Criteria) this;
}
public Criteria andUpdateUserIsNull() {
addCriterion("update_user is null");
return (Criteria) this;
}
public Criteria andUpdateUserIsNotNull() {
addCriterion("update_user is not null");
return (Criteria) this;
}
public Criteria andUpdateUserEqualTo(String value) {
addCriterion("update_user =", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotEqualTo(String value) {
addCriterion("update_user <>", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThan(String value) {
addCriterion("update_user >", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
addCriterion("update_user >=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThan(String value) {
addCriterion("update_user <", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThanOrEqualTo(String value) {
addCriterion("update_user <=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLike(String value) {
addCriterion("update_user like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotLike(String value) {
addCriterion("update_user not like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserIn(List<String> values) {
addCriterion("update_user in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> values) {
addCriterion("update_user not in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserBetween(String value1, String value2) {
addCriterion("update_user between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotBetween(String value1, String value2) {
addCriterion("update_user not between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andDeleteUserIsNull() {
addCriterion("delete_user is null");
return (Criteria) this;

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -19,4 +23,76 @@ public class FunctionalCaseFollower implements Serializable {
private String userId;
private static final long serialVersionUID = 1L;
public enum Column {
caseId("case_id", "caseId", "VARCHAR", false),
userId("user_id", "userId", "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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -23,11 +27,14 @@ public class FunctionalCaseModule implements Serializable {
@Size(min = 1, max = 100, message = "{functional_case_module.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(description = "父节点ID")
@Schema(description = "父节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_module.parent_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case_module.parent_id.length_range}", groups = {Created.class, Updated.class})
private String parentId;
@Schema(description = "节点的层级", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case_module.level.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case_module.level.not_blank}", groups = {Created.class})
@Size(min = 1, max = 10, message = "{functional_case_module.level.length_range}", groups = {Created.class, Updated.class})
private Integer level;
@Schema(description = "创建时间")
@ -37,11 +44,91 @@ public class FunctionalCaseModule implements Serializable {
private Long updateTime;
@Schema(description = "同一节点下的顺序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case_module.pos.not_blank}", groups = {Created.class})
@NotBlank(message = "{functional_case_module.pos.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{functional_case_module.pos.length_range}", groups = {Created.class, Updated.class})
private Long pos;
@Schema(description = "创建人")
private String createUser;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
parentId("parent_id", "parentId", "VARCHAR", false),
level("level", "level", "INTEGER", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
pos("pos", "pos", "BIGINT", false),
createUser("create_user", "createUser", "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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -38,4 +42,81 @@ public class FunctionalCaseRelationshipEdge implements Serializable {
private Long createTime;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
sourceId("source_id", "sourceId", "VARCHAR", false),
targetId("target_id", "targetId", "VARCHAR", false),
graphId("graph_id", "graphId", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createTime("create_time", "createTime", "BIGINT", 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<Column> 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();
}
}
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -14,9 +18,9 @@ public class FunctionalCaseTest implements Serializable {
private String id;
@Schema(description = "功能用例ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_test.functional_case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case_test.functional_case_id.length_range}", groups = {Created.class, Updated.class})
private String functionalCaseId;
@NotBlank(message = "{functional_case_test.case_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{functional_case_test.case_id.length_range}", groups = {Created.class, Updated.class})
private String caseId;
@Schema(description = "其他类型用例ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_test.test_id.not_blank}", groups = {Created.class})
@ -35,4 +39,80 @@ public class FunctionalCaseTest implements Serializable {
private Long updateTime;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
caseId("case_id", "caseId", "VARCHAR", false),
testId("test_id", "testId", "VARCHAR", false),
testType("test_type", "testType", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", 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<Column> 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();
}
}
}

View File

@ -174,73 +174,73 @@ public class FunctionalCaseTestExample {
return (Criteria) this;
}
public Criteria andFunctionalCaseIdIsNull() {
addCriterion("functional_case_id is null");
public Criteria andCaseIdIsNull() {
addCriterion("case_id is null");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdIsNotNull() {
addCriterion("functional_case_id is not null");
public Criteria andCaseIdIsNotNull() {
addCriterion("case_id is not null");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdEqualTo(String value) {
addCriterion("functional_case_id =", value, "functionalCaseId");
public Criteria andCaseIdEqualTo(String value) {
addCriterion("case_id =", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotEqualTo(String value) {
addCriterion("functional_case_id <>", value, "functionalCaseId");
public Criteria andCaseIdNotEqualTo(String value) {
addCriterion("case_id <>", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdGreaterThan(String value) {
addCriterion("functional_case_id >", value, "functionalCaseId");
public Criteria andCaseIdGreaterThan(String value) {
addCriterion("case_id >", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("functional_case_id >=", value, "functionalCaseId");
public Criteria andCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("case_id >=", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLessThan(String value) {
addCriterion("functional_case_id <", value, "functionalCaseId");
public Criteria andCaseIdLessThan(String value) {
addCriterion("case_id <", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLessThanOrEqualTo(String value) {
addCriterion("functional_case_id <=", value, "functionalCaseId");
public Criteria andCaseIdLessThanOrEqualTo(String value) {
addCriterion("case_id <=", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdLike(String value) {
addCriterion("functional_case_id like", value, "functionalCaseId");
public Criteria andCaseIdLike(String value) {
addCriterion("case_id like", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotLike(String value) {
addCriterion("functional_case_id not like", value, "functionalCaseId");
public Criteria andCaseIdNotLike(String value) {
addCriterion("case_id not like", value, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdIn(List<String> values) {
addCriterion("functional_case_id in", values, "functionalCaseId");
public Criteria andCaseIdIn(List<String> values) {
addCriterion("case_id in", values, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotIn(List<String> values) {
addCriterion("functional_case_id not in", values, "functionalCaseId");
public Criteria andCaseIdNotIn(List<String> values) {
addCriterion("case_id not in", values, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdBetween(String value1, String value2) {
addCriterion("functional_case_id between", value1, value2, "functionalCaseId");
public Criteria andCaseIdBetween(String value1, String value2) {
addCriterion("case_id between", value1, value2, "caseId");
return (Criteria) this;
}
public Criteria andFunctionalCaseIdNotBetween(String value1, String value2) {
addCriterion("functional_case_id not between", value1, value2, "functionalCaseId");
public Criteria andCaseIdNotBetween(String value1, String value2) {
addCriterion("case_id not between", value1, value2, "caseId");
return (Criteria) this;
}

View File

@ -1,9 +1,13 @@
package io.metersphere.functional.domain;
import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
@ -29,4 +33,78 @@ public class FunctionalMinderExtraNode implements Serializable {
private String nodeData;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
parentId("parent_id", "parentId", "VARCHAR", false),
groupId("group_id", "groupId", "VARCHAR", false),
nodeData("node_data", "nodeData", "LONGVARCHAR", 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<Column> 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();
}
}
}

View File

@ -21,4 +21,8 @@ public interface CaseReviewFollowerMapper {
int updateByExampleSelective(@Param("record") CaseReviewFollower record, @Param("example") CaseReviewFollowerExample example);
int updateByExample(@Param("record") CaseReviewFollower record, @Param("example") CaseReviewFollowerExample example);
int batchInsert(@Param("list") List<CaseReviewFollower> list);
int batchInsertSelective(@Param("list") List<CaseReviewFollower> list, @Param("selective") CaseReviewFollower.Column ... selective);
}

View File

@ -142,4 +142,32 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into case_review_follower
(review_id, user_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.reviewId,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into case_review_follower (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'review_id'.toString() == column.value">
#{item.reviewId,jdbcType=VARCHAR}
</if>
<if test="'user_id'.toString() == column.value">
#{item.userId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -27,4 +27,8 @@ public interface CaseReviewFunctionalCaseMapper {
int updateByPrimaryKeySelective(CaseReviewFunctionalCase record);
int updateByPrimaryKey(CaseReviewFunctionalCase record);
int batchInsert(@Param("list") List<CaseReviewFunctionalCase> list);
int batchInsertSelective(@Param("list") List<CaseReviewFunctionalCase> list, @Param("selective") CaseReviewFunctionalCase.Column ... selective);
}

View File

@ -272,4 +272,57 @@
deleted = #{deleted,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into case_review_functional_case
(id, review_id, case_id, `status`, create_time, update_time, create_user, pos, deleted
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.reviewId,jdbcType=VARCHAR}, #{item.caseId,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT},
#{item.createUser,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into case_review_functional_case (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'review_id'.toString() == column.value">
#{item.reviewId,jdbcType=VARCHAR}
</if>
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
<if test="'deleted'.toString() == column.value">
#{item.deleted,jdbcType=BIT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -19,4 +19,8 @@ public interface CaseReviewFunctionalCaseUserMapper {
int updateByExampleSelective(@Param("record") CaseReviewFunctionalCaseUser record, @Param("example") CaseReviewFunctionalCaseUserExample example);
int updateByExample(@Param("record") CaseReviewFunctionalCaseUser record, @Param("example") CaseReviewFunctionalCaseUserExample example);
int batchInsert(@Param("list") List<CaseReviewFunctionalCaseUser> list);
int batchInsertSelective(@Param("list") List<CaseReviewFunctionalCaseUser> list, @Param("selective") CaseReviewFunctionalCaseUser.Column ... selective);
}

View File

@ -150,4 +150,36 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into case_review_functional_case_user
(case_id, review_id, user_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.caseId,jdbcType=VARCHAR}, #{item.reviewId,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into case_review_functional_case_user (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'review_id'.toString() == column.value">
#{item.reviewId,jdbcType=VARCHAR}
</if>
<if test="'user_id'.toString() == column.value">
#{item.userId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -21,4 +21,8 @@ public interface CaseReviewUserMapper {
int updateByExampleSelective(@Param("record") CaseReviewUser record, @Param("example") CaseReviewUserExample example);
int updateByExample(@Param("record") CaseReviewUser record, @Param("example") CaseReviewUserExample example);
int batchInsert(@Param("list") List<CaseReviewUser> list);
int batchInsertSelective(@Param("list") List<CaseReviewUser> list, @Param("selective") CaseReviewUser.Column ... selective);
}

View File

@ -142,4 +142,32 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into case_review_user
(review_id, user_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.reviewId,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into case_review_user (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'review_id'.toString() == column.value">
#{item.reviewId,jdbcType=VARCHAR}
</if>
<if test="'user_id'.toString() == column.value">
#{item.userId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -10,7 +10,7 @@ public interface FunctionalCaseAttachmentMapper {
int deleteByExample(FunctionalCaseAttachmentExample example);
int deleteByPrimaryKey(@Param("functionalCaseId") String functionalCaseId, @Param("fileId") String fileId);
int deleteByPrimaryKey(@Param("caseId") String caseId, @Param("fileId") String fileId);
int insert(FunctionalCaseAttachment record);
@ -21,4 +21,8 @@ public interface FunctionalCaseAttachmentMapper {
int updateByExampleSelective(@Param("record") FunctionalCaseAttachment record, @Param("example") FunctionalCaseAttachmentExample example);
int updateByExample(@Param("record") FunctionalCaseAttachment record, @Param("example") FunctionalCaseAttachmentExample example);
int batchInsert(@Param("list") List<FunctionalCaseAttachment> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseAttachment> list, @Param("selective") FunctionalCaseAttachment.Column ... selective);
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.functional.mapper.FunctionalCaseAttachmentMapper">
<resultMap id="BaseResultMap" type="io.metersphere.functional.domain.FunctionalCaseAttachment">
<id column="functional_case_id" jdbcType="VARCHAR" property="functionalCaseId" />
<id column="case_id" jdbcType="VARCHAR" property="caseId" />
<id column="file_id" jdbcType="VARCHAR" property="fileId" />
</resultMap>
<sql id="Example_Where_Clause">
@ -64,7 +64,7 @@
</where>
</sql>
<sql id="Base_Column_List">
functional_case_id, file_id
case_id, file_id
</sql>
<select id="selectByExample" parameterType="io.metersphere.functional.domain.FunctionalCaseAttachmentExample" resultMap="BaseResultMap">
select
@ -82,7 +82,7 @@
</select>
<delete id="deleteByPrimaryKey" parameterType="map">
delete from functional_case_attachment
where functional_case_id = #{functionalCaseId,jdbcType=VARCHAR}
where case_id = #{caseId,jdbcType=VARCHAR}
and file_id = #{fileId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.functional.domain.FunctionalCaseAttachmentExample">
@ -92,22 +92,22 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.functional.domain.FunctionalCaseAttachment">
insert into functional_case_attachment (functional_case_id, file_id)
values (#{functionalCaseId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR})
insert into functional_case_attachment (case_id, file_id)
values (#{caseId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.functional.domain.FunctionalCaseAttachment">
insert into functional_case_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="functionalCaseId != null">
functional_case_id,
<if test="caseId != null">
case_id,
</if>
<if test="fileId != null">
file_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="functionalCaseId != null">
#{functionalCaseId,jdbcType=VARCHAR},
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="fileId != null">
#{fileId,jdbcType=VARCHAR},
@ -123,8 +123,8 @@
<update id="updateByExampleSelective" parameterType="map">
update functional_case_attachment
<set>
<if test="record.functionalCaseId != null">
functional_case_id = #{record.functionalCaseId,jdbcType=VARCHAR},
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.fileId != null">
file_id = #{record.fileId,jdbcType=VARCHAR},
@ -136,10 +136,38 @@
</update>
<update id="updateByExample" parameterType="map">
update functional_case_attachment
set functional_case_id = #{record.functionalCaseId,jdbcType=VARCHAR},
set case_id = #{record.caseId,jdbcType=VARCHAR},
file_id = #{record.fileId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_attachment
(case_id, file_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.caseId,jdbcType=VARCHAR}, #{item.fileId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_attachment (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'file_id'.toString() == column.value">
#{item.fileId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -31,4 +31,8 @@ public interface FunctionalCaseBlobMapper {
int updateByPrimaryKeySelective(FunctionalCaseBlob record);
int updateByPrimaryKeyWithBLOBs(FunctionalCaseBlob record);
int batchInsert(@Param("list") List<FunctionalCaseBlob> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseBlob> list, @Param("selective") FunctionalCaseBlob.Column ... selective);
}

View File

@ -6,7 +6,7 @@
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.functional.domain.FunctionalCaseBlob">
<result column="steps" jdbcType="LONGVARCHAR" property="steps" />
<result column="step_description" jdbcType="LONGVARCHAR" property="stepDescription" />
<result column="text_description" jdbcType="LONGVARCHAR" property="textDescription" />
<result column="expected_result" jdbcType="LONGVARCHAR" property="expectedResult" />
<result column="prerequisite" jdbcType="LONGVARCHAR" property="prerequisite" />
<result column="description" jdbcType="LONGVARCHAR" property="description" />
@ -73,7 +73,7 @@
id
</sql>
<sql id="Blob_Column_List">
steps, step_description, expected_result, prerequisite, description
steps, text_description, expected_result, prerequisite, description
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.functional.domain.FunctionalCaseBlobExample" resultMap="ResultMapWithBLOBs">
select
@ -124,10 +124,10 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.functional.domain.FunctionalCaseBlob">
insert into functional_case_blob (id, steps, step_description,
insert into functional_case_blob (id, steps, text_description,
expected_result, prerequisite, description
)
values (#{id,jdbcType=VARCHAR}, #{steps,jdbcType=LONGVARCHAR}, #{stepDescription,jdbcType=LONGVARCHAR},
values (#{id,jdbcType=VARCHAR}, #{steps,jdbcType=LONGVARCHAR}, #{textDescription,jdbcType=LONGVARCHAR},
#{expectedResult,jdbcType=LONGVARCHAR}, #{prerequisite,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}
)
</insert>
@ -140,8 +140,8 @@
<if test="steps != null">
steps,
</if>
<if test="stepDescription != null">
step_description,
<if test="textDescription != null">
text_description,
</if>
<if test="expectedResult != null">
expected_result,
@ -160,8 +160,8 @@
<if test="steps != null">
#{steps,jdbcType=LONGVARCHAR},
</if>
<if test="stepDescription != null">
#{stepDescription,jdbcType=LONGVARCHAR},
<if test="textDescription != null">
#{textDescription,jdbcType=LONGVARCHAR},
</if>
<if test="expectedResult != null">
#{expectedResult,jdbcType=LONGVARCHAR},
@ -189,8 +189,8 @@
<if test="record.steps != null">
steps = #{record.steps,jdbcType=LONGVARCHAR},
</if>
<if test="record.stepDescription != null">
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
<if test="record.textDescription != null">
text_description = #{record.textDescription,jdbcType=LONGVARCHAR},
</if>
<if test="record.expectedResult != null">
expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR},
@ -210,7 +210,7 @@
update functional_case_blob
set id = #{record.id,jdbcType=VARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR},
step_description = #{record.stepDescription,jdbcType=LONGVARCHAR},
text_description = #{record.textDescription,jdbcType=LONGVARCHAR},
expected_result = #{record.expectedResult,jdbcType=LONGVARCHAR},
prerequisite = #{record.prerequisite,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}
@ -231,8 +231,8 @@
<if test="steps != null">
steps = #{steps,jdbcType=LONGVARCHAR},
</if>
<if test="stepDescription != null">
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
<if test="textDescription != null">
text_description = #{textDescription,jdbcType=LONGVARCHAR},
</if>
<if test="expectedResult != null">
expected_result = #{expectedResult,jdbcType=LONGVARCHAR},
@ -249,10 +249,52 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.functional.domain.FunctionalCaseBlob">
update functional_case_blob
set steps = #{steps,jdbcType=LONGVARCHAR},
step_description = #{stepDescription,jdbcType=LONGVARCHAR},
text_description = #{textDescription,jdbcType=LONGVARCHAR},
expected_result = #{expectedResult,jdbcType=LONGVARCHAR},
prerequisite = #{prerequisite,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_blob
(id, steps, text_description, expected_result, prerequisite, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.steps,jdbcType=LONGVARCHAR}, #{item.textDescription,jdbcType=LONGVARCHAR},
#{item.expectedResult,jdbcType=LONGVARCHAR}, #{item.prerequisite,jdbcType=LONGVARCHAR},
#{item.description,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'steps'.toString() == column.value">
#{item.steps,jdbcType=LONGVARCHAR}
</if>
<if test="'text_description'.toString() == column.value">
#{item.textDescription,jdbcType=LONGVARCHAR}
</if>
<if test="'expected_result'.toString() == column.value">
#{item.expectedResult,jdbcType=LONGVARCHAR}
</if>
<if test="'prerequisite'.toString() == column.value">
#{item.prerequisite,jdbcType=LONGVARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -33,4 +33,8 @@ public interface FunctionalCaseCommentMapper {
int updateByPrimaryKeyWithBLOBs(FunctionalCaseComment record);
int updateByPrimaryKey(FunctionalCaseComment record);
int batchInsert(@Param("list") List<FunctionalCaseComment> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseComment> list, @Param("selective") FunctionalCaseComment.Column ... selective);
}

View File

@ -10,6 +10,8 @@
<result column="belong_id" jdbcType="VARCHAR" property="belongId" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="reply_user" jdbcType="VARCHAR" property="replyUser" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.functional.domain.FunctionalCaseComment">
<result column="description" jdbcType="LONGVARCHAR" property="description" />
@ -73,7 +75,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, case_id, create_user, `status`, `type`, belong_id, create_time, update_time
id, case_id, create_user, `status`, `type`, belong_id, create_time, update_time,
reply_user, parent_id
</sql>
<sql id="Blob_Column_List">
description
@ -129,12 +132,12 @@
<insert id="insert" parameterType="io.metersphere.functional.domain.FunctionalCaseComment">
insert into functional_case_comment (id, case_id, create_user,
`status`, `type`, belong_id,
create_time, update_time, description
)
create_time, update_time, reply_user,
parent_id, description)
values (#{id,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{belongId,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR}
)
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{replyUser,jdbcType=VARCHAR},
#{parentId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.functional.domain.FunctionalCaseComment">
insert into functional_case_comment
@ -163,6 +166,12 @@
<if test="updateTime != null">
update_time,
</if>
<if test="replyUser != null">
reply_user,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="description != null">
description,
</if>
@ -192,6 +201,12 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="replyUser != null">
#{replyUser,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=LONGVARCHAR},
</if>
@ -230,6 +245,12 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.replyUser != null">
reply_user = #{record.replyUser,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR},
</if>
@ -248,6 +269,8 @@
belong_id = #{record.belongId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
reply_user = #{record.replyUser,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -262,7 +285,9 @@
`type` = #{record.type,jdbcType=VARCHAR},
belong_id = #{record.belongId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
update_time = #{record.updateTime,jdbcType=BIGINT},
reply_user = #{record.replyUser,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -291,6 +316,12 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="replyUser != null">
reply_user = #{replyUser,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=LONGVARCHAR},
</if>
@ -306,6 +337,8 @@
belong_id = #{belongId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
reply_user = #{replyUser,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR},
description = #{description,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
@ -317,7 +350,68 @@
`type` = #{type,jdbcType=VARCHAR},
belong_id = #{belongId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=BIGINT},
reply_user = #{replyUser,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_comment
(id, case_id, create_user, `status`, `type`, belong_id, create_time, update_time,
reply_user, parent_id, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.caseId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.belongId,jdbcType=VARCHAR},
#{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.replyUser,jdbcType=VARCHAR},
#{item.parentId,jdbcType=VARCHAR}, #{item.description,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_comment (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'belong_id'.toString() == column.value">
#{item.belongId,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'reply_user'.toString() == column.value">
#{item.replyUser,jdbcType=VARCHAR}
</if>
<if test="'parent_id'.toString() == column.value">
#{item.parentId,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -33,4 +33,8 @@ public interface FunctionalCaseCustomFieldMapper {
int updateByPrimaryKeyWithBLOBs(FunctionalCaseCustomField record);
int updateByPrimaryKey(FunctionalCaseCustomField record);
int batchInsert(@Param("list") List<FunctionalCaseCustomField> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseCustomField> list, @Param("selective") FunctionalCaseCustomField.Column ... selective);
}

View File

@ -231,4 +231,39 @@
where case_id = #{caseId,jdbcType=VARCHAR}
and field_id = #{fieldId,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_custom_field
(case_id, field_id, `value`, text_value)
values
<foreach collection="list" item="item" separator=",">
(#{item.caseId,jdbcType=VARCHAR}, #{item.fieldId,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR},
#{item.textValue,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_custom_field (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'field_id'.toString() == column.value">
#{item.fieldId,jdbcType=VARCHAR}
</if>
<if test="'value'.toString() == column.value">
#{item.value,jdbcType=VARCHAR}
</if>
<if test="'text_value'.toString() == column.value">
#{item.textValue,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -21,4 +21,8 @@ public interface FunctionalCaseFollowerMapper {
int updateByExampleSelective(@Param("record") FunctionalCaseFollower record, @Param("example") FunctionalCaseFollowerExample example);
int updateByExample(@Param("record") FunctionalCaseFollower record, @Param("example") FunctionalCaseFollowerExample example);
int batchInsert(@Param("list") List<FunctionalCaseFollower> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseFollower> list, @Param("selective") FunctionalCaseFollower.Column ... selective);
}

View File

@ -142,4 +142,32 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_follower
(case_id, user_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.caseId,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_follower (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'user_id'.toString() == column.value">
#{item.userId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -27,4 +27,8 @@ public interface FunctionalCaseMapper {
int updateByPrimaryKeySelective(FunctionalCase record);
int updateByPrimaryKey(FunctionalCase record);
int batchInsert(@Param("list") List<FunctionalCase> list);
int batchInsertSelective(@Param("list") List<FunctionalCase> list, @Param("selective") FunctionalCase.Column ... selective);
}

View File

@ -10,7 +10,7 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="review_status" jdbcType="VARCHAR" property="reviewStatus" />
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="step_model" jdbcType="VARCHAR" property="stepModel" />
<result column="case_model" jdbcType="VARCHAR" property="caseModel" />
<result column="pos" jdbcType="BIGINT" property="pos" />
<result column="version_id" jdbcType="VARCHAR" property="versionId" />
<result column="ref_id" jdbcType="VARCHAR" property="refId" />
@ -19,6 +19,7 @@
<result column="public_case" jdbcType="BIT" property="publicCase" />
<result column="latest" jdbcType="BIT" property="latest" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="delete_user" jdbcType="VARCHAR" property="deleteUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
@ -83,9 +84,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, num, custom_num, module_id, project_id, `name`, review_status, tags, step_model,
id, num, custom_num, module_id, project_id, `name`, review_status, tags, case_model,
pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user,
delete_user, create_time, update_time, delete_time
update_user, delete_user, create_time, update_time, delete_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.functional.domain.FunctionalCaseExample" resultMap="BaseResultMap">
select
@ -120,20 +121,20 @@
<insert id="insert" parameterType="io.metersphere.functional.domain.FunctionalCase">
insert into functional_case (id, num, custom_num,
module_id, project_id, `name`,
review_status, tags, step_model,
review_status, tags, case_model,
pos, version_id, ref_id,
last_execute_result, deleted, public_case,
latest, create_user, delete_user,
create_time, update_time, delete_time
)
latest, create_user, update_user,
delete_user, create_time, update_time,
delete_time)
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{customNum,jdbcType=VARCHAR},
#{moduleId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR}, #{stepModel,jdbcType=VARCHAR},
#{reviewStatus,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR}, #{caseModel,jdbcType=VARCHAR},
#{pos,jdbcType=BIGINT}, #{versionId,jdbcType=VARCHAR}, #{refId,jdbcType=VARCHAR},
#{lastExecuteResult,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT}, #{publicCase,jdbcType=BIT},
#{latest,jdbcType=BIT}, #{createUser,jdbcType=VARCHAR}, #{deleteUser,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{deleteTime,jdbcType=BIGINT}
)
#{latest,jdbcType=BIT}, #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
#{deleteUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{deleteTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.functional.domain.FunctionalCase">
insert into functional_case
@ -162,8 +163,8 @@
<if test="tags != null">
tags,
</if>
<if test="stepModel != null">
step_model,
<if test="caseModel != null">
case_model,
</if>
<if test="pos != null">
pos,
@ -189,6 +190,9 @@
<if test="createUser != null">
create_user,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="deleteUser != null">
delete_user,
</if>
@ -227,8 +231,8 @@
<if test="tags != null">
#{tags,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
#{stepModel,jdbcType=VARCHAR},
<if test="caseModel != null">
#{caseModel,jdbcType=VARCHAR},
</if>
<if test="pos != null">
#{pos,jdbcType=BIGINT},
@ -254,6 +258,9 @@
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="deleteUser != null">
#{deleteUser,jdbcType=VARCHAR},
</if>
@ -301,8 +308,8 @@
<if test="record.tags != null">
tags = #{record.tags,jdbcType=VARCHAR},
</if>
<if test="record.stepModel != null">
step_model = #{record.stepModel,jdbcType=VARCHAR},
<if test="record.caseModel != null">
case_model = #{record.caseModel,jdbcType=VARCHAR},
</if>
<if test="record.pos != null">
pos = #{record.pos,jdbcType=BIGINT},
@ -328,6 +335,9 @@
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.deleteUser != null">
delete_user = #{record.deleteUser,jdbcType=VARCHAR},
</if>
@ -355,7 +365,7 @@
`name` = #{record.name,jdbcType=VARCHAR},
review_status = #{record.reviewStatus,jdbcType=VARCHAR},
tags = #{record.tags,jdbcType=VARCHAR},
step_model = #{record.stepModel,jdbcType=VARCHAR},
case_model = #{record.caseModel,jdbcType=VARCHAR},
pos = #{record.pos,jdbcType=BIGINT},
version_id = #{record.versionId,jdbcType=VARCHAR},
ref_id = #{record.refId,jdbcType=VARCHAR},
@ -364,6 +374,7 @@
public_case = #{record.publicCase,jdbcType=BIT},
latest = #{record.latest,jdbcType=BIT},
create_user = #{record.createUser,jdbcType=VARCHAR},
update_user = #{record.updateUser,jdbcType=VARCHAR},
delete_user = #{record.deleteUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
@ -396,8 +407,8 @@
<if test="tags != null">
tags = #{tags,jdbcType=VARCHAR},
</if>
<if test="stepModel != null">
step_model = #{stepModel,jdbcType=VARCHAR},
<if test="caseModel != null">
case_model = #{caseModel,jdbcType=VARCHAR},
</if>
<if test="pos != null">
pos = #{pos,jdbcType=BIGINT},
@ -423,6 +434,9 @@
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="deleteUser != null">
delete_user = #{deleteUser,jdbcType=VARCHAR},
</if>
@ -447,7 +461,7 @@
`name` = #{name,jdbcType=VARCHAR},
review_status = #{reviewStatus,jdbcType=VARCHAR},
tags = #{tags,jdbcType=VARCHAR},
step_model = #{stepModel,jdbcType=VARCHAR},
case_model = #{caseModel,jdbcType=VARCHAR},
pos = #{pos,jdbcType=BIGINT},
version_id = #{versionId,jdbcType=VARCHAR},
ref_id = #{refId,jdbcType=VARCHAR},
@ -456,10 +470,108 @@
public_case = #{publicCase,jdbcType=BIT},
latest = #{latest,jdbcType=BIT},
create_user = #{createUser,jdbcType=VARCHAR},
update_user = #{updateUser,jdbcType=VARCHAR},
delete_user = #{deleteUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
delete_time = #{deleteTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case
(id, num, custom_num, module_id, project_id, `name`, review_status, tags, case_model,
pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user,
update_user, delete_user, create_time, update_time, delete_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.customNum,jdbcType=VARCHAR},
#{item.moduleId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
#{item.reviewStatus,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, #{item.caseModel,jdbcType=VARCHAR},
#{item.pos,jdbcType=BIGINT}, #{item.versionId,jdbcType=VARCHAR}, #{item.refId,jdbcType=VARCHAR},
#{item.lastExecuteResult,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT}, #{item.publicCase,jdbcType=BIT},
#{item.latest,jdbcType=BIT}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR},
#{item.deleteUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT},
#{item.deleteTime,jdbcType=BIGINT})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'num'.toString() == column.value">
#{item.num,jdbcType=INTEGER}
</if>
<if test="'custom_num'.toString() == column.value">
#{item.customNum,jdbcType=VARCHAR}
</if>
<if test="'module_id'.toString() == column.value">
#{item.moduleId,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'review_status'.toString() == column.value">
#{item.reviewStatus,jdbcType=VARCHAR}
</if>
<if test="'tags'.toString() == column.value">
#{item.tags,jdbcType=VARCHAR}
</if>
<if test="'case_model'.toString() == column.value">
#{item.caseModel,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
<if test="'version_id'.toString() == column.value">
#{item.versionId,jdbcType=VARCHAR}
</if>
<if test="'ref_id'.toString() == column.value">
#{item.refId,jdbcType=VARCHAR}
</if>
<if test="'last_execute_result'.toString() == column.value">
#{item.lastExecuteResult,jdbcType=VARCHAR}
</if>
<if test="'deleted'.toString() == column.value">
#{item.deleted,jdbcType=BIT}
</if>
<if test="'public_case'.toString() == column.value">
#{item.publicCase,jdbcType=BIT}
</if>
<if test="'latest'.toString() == column.value">
#{item.latest,jdbcType=BIT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'delete_user'.toString() == column.value">
#{item.deleteUser,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'delete_time'.toString() == column.value">
#{item.deleteTime,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -27,4 +27,8 @@ public interface FunctionalCaseModuleMapper {
int updateByPrimaryKeySelective(FunctionalCaseModule record);
int updateByPrimaryKey(FunctionalCaseModule record);
int batchInsert(@Param("list") List<FunctionalCaseModule> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseModule> list, @Param("selective") FunctionalCaseModule.Column ... selective);
}

View File

@ -272,4 +272,57 @@
create_user = #{createUser,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_module
(id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
#{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT},
#{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_module (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'parent_id'.toString() == column.value">
#{item.parentId,jdbcType=VARCHAR}
</if>
<if test="'level'.toString() == column.value">
#{item.level,jdbcType=INTEGER}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -27,4 +27,8 @@ public interface FunctionalCaseRelationshipEdgeMapper {
int updateByPrimaryKeySelective(FunctionalCaseRelationshipEdge record);
int updateByPrimaryKey(FunctionalCaseRelationshipEdge record);
int batchInsert(@Param("list") List<FunctionalCaseRelationshipEdge> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseRelationshipEdge> list, @Param("selective") FunctionalCaseRelationshipEdge.Column ... selective);
}

View File

@ -240,4 +240,49 @@
create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_relationship_edge
(id, source_id, target_id, graph_id, create_user, update_time, create_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.sourceId,jdbcType=VARCHAR}, #{item.targetId,jdbcType=VARCHAR},
#{item.graphId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=BIGINT},
#{item.createTime,jdbcType=BIGINT})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_relationship_edge (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'source_id'.toString() == column.value">
#{item.sourceId,jdbcType=VARCHAR}
</if>
<if test="'target_id'.toString() == column.value">
#{item.targetId,jdbcType=VARCHAR}
</if>
<if test="'graph_id'.toString() == column.value">
#{item.graphId,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -27,4 +27,8 @@ public interface FunctionalCaseTestMapper {
int updateByPrimaryKeySelective(FunctionalCaseTest record);
int updateByPrimaryKey(FunctionalCaseTest record);
int batchInsert(@Param("list") List<FunctionalCaseTest> list);
int batchInsertSelective(@Param("list") List<FunctionalCaseTest> list, @Param("selective") FunctionalCaseTest.Column ... selective);
}

View File

@ -3,7 +3,7 @@
<mapper namespace="io.metersphere.functional.mapper.FunctionalCaseTestMapper">
<resultMap id="BaseResultMap" type="io.metersphere.functional.domain.FunctionalCaseTest">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="functional_case_id" jdbcType="VARCHAR" property="functionalCaseId" />
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="test_id" jdbcType="VARCHAR" property="testId" />
<result column="test_type" jdbcType="VARCHAR" property="testType" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
@ -68,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, functional_case_id, test_id, test_type, create_time, update_time
id, case_id, test_id, test_type, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.functional.domain.FunctionalCaseTestExample" resultMap="BaseResultMap">
select
@ -101,10 +101,10 @@
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.functional.domain.FunctionalCaseTest">
insert into functional_case_test (id, functional_case_id, test_id,
insert into functional_case_test (id, case_id, test_id,
test_type, create_time, update_time
)
values (#{id,jdbcType=VARCHAR}, #{functionalCaseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR},
#{testType,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
)
</insert>
@ -114,8 +114,8 @@
<if test="id != null">
id,
</if>
<if test="functionalCaseId != null">
functional_case_id,
<if test="caseId != null">
case_id,
</if>
<if test="testId != null">
test_id,
@ -134,8 +134,8 @@
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="functionalCaseId != null">
#{functionalCaseId,jdbcType=VARCHAR},
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
#{testId,jdbcType=VARCHAR},
@ -163,8 +163,8 @@
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.functionalCaseId != null">
functional_case_id = #{record.functionalCaseId,jdbcType=VARCHAR},
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.testId != null">
test_id = #{record.testId,jdbcType=VARCHAR},
@ -186,7 +186,7 @@
<update id="updateByExample" parameterType="map">
update functional_case_test
set id = #{record.id,jdbcType=VARCHAR},
functional_case_id = #{record.functionalCaseId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
test_id = #{record.testId,jdbcType=VARCHAR},
test_type = #{record.testType,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
@ -198,8 +198,8 @@
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.functional.domain.FunctionalCaseTest">
update functional_case_test
<set>
<if test="functionalCaseId != null">
functional_case_id = #{functionalCaseId,jdbcType=VARCHAR},
<if test="caseId != null">
case_id = #{caseId,jdbcType=VARCHAR},
</if>
<if test="testId != null">
test_id = #{testId,jdbcType=VARCHAR},
@ -218,11 +218,53 @@
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.functional.domain.FunctionalCaseTest">
update functional_case_test
set functional_case_id = #{functionalCaseId,jdbcType=VARCHAR},
set case_id = #{caseId,jdbcType=VARCHAR},
test_id = #{testId,jdbcType=VARCHAR},
test_type = #{testType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_test
(id, case_id, test_id, test_type, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.caseId,jdbcType=VARCHAR}, #{item.testId,jdbcType=VARCHAR},
#{item.testType,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_test (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'case_id'.toString() == column.value">
#{item.caseId,jdbcType=VARCHAR}
</if>
<if test="'test_id'.toString() == column.value">
#{item.testId,jdbcType=VARCHAR}
</if>
<if test="'test_type'.toString() == column.value">
#{item.testType,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -33,4 +33,8 @@ public interface FunctionalMinderExtraNodeMapper {
int updateByPrimaryKeyWithBLOBs(FunctionalMinderExtraNode record);
int updateByPrimaryKey(FunctionalMinderExtraNode record);
int batchInsert(@Param("list") List<FunctionalMinderExtraNode> list);
int batchInsertSelective(@Param("list") List<FunctionalMinderExtraNode> list, @Param("selective") FunctionalMinderExtraNode.Column ... selective);
}

View File

@ -231,4 +231,39 @@
group_id = #{groupId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_minder_extra_node
(id, parent_id, group_id, node_data)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.parentId,jdbcType=VARCHAR}, #{item.groupId,jdbcType=VARCHAR},
#{item.nodeData,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_minder_extra_node (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'parent_id'.toString() == column.value">
#{item.parentId,jdbcType=VARCHAR}
</if>
<if test="'group_id'.toString() == column.value">
#{item.groupId,jdbcType=VARCHAR}
</if>
<if test="'node_data'.toString() == column.value">
#{item.nodeData,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -1,10 +1,182 @@
-- set innodb lock wait timeout
SET SESSION innodb_lock_wait_timeout = 7200;
CREATE TABLE IF NOT EXISTS functional_case(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`num` INT NOT NULL COMMENT '业务ID' ,
`custom_num` VARCHAR(64) NOT NULL COMMENT '自定义业务ID' ,
`module_id` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '模块ID' ,
`project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' ,
`name` VARCHAR(255) NOT NULL COMMENT '名称' ,
`review_status` VARCHAR(64) NOT NULL DEFAULT 'PREPARE' COMMENT '评审状态:未开始/进行中/已完成/已结束' ,
`tags` VARCHAR(1000) COMMENT '标签JSON)' ,
`case_model` VARCHAR(50) NOT NULL DEFAULT 'STEP' COMMENT '编辑模式:步骤模式/文本模式' ,
`pos` BIGINT NOT NULL DEFAULT 0 COMMENT '自定义排序间隔5000' ,
`version_id` VARCHAR(50) NOT NULL COMMENT '版本ID' ,
`ref_id` VARCHAR(50) NOT NULL COMMENT '指向初始版本ID' ,
`last_execute_result` VARCHAR(64) NOT NULL DEFAULT 'PREPARE' COMMENT '最近的执行结果:未执行/通过/失败/阻塞/跳过' ,
`deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否在回收站0-否1-是' ,
`public_case` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否是公共用例0-否1-是' ,
`latest` BIT(1) NOT NULL DEFAULT 0 COMMENT '是否为最新版本0-否1-是' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`update_user` VARCHAR(50) COMMENT '更新人' ,
`delete_user` VARCHAR(50) COMMENT '删除人' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`delete_time` BIGINT COMMENT '删除时间' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例';
CREATE INDEX idx_module_id ON functional_case(module_id);
CREATE INDEX idx_project_id_pos ON functional_case(project_id,pos);
CREATE INDEX idx_public_case_pos ON functional_case(public_case,pos);
CREATE INDEX idx_ref_id ON functional_case(ref_id);
CREATE INDEX idx_version_id ON functional_case(version_id);
CREATE TABLE IF NOT EXISTS functional_case_blob(
`id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`steps` LONGTEXT COMMENT '用例步骤JSON)step_model 为 Step 时启用' ,
`text_description` LONGTEXT COMMENT '步骤描述step_model 为 Text 时启用' ,
`expected_result` LONGTEXT COMMENT '预期结果step_model 为 Text 时启用' ,
`prerequisite` LONGTEXT COMMENT '前置条件' ,
`description` LONGTEXT COMMENT '备注' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例';
CREATE TABLE IF NOT EXISTS functional_case_comment(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '评论人' ,
`status` VARCHAR(64) COMMENT '评审/测试计划执行状态:通过/不通过/重新提审/通过标准变更标记/强制通过标记/强制不通过标记/状态变更标记' ,
`type` VARCHAR(64) NOT NULL DEFAULT 'CASE' COMMENT '评论类型:用例评论/测试计划用例评论/评审用例评论' ,
`belong_id` VARCHAR(50) COMMENT '评审ID' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`description` TEXT NOT NULL COMMENT '内容' ,
`reply_user` VARCHAR(50) COMMENT '回复人' ,
`parent_id` VARCHAR(50) DEFAULT '' COMMENT '父评论id' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例评论';
CREATE INDEX idx_create_time ON functional_case_comment(create_time);
CREATE INDEX idx_case_id ON functional_case_comment(case_id);
CREATE INDEX idx_status ON functional_case_comment(status);
CREATE INDEX idx_type ON functional_case_comment(type);
CREATE INDEX idx_belong_id ON functional_case_comment(belong_id);
CREATE TABLE IF NOT EXISTS functional_case_module(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' ,
`name` VARCHAR(100) NOT NULL COMMENT '名称' ,
`parent_id` VARCHAR(50) NOT NULL COMMENT '父节点ID' ,
`level` INT NOT NULL DEFAULT 1 COMMENT '节点的层级' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`pos` BIGINT(10) NOT NULL DEFAULT 0 COMMENT '同一节点下的顺序' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例模块';
CREATE INDEX idx_project_id ON functional_case_module(project_id);
CREATE INDEX idx_name ON functional_case_module(name);
CREATE TABLE IF NOT EXISTS functional_case_attachment(
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`file_id` VARCHAR(50) NOT NULL COMMENT '文件的ID' ,
PRIMARY KEY (case_id,file_id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例和附件的中间表';
CREATE TABLE IF NOT EXISTS functional_case_follower(
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '关注人ID' ,
PRIMARY KEY (case_id,user_id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例和关注人的中间表';
CREATE TABLE IF NOT EXISTS functional_case_relationship_edge(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`source_id` VARCHAR(50) NOT NULL COMMENT '源节点的ID' ,
`target_id` VARCHAR(50) NOT NULL COMMENT '目标节点的ID' ,
`graph_id` VARCHAR(50) NOT NULL COMMENT '所属关系图的ID' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例的前后置关系';
CREATE INDEX source_id_index ON functional_case_relationship_edge(source_id);
CREATE INDEX target_id_index ON functional_case_relationship_edge(target_id);
CREATE TABLE IF NOT EXISTS functional_case_test(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例ID' ,
`test_id` VARCHAR(50) NOT NULL COMMENT '其他类型用例ID' ,
`test_type` VARCHAR(64) NOT NULL COMMENT '用例类型:接口用例/场景用例/性能用例/UI用例' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例和其他用例的中间表';
CREATE UNIQUE INDEX uk_functional_case_id_test_id ON functional_case_test(case_id,test_id);
CREATE INDEX idx_test_id ON functional_case_test(test_id);
CREATE TABLE IF NOT EXISTS functional_minder_extra_node(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`parent_id` VARCHAR(50) NOT NULL COMMENT '父节点的ID即模块ID' ,
`group_id` VARCHAR(50) NOT NULL COMMENT '项目ID可扩展为其他资源ID' ,
`node_data` LONGTEXT NOT NULL COMMENT '存储脑图节点额外信息' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例脑图临时节点';
CREATE INDEX idx_parent_id ON functional_minder_extra_node(parent_id);
CREATE TABLE IF NOT EXISTS functional_case_custom_field(
`case_id` VARCHAR(50) NOT NULL COMMENT '资源ID' ,
`field_id` VARCHAR(50) NOT NULL COMMENT '字段ID' ,
`value` VARCHAR(1000) COMMENT '字段值' ,
`text_value` LONGTEXT COMMENT '富文本类型字段值' ,
PRIMARY KEY (case_id,field_id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '自定义字段功能用例关系';
CREATE TABLE IF NOT EXISTS case_review(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`name` VARCHAR(200) NOT NULL COMMENT '名称' ,
`status` VARCHAR(64) NOT NULL DEFAULT 'Prepare' COMMENT '评审状态:未开始/进行中/已完成/已结束/已归档' ,
`status` VARCHAR(64) NOT NULL DEFAULT 'PREPARE' COMMENT '评审状态:未开始/进行中/已完成/已结束/已归档' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`end_time` BIGINT NOT NULL COMMENT '评审结束时间' ,
@ -12,12 +184,72 @@ CREATE TABLE IF NOT EXISTS case_review(
`project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' ,
`tags` VARCHAR(1000) COMMENT '标签' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`review_pass_rule` VARCHAR(64) NOT NULL DEFAULT 'Single' COMMENT '评审规则:单人通过/全部通过' ,
`review_pass_rule` VARCHAR(64) NOT NULL DEFAULT 'SINGLE' COMMENT '评审规则:单人通过/全部通过' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '用例评审';
CREATE INDEX idx_create_user ON case_review(create_user);
CREATE INDEX idx_project_id ON case_review(project_id);
CREATE INDEX idx_name ON case_review(name);
CREATE INDEX idx_status ON case_review(status);
CREATE INDEX idx_review_pass_rule ON case_review(review_pass_rule);
CREATE INDEX idx_create_time ON case_review(create_time);
CREATE INDEX idx_end_time ON case_review(end_time);
CREATE INDEX idx_update_time ON case_review(update_time);
CREATE TABLE IF NOT EXISTS case_review_user(
`review_id` VARCHAR(50) NOT NULL COMMENT '评审ID' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '评审人ID' ,
PRIMARY KEY (review_id,user_id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '评审和评审人中间表';
CREATE TABLE IF NOT EXISTS case_review_functional_case(
`id` VARCHAR(50) NOT NULL COMMENT 'ID' ,
`review_id` VARCHAR(50) NOT NULL COMMENT '评审ID' ,
`case_id` VARCHAR(50) NOT NULL COMMENT '用例ID' ,
`status` VARCHAR(64) NOT NULL DEFAULT 'UNDERWAY' COMMENT '评审状态:进行中/通过/不通过/重新提审' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`pos` BIGINT NOT NULL DEFAULT 0 COMMENT '自定义排序间隔5000' ,
`deleted` BIT(1) NOT NULL DEFAULT 0 COMMENT '关联的用例是否放入回收站' ,
PRIMARY KEY (id)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '用例评审和功能用例的中间表';
CREATE INDEX idx_case_id ON case_review_functional_case(case_id);
CREATE INDEX idx_review_id ON case_review_functional_case(review_id);
CREATE TABLE IF NOT EXISTS case_review_functional_case_user(
`case_id` VARCHAR(50) NOT NULL COMMENT '功能用例和评审中间表的ID' ,
`review_id` VARCHAR(50) NOT NULL COMMENT '评审ID' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '评审人ID'
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT = '功能用例评审和评审人的中间表';
CREATE UNIQUE INDEX test_case_review_test_case_users_pk ON case_review_functional_case_user(review_id,case_id,user_id);
CREATE TABLE IF NOT EXISTS case_review_follower(
`review_id` VARCHAR(50) NOT NULL COMMENT '评审ID' ,
`user_id` VARCHAR(50) NOT NULL COMMENT '关注人' ,
PRIMARY KEY (review_id,user_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;

View File

@ -1,12 +1,12 @@
package io.metersphere.functional.controller;
import io.metersphere.functional.domain.CaseReview;
import io.metersphere.functional.dto.CaseReviewDto;
import io.metersphere.validation.groups.Created;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.metersphere.functional.service.CaseReviewService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@ -16,17 +16,6 @@ public class CaseReviewController {
@Resource
private CaseReviewService caseReviewService;
@PostMapping("/add")
public void addCaseReview(@Validated({Created.class}) @RequestBody CaseReview caseReview) {
caseReviewService.addCaseReview(caseReview);
}
@PostMapping("/delete")
public void delCaseReview(@Validated({Created.class}) @RequestBody CaseReview caseReview) {
caseReviewService.delCaseReview(caseReview);
}
@GetMapping("/get/{id}")
public CaseReviewDto get(@PathVariable String id) {

View File

@ -1,11 +1,7 @@
package io.metersphere.functional.service;
import io.metersphere.functional.domain.CaseReview;
import io.metersphere.functional.dto.CaseReviewDto;
import io.metersphere.functional.mapper.CaseReviewMapper;
import io.metersphere.sdk.util.BeanUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
/**
@ -16,24 +12,9 @@ import org.springframework.stereotype.Service;
@Service
public class CaseReviewService {
@Resource
private CaseReviewMapper caseReviewMapper;
public void addCaseReview(CaseReview caseReview) {
caseReviewMapper.insertSelective(caseReview);
}
public void delCaseReview(CaseReview caseReview) {
caseReviewMapper.deleteByPrimaryKey(caseReview.getId());
}
public CaseReviewDto get(String id) {
CaseReviewDto caseReviewDto = new CaseReviewDto();
CaseReview caseReview = caseReviewMapper.selectByPrimaryKey(id);
if (caseReview == null) {
return null;
}
BeanUtils.copyBean(caseReviewDto, caseReview);
return caseReviewDto;
}
}

View File

@ -1,9 +1,7 @@
package io.metersphere.functional.controller;
import com.jayway.jsonpath.JsonPath;
import io.metersphere.functional.domain.CaseReview;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.sdk.util.JSON;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
@ -16,7 +14,6 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@ -47,58 +44,6 @@ public class CaseReviewControllerTests {
@Test
@Order(1)
public void testAddCaseReview() throws Exception {
CaseReview caseReview = new CaseReview();
caseReview.setId("case-review-id");
caseReview.setName("1");
caseReview.setStatus("Finished");
caseReview.setCreateTime(System.currentTimeMillis());
caseReview.setUpdateTime(System.currentTimeMillis());
caseReview.setEndTime(System.currentTimeMillis());
caseReview.setProjectId("1");
caseReview.setCreateUser("admin");
caseReview.setReviewPassRule("SINGLE");
mockMvc.perform(MockMvcRequestBuilders.post("/case/review/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(caseReview))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON));
}
@Test
@Order(2)
public void testAddCaseReviewFalse() throws Exception {
CaseReview caseReview = new CaseReview();
caseReview.setName("test");
mockMvc.perform(MockMvcRequestBuilders.post("/case/review/add")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(caseReview))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_JSON));
}
@Test
@Order(3)
public void testDelCaseReview() throws Exception {
CaseReview caseReview = new CaseReview();
caseReview.setId("case-review-id");
mockMvc.perform(MockMvcRequestBuilders.post("/case/review/delete")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.content(JSON.toJSONString(caseReview))
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_JSON));
}
@Test
@Order(4)
public void testGetCaseReview() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get("/case/review/get/case-review-id")
.header(SessionConstants.HEADER_TOKEN, sessionId)

View File

@ -10,7 +10,7 @@ public class ModuleDTO implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "模块", allowableValues = {"WORKSTATION", "TEST_PLAN", "UI", "PERFORMANCE_TEST", "API", "CASE", "BUG"})
@Schema(description = "模块", allowableValues = {"workstation", "testPlan", "bugManagement", "caseManagement", "apiTest", "uiTest", "loadTest"})
private String module;
@Schema(description = "是否启用", allowableValues = {"true", "false"})

View File

@ -21,6 +21,6 @@ public class ProjectApplicationRequest implements Serializable {
@NotBlank(message = "{project_application.project_id.not_blank}")
private String projectId;
@Schema(description = "配置类型列表", allowableValues = {"WORKSTATION", "TEST_PLAN", "UI", "PERFORMANCE_TEST", "API", "CASE", "BUG"}, requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "配置类型列表", allowableValues = {"workstation", "testPlan", "bugManagement", "caseManagement", "apiTest", "uiTest", "loadTest"}, requiredMode = Schema.RequiredMode.REQUIRED)
private String type;
}