From cac7df5543b7fd5e74a5a159236361996da20833 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 11 Aug 2023 14:51:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=8E=AF=E5=A2=83=E7=AE=A1?= =?UTF-8?q?=E7=90=86domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/sdk/domain/Environment.java | 127 +++- .../sdk/domain/EnvironmentBlob.java | 95 +++ .../sdk/domain/EnvironmentBlobExample.java | 270 ++++++++ .../sdk/domain/EnvironmentExample.java | 340 ++-------- .../sdk/domain/EnvironmentGroup.java | 103 ++- .../sdk/domain/EnvironmentGroupExample.java | 126 +++- .../sdk/domain/EnvironmentGroupProject.java | 26 - .../sdk/domain/EnvironmentGroupRelation.java | 108 ++++ ...a => EnvironmentGroupRelationExample.java} | 4 +- .../sdk/domain/ProjectParameters.java | 116 ++++ .../sdk/domain/ProjectParametersExample.java | 600 ++++++++++++++++++ .../sdk/mapper/EnvironmentBlobMapper.java | 38 ++ .../sdk/mapper/EnvironmentBlobMapper.xml | 222 +++++++ .../sdk/mapper/EnvironmentGroupMapper.java | 4 + .../sdk/mapper/EnvironmentGroupMapper.xml | 100 ++- .../mapper/EnvironmentGroupProjectMapper.java | 30 - .../EnvironmentGroupRelationMapper.java | 34 + ...xml => EnvironmentGroupRelationMapper.xml} | 75 ++- .../sdk/mapper/EnvironmentMapper.java | 10 +- .../sdk/mapper/EnvironmentMapper.xml | 249 ++------ .../sdk/mapper/ProjectParametersMapper.java | 40 ++ .../sdk/mapper/ProjectParametersMapper.xml | 333 ++++++++++ .../migration/3.0.0/ddl/V3.0.0_2__sdk_ddl.sql | 88 ++- 23 files changed, 2507 insertions(+), 631 deletions(-) create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlob.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlobExample.java delete mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelation.java rename backend/framework/domain/src/main/java/io/metersphere/sdk/domain/{EnvironmentGroupProjectExample.java => EnvironmentGroupRelationExample.java} (99%) create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParameters.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParametersExample.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.xml delete mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupProjectMapper.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupRelationMapper.java rename backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/{EnvironmentGroupProjectMapper.xml => EnvironmentGroupRelationMapper.xml} (75%) create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/ProjectParametersMapper.java create mode 100644 backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/ProjectParametersMapper.xml diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java index b6adf863df..ef89cf2b57 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java @@ -1,60 +1,121 @@ package io.metersphere.sdk.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 java.io.Serializable; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + @Data public class Environment implements Serializable { - @Schema(description = "环境ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "环境ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{environment.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{environment.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "环境名称", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "环境名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{environment.name.not_blank}", groups = {Created.class}) @Size(min = 1, max = 255, message = "{environment.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{environment.project_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{environment.project_id.length_range}", groups = {Created.class, Updated.class}) private String projectId; - @Schema(description = "协议") - private String protocol; - - @Schema(description = "") - private String socket; - - @Schema(description = "域名/IP") - private String domain; - - @Schema(description = "端口") - private Integer port; - - @Schema(description = "创建人") + @Schema(description = "创建人") private String createUser; - @Schema(description = "创建时间") + @Schema(description = "修改人") + private String updateUser; + + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "全局变量") - private String variables; - - @Schema(description = "请求头") - private String headers; - - @Schema(description = "Config Data (JSON format)") - private String config; - - @Schema(description = "hosts") - private String hosts; - private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + projectId("project_id", "projectId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "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 columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlob.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlob.java new file mode 100644 index 0000000000..fc11f36757 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlob.java @@ -0,0 +1,95 @@ +package io.metersphere.sdk.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class EnvironmentBlob implements Serializable { + @Schema(description = "环境ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_blob.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{environment_blob.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "Config Data (JSON format)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{environment_blob.config.not_blank}", groups = {Created.class}) + private byte[] config; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + config("config", "config", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlobExample.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlobExample.java new file mode 100644 index 0000000000..3c83e033c0 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentBlobExample.java @@ -0,0 +1,270 @@ +package io.metersphere.sdk.domain; + +import java.util.ArrayList; +import java.util.List; + +public class EnvironmentBlobExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public EnvironmentBlobExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentExample.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentExample.java index cdc76bc412..a927310d73 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentExample.java @@ -314,276 +314,6 @@ public class EnvironmentExample { return (Criteria) this; } - public Criteria andProtocolIsNull() { - addCriterion("protocol is null"); - return (Criteria) this; - } - - public Criteria andProtocolIsNotNull() { - addCriterion("protocol is not null"); - return (Criteria) this; - } - - public Criteria andProtocolEqualTo(String value) { - addCriterion("protocol =", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotEqualTo(String value) { - addCriterion("protocol <>", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThan(String value) { - addCriterion("protocol >", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThanOrEqualTo(String value) { - addCriterion("protocol >=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThan(String value) { - addCriterion("protocol <", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThanOrEqualTo(String value) { - addCriterion("protocol <=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLike(String value) { - addCriterion("protocol like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotLike(String value) { - addCriterion("protocol not like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolIn(List values) { - addCriterion("protocol in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotIn(List values) { - addCriterion("protocol not in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolBetween(String value1, String value2) { - addCriterion("protocol between", value1, value2, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotBetween(String value1, String value2) { - addCriterion("protocol not between", value1, value2, "protocol"); - return (Criteria) this; - } - - public Criteria andSocketIsNull() { - addCriterion("socket is null"); - return (Criteria) this; - } - - public Criteria andSocketIsNotNull() { - addCriterion("socket is not null"); - return (Criteria) this; - } - - public Criteria andSocketEqualTo(String value) { - addCriterion("socket =", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketNotEqualTo(String value) { - addCriterion("socket <>", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketGreaterThan(String value) { - addCriterion("socket >", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketGreaterThanOrEqualTo(String value) { - addCriterion("socket >=", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketLessThan(String value) { - addCriterion("socket <", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketLessThanOrEqualTo(String value) { - addCriterion("socket <=", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketLike(String value) { - addCriterion("socket like", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketNotLike(String value) { - addCriterion("socket not like", value, "socket"); - return (Criteria) this; - } - - public Criteria andSocketIn(List values) { - addCriterion("socket in", values, "socket"); - return (Criteria) this; - } - - public Criteria andSocketNotIn(List values) { - addCriterion("socket not in", values, "socket"); - return (Criteria) this; - } - - public Criteria andSocketBetween(String value1, String value2) { - addCriterion("socket between", value1, value2, "socket"); - return (Criteria) this; - } - - public Criteria andSocketNotBetween(String value1, String value2) { - addCriterion("socket not between", value1, value2, "socket"); - return (Criteria) this; - } - - public Criteria andDomainIsNull() { - addCriterion("`domain` is null"); - return (Criteria) this; - } - - public Criteria andDomainIsNotNull() { - addCriterion("`domain` is not null"); - return (Criteria) this; - } - - public Criteria andDomainEqualTo(String value) { - addCriterion("`domain` =", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainNotEqualTo(String value) { - addCriterion("`domain` <>", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainGreaterThan(String value) { - addCriterion("`domain` >", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainGreaterThanOrEqualTo(String value) { - addCriterion("`domain` >=", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainLessThan(String value) { - addCriterion("`domain` <", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainLessThanOrEqualTo(String value) { - addCriterion("`domain` <=", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainLike(String value) { - addCriterion("`domain` like", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainNotLike(String value) { - addCriterion("`domain` not like", value, "domain"); - return (Criteria) this; - } - - public Criteria andDomainIn(List values) { - addCriterion("`domain` in", values, "domain"); - return (Criteria) this; - } - - public Criteria andDomainNotIn(List values) { - addCriterion("`domain` not in", values, "domain"); - return (Criteria) this; - } - - public Criteria andDomainBetween(String value1, String value2) { - addCriterion("`domain` between", value1, value2, "domain"); - return (Criteria) this; - } - - public Criteria andDomainNotBetween(String value1, String value2) { - addCriterion("`domain` not between", value1, value2, "domain"); - return (Criteria) this; - } - - public Criteria andPortIsNull() { - addCriterion("port is null"); - return (Criteria) this; - } - - public Criteria andPortIsNotNull() { - addCriterion("port is not null"); - return (Criteria) this; - } - - public Criteria andPortEqualTo(Integer value) { - addCriterion("port =", value, "port"); - return (Criteria) this; - } - - public Criteria andPortNotEqualTo(Integer value) { - addCriterion("port <>", value, "port"); - return (Criteria) this; - } - - public Criteria andPortGreaterThan(Integer value) { - addCriterion("port >", value, "port"); - return (Criteria) this; - } - - public Criteria andPortGreaterThanOrEqualTo(Integer value) { - addCriterion("port >=", value, "port"); - return (Criteria) this; - } - - public Criteria andPortLessThan(Integer value) { - addCriterion("port <", value, "port"); - return (Criteria) this; - } - - public Criteria andPortLessThanOrEqualTo(Integer value) { - addCriterion("port <=", value, "port"); - return (Criteria) this; - } - - public Criteria andPortIn(List values) { - addCriterion("port in", values, "port"); - return (Criteria) this; - } - - public Criteria andPortNotIn(List values) { - addCriterion("port not in", values, "port"); - return (Criteria) this; - } - - public Criteria andPortBetween(Integer value1, Integer value2) { - addCriterion("port between", value1, value2, "port"); - return (Criteria) this; - } - - public Criteria andPortNotBetween(Integer value1, Integer value2) { - addCriterion("port not between", value1, value2, "port"); - return (Criteria) this; - } - public Criteria andCreateUserIsNull() { addCriterion("create_user is null"); return (Criteria) this; @@ -654,6 +384,76 @@ public class EnvironmentExample { 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 values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List 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 andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java index 1f635cf59a..c065cd0419 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java @@ -4,36 +4,119 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data public class EnvironmentGroup implements Serializable { - @Schema(description = "环境组id", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "环境组id", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{environment_group.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{environment_group.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "环境组名", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "环境组名", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{environment_group.name.not_blank}", groups = {Created.class}) @Size(min = 1, max = 255, message = "{environment_group.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "所属组织", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{environment_group.organization_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{environment_group.organization_id.length_range}", groups = {Created.class, Updated.class}) - private String organizationId; + @Schema(description = "所属项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_group.project_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{environment_group.project_id.length_range}", groups = {Created.class, Updated.class}) + private String projectId; - @Schema(description = "环境组描述") + @Schema(description = "环境组描述") private String description; - @Schema(description = "创建人") + @Schema(description = "创建人") private String createUser; - @Schema(description = "创建时间") + @Schema(description = "修改人") + private String updateUser; + + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + projectId("project_id", "projectId", "VARCHAR", false), + description("description", "description", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "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 columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupExample.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupExample.java index 0b0615ab65..4c0de56fcc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupExample.java @@ -244,73 +244,73 @@ public class EnvironmentGroupExample { return (Criteria) this; } - public Criteria andOrganizationIdIsNull() { - addCriterion("organization_id is null"); + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); return (Criteria) this; } - public Criteria andOrganizationIdIsNotNull() { - addCriterion("organization_id is not null"); + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); return (Criteria) this; } - public Criteria andOrganizationIdEqualTo(String value) { - addCriterion("organization_id =", value, "organizationId"); + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdNotEqualTo(String value) { - addCriterion("organization_id <>", value, "organizationId"); + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdGreaterThan(String value) { - addCriterion("organization_id >", value, "organizationId"); + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdGreaterThanOrEqualTo(String value) { - addCriterion("organization_id >=", value, "organizationId"); + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdLessThan(String value) { - addCriterion("organization_id <", value, "organizationId"); + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdLessThanOrEqualTo(String value) { - addCriterion("organization_id <=", value, "organizationId"); + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdLike(String value) { - addCriterion("organization_id like", value, "organizationId"); + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdNotLike(String value) { - addCriterion("organization_id not like", value, "organizationId"); + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdIn(List values) { - addCriterion("organization_id in", values, "organizationId"); + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdNotIn(List values) { - addCriterion("organization_id not in", values, "organizationId"); + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdBetween(String value1, String value2) { - addCriterion("organization_id between", value1, value2, "organizationId"); + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); return (Criteria) this; } - public Criteria andOrganizationIdNotBetween(String value1, String value2) { - addCriterion("organization_id not between", value1, value2, "organizationId"); + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); return (Criteria) this; } @@ -454,6 +454,76 @@ public class EnvironmentGroupExample { 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 values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List 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 andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java deleted file mode 100644 index 32b3963eba..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.metersphere.sdk.domain; - -import io.metersphere.validation.groups.*; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; -import lombok.Data; - -@Data -public class EnvironmentGroupProject implements Serializable { - @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{environment_group_project.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{environment_group_project.id.length_range}", groups = {Created.class, Updated.class}) - private String id; - - @Schema(description = "环境组id") - private String environmentGroupId; - - @Schema(description = "环境ID") - private String environmentId; - - @Schema(description = "项目id") - private String projectId; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelation.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelation.java new file mode 100644 index 0000000000..37f545e971 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelation.java @@ -0,0 +1,108 @@ +package io.metersphere.sdk.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class EnvironmentGroupRelation implements Serializable { + @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_group_relation.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{environment_group_relation.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "环境组id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_group_relation.environment_group_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{environment_group_relation.environment_group_id.length_range}", groups = {Created.class, Updated.class}) + private String environmentGroupId; + + @Schema(description = "环境ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_group_relation.environment_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{environment_group_relation.environment_id.length_range}", groups = {Created.class, Updated.class}) + private String environmentId; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{environment_group_relation.project_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{environment_group_relation.project_id.length_range}", groups = {Created.class, Updated.class}) + private String projectId; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + environmentGroupId("environment_group_id", "environmentGroupId", "VARCHAR", false), + environmentId("environment_id", "environmentId", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProjectExample.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelationExample.java similarity index 99% rename from backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProjectExample.java rename to backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelationExample.java index aa5d69a771..9c7d6ee693 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProjectExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupRelationExample.java @@ -3,14 +3,14 @@ package io.metersphere.sdk.domain; import java.util.ArrayList; import java.util.List; -public class EnvironmentGroupProjectExample { +public class EnvironmentGroupRelationExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public EnvironmentGroupProjectExample() { + public EnvironmentGroupRelationExample() { oredCriteria = new ArrayList(); } diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParameters.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParameters.java new file mode 100644 index 0000000000..69986c7b37 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParameters.java @@ -0,0 +1,116 @@ +package io.metersphere.sdk.domain; + +import io.metersphere.validation.groups.*; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; + +@Data +public class ProjectParameters implements Serializable { + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{project_parameters.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{project_parameters.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{project_parameters.project_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{project_parameters.project_id.length_range}", groups = {Created.class, Updated.class}) + private String projectId; + + @Schema(description = "创建人") + private String createUser; + + @Schema(description = "修改人") + private String updateUser; + + @Schema(description = "创建时间") + private Long createTime; + + @Schema(description = "更新时间") + private Long updateTime; + + @Schema(description = "参数配置") + private byte[] parameters; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + parameters("parameters", "parameters", "LONGVARBINARY", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParametersExample.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParametersExample.java new file mode 100644 index 0000000000..7ab03da39c --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ProjectParametersExample.java @@ -0,0 +1,600 @@ +package io.metersphere.sdk.domain; + +import java.util.ArrayList; +import java.util.List; + +public class ProjectParametersExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ProjectParametersExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNull() { + addCriterion("project_id is null"); + return (Criteria) this; + } + + public Criteria andProjectIdIsNotNull() { + addCriterion("project_id is not null"); + return (Criteria) this; + } + + public Criteria andProjectIdEqualTo(String value) { + addCriterion("project_id =", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotEqualTo(String value) { + addCriterion("project_id <>", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThan(String value) { + addCriterion("project_id >", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdGreaterThanOrEqualTo(String value) { + addCriterion("project_id >=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThan(String value) { + addCriterion("project_id <", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLessThanOrEqualTo(String value) { + addCriterion("project_id <=", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdLike(String value) { + addCriterion("project_id like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotLike(String value) { + addCriterion("project_id not like", value, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdIn(List values) { + addCriterion("project_id in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotIn(List values) { + addCriterion("project_id not in", values, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdBetween(String value1, String value2) { + addCriterion("project_id between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andProjectIdNotBetween(String value1, String value2) { + addCriterion("project_id not between", value1, value2, "projectId"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); + 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 values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List 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 andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.java new file mode 100644 index 0000000000..9a772c9805 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.java @@ -0,0 +1,38 @@ +package io.metersphere.sdk.mapper; + +import io.metersphere.sdk.domain.EnvironmentBlob; +import io.metersphere.sdk.domain.EnvironmentBlobExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface EnvironmentBlobMapper { + long countByExample(EnvironmentBlobExample example); + + int deleteByExample(EnvironmentBlobExample example); + + int deleteByPrimaryKey(String id); + + int insert(EnvironmentBlob record); + + int insertSelective(EnvironmentBlob record); + + List selectByExampleWithBLOBs(EnvironmentBlobExample example); + + List selectByExample(EnvironmentBlobExample example); + + EnvironmentBlob selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") EnvironmentBlob record, @Param("example") EnvironmentBlobExample example); + + int updateByExampleWithBLOBs(@Param("record") EnvironmentBlob record, @Param("example") EnvironmentBlobExample example); + + int updateByExample(@Param("record") EnvironmentBlob record, @Param("example") EnvironmentBlobExample example); + + int updateByPrimaryKeySelective(EnvironmentBlob record); + + int updateByPrimaryKeyWithBLOBs(EnvironmentBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") EnvironmentBlob.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.xml new file mode 100644 index 0000000000..d22c81878f --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentBlobMapper.xml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id + + + config + + + + + + delete from environment_blob + where id = #{id,jdbcType=VARCHAR} + + + delete from environment_blob + + + + + + insert into environment_blob (id, config) + values (#{id,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARBINARY}) + + + insert into environment_blob + + + id, + + + config, + + + + + #{id,jdbcType=VARCHAR}, + + + #{config,jdbcType=LONGVARBINARY}, + + + + + + update environment_blob + + + id = #{record.id,jdbcType=VARCHAR}, + + + config = #{record.config,jdbcType=LONGVARBINARY}, + + + + + + + + update environment_blob + set id = #{record.id,jdbcType=VARCHAR}, + config = #{record.config,jdbcType=LONGVARBINARY} + + + + + + update environment_blob + set id = #{record.id,jdbcType=VARCHAR} + + + + + + update environment_blob + + + config = #{config,jdbcType=LONGVARBINARY}, + + + where id = #{id,jdbcType=VARCHAR} + + + update environment_blob + set config = #{config,jdbcType=LONGVARBINARY} + where id = #{id,jdbcType=VARCHAR} + + + insert into environment_blob + (id, config) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.config,jdbcType=LONGVARBINARY}) + + + + insert into environment_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.config,jdbcType=LONGVARBINARY} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.java index 62bcfcca8f..48353784b2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.java @@ -27,4 +27,8 @@ public interface EnvironmentGroupMapper { int updateByPrimaryKeySelective(EnvironmentGroup record); int updateByPrimaryKey(EnvironmentGroup record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") EnvironmentGroup.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.xml index f6ac5ef9d0..b91762d2a3 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentGroupMapper.xml @@ -4,9 +4,10 @@ - + + @@ -69,7 +70,7 @@ - id, `name`, organization_id, description, create_user, create_time, update_time + id, `name`, project_id, description, create_user, update_user, create_time, update_time + select - from environment_group_project + from environment_group_relation where id = #{id,jdbcType=VARCHAR} - delete from environment_group_project + delete from environment_group_relation where id = #{id,jdbcType=VARCHAR} - - delete from environment_group_project + + delete from environment_group_relation - - insert into environment_group_project (id, environment_group_id, environment_id, + + insert into environment_group_relation (id, environment_group_id, environment_id, project_id) values (#{id,jdbcType=VARCHAR}, #{environmentGroupId,jdbcType=VARCHAR}, #{environmentId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}) - - insert into environment_group_project + + insert into environment_group_relation id, @@ -135,14 +135,14 @@ - + select count(*) from environment_group_relation - update environment_group_project + update environment_group_relation id = #{record.id,jdbcType=VARCHAR}, @@ -162,7 +162,7 @@ - update environment_group_project + update environment_group_relation set id = #{record.id,jdbcType=VARCHAR}, environment_group_id = #{record.environmentGroupId,jdbcType=VARCHAR}, environment_id = #{record.environmentId,jdbcType=VARCHAR}, @@ -171,8 +171,8 @@ - - update environment_group_project + + update environment_group_relation environment_group_id = #{environmentGroupId,jdbcType=VARCHAR}, @@ -186,11 +186,46 @@ where id = #{id,jdbcType=VARCHAR} - - update environment_group_project + + update environment_group_relation set environment_group_id = #{environmentGroupId,jdbcType=VARCHAR}, environment_id = #{environmentId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into environment_group_relation + (id, environment_group_id, environment_id, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.environmentGroupId,jdbcType=VARCHAR}, #{item.environmentId,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}) + + + + insert into environment_group_relation ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.environmentGroupId,jdbcType=VARCHAR} + + + #{item.environmentId,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.java index 83b589cd66..f5ee2c7ff7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.java @@ -16,21 +16,19 @@ public interface EnvironmentMapper { int insertSelective(Environment record); - List selectByExampleWithBLOBs(EnvironmentExample example); - List selectByExample(EnvironmentExample example); Environment selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") Environment record, @Param("example") EnvironmentExample example); - int updateByExampleWithBLOBs(@Param("record") Environment record, @Param("example") EnvironmentExample example); - int updateByExample(@Param("record") Environment record, @Param("example") EnvironmentExample example); int updateByPrimaryKeySelective(Environment record); - int updateByPrimaryKeyWithBLOBs(Environment record); - int updateByPrimaryKey(Environment record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Environment.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.xml index 7e2c7376b9..c563962e10 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/mapper/EnvironmentMapper.xml @@ -5,20 +5,11 @@ - - - - + - - - - - - @@ -78,28 +69,8 @@ - id, `name`, project_id, protocol, socket, `domain`, port, create_user, create_time, - update_time + id, `name`, project_id, create_user, update_user, create_time, update_time - - `variables`, headers, config, `hosts` - - - select - , - from environment where id = #{id,jdbcType=VARCHAR} @@ -134,15 +103,11 @@ insert into environment (id, `name`, project_id, - protocol, socket, `domain`, - port, create_user, create_time, - update_time, `variables`, headers, - config, `hosts`) + create_user, update_user, create_time, + update_time) values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, - #{protocol,jdbcType=VARCHAR}, #{socket,jdbcType=VARCHAR}, #{domain,jdbcType=VARCHAR}, - #{port,jdbcType=INTEGER}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, - #{updateTime,jdbcType=BIGINT}, #{variables,jdbcType=LONGVARCHAR}, #{headers,jdbcType=LONGVARCHAR}, - #{config,jdbcType=LONGVARCHAR}, #{hosts,jdbcType=LONGVARCHAR}) + #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}) insert into environment @@ -156,39 +121,18 @@ project_id, - - protocol, - - - socket, - - - `domain`, - - - port, - create_user, + + update_user, + create_time, update_time, - - `variables`, - - - headers, - - - config, - - - `hosts`, - @@ -200,39 +144,18 @@ #{projectId,jdbcType=VARCHAR}, - - #{protocol,jdbcType=VARCHAR}, - - - #{socket,jdbcType=VARCHAR}, - - - #{domain,jdbcType=VARCHAR}, - - - #{port,jdbcType=INTEGER}, - #{createUser,jdbcType=VARCHAR}, + + #{updateUser,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, - - #{variables,jdbcType=LONGVARCHAR}, - - - #{headers,jdbcType=LONGVARCHAR}, - - - #{config,jdbcType=LONGVARCHAR}, - - - #{hosts,jdbcType=LONGVARCHAR}, - + select + + distinct + + + , + + from project_parameters + + + + + order by ${orderByClause} + + + + + + delete from project_parameters + where id = #{id,jdbcType=VARCHAR} + + + delete from project_parameters + + + + + + insert into project_parameters (id, project_id, create_user, + update_user, create_time, update_time, + `parameters`) + values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, + #{updateUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, + #{parameters,jdbcType=LONGVARBINARY}) + + + insert into project_parameters + + + id, + + + project_id, + + + create_user, + + + update_user, + + + create_time, + + + update_time, + + + `parameters`, + + + + + #{id,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{createUser,jdbcType=VARCHAR}, + + + #{updateUser,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{parameters,jdbcType=LONGVARBINARY}, + + + + + + update project_parameters + + + id = #{record.id,jdbcType=VARCHAR}, + + + project_id = #{record.projectId,jdbcType=VARCHAR}, + + + create_user = #{record.createUser,jdbcType=VARCHAR}, + + + update_user = #{record.updateUser,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + `parameters` = #{record.parameters,jdbcType=LONGVARBINARY}, + + + + + + + + update project_parameters + set id = #{record.id,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + update_user = #{record.updateUser,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + `parameters` = #{record.parameters,jdbcType=LONGVARBINARY} + + + + + + update project_parameters + set id = #{record.id,jdbcType=VARCHAR}, + project_id = #{record.projectId,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + update_user = #{record.updateUser,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update project_parameters + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + create_user = #{createUser,jdbcType=VARCHAR}, + + + update_user = #{updateUser,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + `parameters` = #{parameters,jdbcType=LONGVARBINARY}, + + + where id = #{id,jdbcType=VARCHAR} + + + update project_parameters + set project_id = #{projectId,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, + update_user = #{updateUser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + `parameters` = #{parameters,jdbcType=LONGVARBINARY} + where id = #{id,jdbcType=VARCHAR} + + + update project_parameters + set project_id = #{projectId,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, + update_user = #{updateUser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + + insert into project_parameters + (id, project_id, create_user, update_user, create_time, update_time, `parameters` + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, + #{item.updateUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.parameters,jdbcType=LONGVARBINARY}) + + + + insert into project_parameters ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.parameters,jdbcType=LONGVARBINARY} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_2__sdk_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_2__sdk_ddl.sql index cebbed6332..8a40b873a4 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_2__sdk_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_2__sdk_ddl.sql @@ -31,12 +31,90 @@ CREATE INDEX idx_source_id ON operation_log(source_id); DROP TABLE IF EXISTS operation_log_blob; CREATE TABLE operation_log_blob( - `id` VARCHAR(50) NOT NULL COMMENT '主键' , - `original_value` LONGBLOB COMMENT '变更前内容' , - `modified_value` LONGBLOB COMMENT '变更后内容' , - PRIMARY KEY (id) + `id` VARCHAR(50) NOT NULL COMMENT '主键' , + `original_value` LONGBLOB COMMENT '变更前内容' , + `modified_value` LONGBLOB COMMENT '变更后内容' , + PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作日志内容详情'; + + +CREATE TABLE IF NOT EXISTS environment( + `id` VARCHAR(50) NOT NULL COMMENT '环境ID' , + `name` VARCHAR(255) NOT NULL COMMENT '环境名称' , + `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , + `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 INDEX idx_project_id ON environment(project_id); +CREATE INDEX idx_name ON environment(name); +CREATE INDEX idx_create_time ON environment(create_time); + +CREATE TABLE IF NOT EXISTS environment_blob( + `id` VARCHAR(50) NOT NULL COMMENT '环境ID' , + `config` LONGBLOB NOT NULL COMMENT 'Config Data (JSON format)' , + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '环境配置'; + +CREATE TABLE IF NOT EXISTS environment_group( + `id` VARCHAR(50) NOT NULL COMMENT '环境组id' , + `name` VARCHAR(255) NOT NULL COMMENT '环境组名' , + `project_id` VARCHAR(50) NOT NULL COMMENT '所属项目id' , + `description` VARCHAR(500) COMMENT '环境组描述' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , + `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 INDEX idx_name ON environment_group(name); +CREATE INDEX idx_project_id ON environment_group(project_id); +CREATE INDEX idx_create_user ON environment_group(create_user); +CREATE INDEX idx_create_time ON environment_group(create_time); +CREATE INDEX idx_update_time ON environment_group(update_time); + +CREATE TABLE IF NOT EXISTS environment_group_relation( + `id` VARCHAR(50) NOT NULL COMMENT '' , + `environment_group_id` VARCHAR(50) NOT NULL COMMENT '环境组id' , + `environment_id` VARCHAR(50) NOT NULL COMMENT '环境ID' , + `project_id` VARCHAR(50) NOT NULL COMMENT '项目id' , + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '环境组关联关系'; + +CREATE INDEX idx_environment_group_id ON environment_group_relation(environment_group_id); +CREATE INDEX idx_environment_id ON environment_group_relation(environment_id); +CREATE INDEX idx_project_id ON environment_group_relation(project_id); + +CREATE TABLE IF NOT EXISTS project_parameters( + `id` VARCHAR(50) NOT NULL COMMENT 'ID' , + `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `update_user` VARCHAR(50) NOT NULL COMMENT '修改人' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + `update_time` BIGINT NOT NULL COMMENT '更新时间' , + `parameters` LONGBLOB COMMENT '参数配置' , + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '项目级参数'; + +CREATE INDEX idx_project_id ON project_parameters(project_id); + + + -- set innodb lock wait timeout to default -SET SESSION innodb_lock_wait_timeout = DEFAULT; \ No newline at end of file +SET SESSION innodb_lock_wait_timeout = DEFAULT;