diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomVariable.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomVariable.java new file mode 100644 index 0000000000..18fb2dad74 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomVariable.java @@ -0,0 +1,127 @@ +package io.metersphere.ui.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 UiCustomVariable implements Serializable { + @Schema(title = "指令ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_custom_variable.resource_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{ui_custom_variable.resource_id.length_range}", groups = {Created.class, Updated.class}) + private String resourceId; + + @Schema(title = "变量类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_custom_variable.type.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 100, message = "{ui_custom_variable.type.length_range}", groups = {Created.class, Updated.class}) + private String type; + + @Schema(title = "变量值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_custom_variable.value.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 1000, message = "{ui_custom_variable.value.length_range}", groups = {Created.class, Updated.class}) + private String value; + + @Schema(title = "变量名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_custom_variable.name.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{ui_custom_variable.name.length_range}", groups = {Created.class, Updated.class}) + private String name; + + @Schema(title = "描述") + private String description; + + @Schema(title = "删除状态", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{ui_custom_variable.deleted.not_blank}", groups = {Created.class, Updated.class}) + private Boolean deleted; + + @Schema(title = "是否是出参", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{ui_custom_variable.out_put.not_blank}", groups = {Created.class, Updated.class}) + private Boolean outPut; + + @Schema(title = "启用禁用") + @NotNull(message = "{ui_custom_variable.enable.not_blank}", groups = {Created.class, Updated.class}) + private Boolean enable; + + private static final long serialVersionUID = 1L; + + public enum Column { + resourceId("resource_id", "resourceId", "VARCHAR", false), + type("type", "type", "VARCHAR", true), + value("value", "value", "VARCHAR", true), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + deleted("deleted", "deleted", "BIT", false), + outPut("out_put", "outPut", "BIT", false), + enable("enable", "enable", "BIT", 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/ui/domain/UiCustomVariableExample.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomVariableExample.java new file mode 100644 index 0000000000..c25b3f6f94 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomVariableExample.java @@ -0,0 +1,730 @@ +package io.metersphere.ui.domain; + +import java.util.ArrayList; +import java.util.List; + +public class UiCustomVariableExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UiCustomVariableExample() { + 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 andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("`value` is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("`value` is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("`value` =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("`value` <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("`value` >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("`value` >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("`value` <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("`value` <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("`value` like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("`value` not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("`value` in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("`value` not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("`value` between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("`value` not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDeletedIsNull() { + addCriterion("deleted is null"); + return (Criteria) this; + } + + public Criteria andDeletedIsNotNull() { + addCriterion("deleted is not null"); + return (Criteria) this; + } + + public Criteria andDeletedEqualTo(Boolean value) { + addCriterion("deleted =", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotEqualTo(Boolean value) { + addCriterion("deleted <>", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThan(Boolean value) { + addCriterion("deleted >", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { + addCriterion("deleted >=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThan(Boolean value) { + addCriterion("deleted <", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedLessThanOrEqualTo(Boolean value) { + addCriterion("deleted <=", value, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedIn(List values) { + addCriterion("deleted in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotIn(List values) { + addCriterion("deleted not in", values, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedBetween(Boolean value1, Boolean value2) { + addCriterion("deleted between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { + addCriterion("deleted not between", value1, value2, "deleted"); + return (Criteria) this; + } + + public Criteria andOutPutIsNull() { + addCriterion("out_put is null"); + return (Criteria) this; + } + + public Criteria andOutPutIsNotNull() { + addCriterion("out_put is not null"); + return (Criteria) this; + } + + public Criteria andOutPutEqualTo(Boolean value) { + addCriterion("out_put =", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutNotEqualTo(Boolean value) { + addCriterion("out_put <>", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutGreaterThan(Boolean value) { + addCriterion("out_put >", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutGreaterThanOrEqualTo(Boolean value) { + addCriterion("out_put >=", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutLessThan(Boolean value) { + addCriterion("out_put <", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutLessThanOrEqualTo(Boolean value) { + addCriterion("out_put <=", value, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutIn(List values) { + addCriterion("out_put in", values, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutNotIn(List values) { + addCriterion("out_put not in", values, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutBetween(Boolean value1, Boolean value2) { + addCriterion("out_put between", value1, value2, "outPut"); + return (Criteria) this; + } + + public Criteria andOutPutNotBetween(Boolean value1, Boolean value2) { + addCriterion("out_put not between", value1, value2, "outPut"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + 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/ui/domain/UiScenarioVariable.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioVariable.java new file mode 100644 index 0000000000..d157ea802d --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioVariable.java @@ -0,0 +1,112 @@ +package io.metersphere.ui.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 UiScenarioVariable implements Serializable { + @Schema(title = "场景ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_scenario_variable.resource_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{ui_scenario_variable.resource_id.length_range}", groups = {Created.class, Updated.class}) + private String resourceId; + + @Schema(title = "变量类型", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_scenario_variable.type.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 100, message = "{ui_scenario_variable.type.length_range}", groups = {Created.class, Updated.class}) + private String type; + + @Schema(title = "变量值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_scenario_variable.value.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 1000, message = "{ui_scenario_variable.value.length_range}", groups = {Created.class, Updated.class}) + private String value; + + @Schema(title = "变量名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_scenario_variable.name.not_blank}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{ui_scenario_variable.name.length_range}", groups = {Created.class, Updated.class}) + private String name; + + @Schema(title = "描述") + private String description; + + private static final long serialVersionUID = 1L; + + public enum Column { + resourceId("resource_id", "resourceId", "VARCHAR", false), + type("type", "type", "VARCHAR", true), + value("value", "value", "VARCHAR", true), + name("name", "name", "VARCHAR", true), + description("description", "description", "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/ui/domain/UiScenarioVariableExample.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioVariableExample.java new file mode 100644 index 0000000000..d00cc90890 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioVariableExample.java @@ -0,0 +1,550 @@ +package io.metersphere.ui.domain; + +import java.util.ArrayList; +import java.util.List; + +public class UiScenarioVariableExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UiScenarioVariableExample() { + 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 andResourceIdIsNull() { + addCriterion("resource_id is null"); + return (Criteria) this; + } + + public Criteria andResourceIdIsNotNull() { + addCriterion("resource_id is not null"); + return (Criteria) this; + } + + public Criteria andResourceIdEqualTo(String value) { + addCriterion("resource_id =", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotEqualTo(String value) { + addCriterion("resource_id <>", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThan(String value) { + addCriterion("resource_id >", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdGreaterThanOrEqualTo(String value) { + addCriterion("resource_id >=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThan(String value) { + addCriterion("resource_id <", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLessThanOrEqualTo(String value) { + addCriterion("resource_id <=", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdLike(String value) { + addCriterion("resource_id like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotLike(String value) { + addCriterion("resource_id not like", value, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdIn(List values) { + addCriterion("resource_id in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotIn(List values) { + addCriterion("resource_id not in", values, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdBetween(String value1, String value2) { + addCriterion("resource_id between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andResourceIdNotBetween(String value1, String value2) { + addCriterion("resource_id not between", value1, value2, "resourceId"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("`value` is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("`value` is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("`value` =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("`value` <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("`value` >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("`value` >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("`value` <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("`value` <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("`value` like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("`value` not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("`value` in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("`value` not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("`value` between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("`value` not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + 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/ui/mapper/UiCustomVariableMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomVariableMapper.java new file mode 100644 index 0000000000..339d1c9a12 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomVariableMapper.java @@ -0,0 +1,34 @@ +package io.metersphere.ui.mapper; + +import io.metersphere.ui.domain.UiCustomVariable; +import io.metersphere.ui.domain.UiCustomVariableExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface UiCustomVariableMapper { + long countByExample(UiCustomVariableExample example); + + int deleteByExample(UiCustomVariableExample example); + + int deleteByPrimaryKey(String resourceId); + + int insert(UiCustomVariable record); + + int insertSelective(UiCustomVariable record); + + List selectByExample(UiCustomVariableExample example); + + UiCustomVariable selectByPrimaryKey(String resourceId); + + int updateByExampleSelective(@Param("record") UiCustomVariable record, @Param("example") UiCustomVariableExample example); + + int updateByExample(@Param("record") UiCustomVariable record, @Param("example") UiCustomVariableExample example); + + int updateByPrimaryKeySelective(UiCustomVariable record); + + int updateByPrimaryKey(UiCustomVariable record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiCustomVariable.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomVariableMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomVariableMapper.xml new file mode 100644 index 0000000000..45ad32355f --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomVariableMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + 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} + + + + + + + + + + + resource_id, `type`, `value`, `name`, description, deleted, out_put, `enable` + + + + + delete from ui_custom_variable + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + delete from ui_custom_variable + + + + + + insert into ui_custom_variable (resource_id, `type`, `value`, + `name`, description, deleted, + out_put, `enable`) + values (#{resourceId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT}, + #{outPut,jdbcType=BIT}, #{enable,jdbcType=BIT}) + + + insert into ui_custom_variable + + + resource_id, + + + `type`, + + + `value`, + + + `name`, + + + description, + + + deleted, + + + out_put, + + + `enable`, + + + + + #{resourceId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{deleted,jdbcType=BIT}, + + + #{outPut,jdbcType=BIT}, + + + #{enable,jdbcType=BIT}, + + + + + + update ui_custom_variable + + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + `value` = #{record.value,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + deleted = #{record.deleted,jdbcType=BIT}, + + + out_put = #{record.outPut,jdbcType=BIT}, + + + `enable` = #{record.enable,jdbcType=BIT}, + + + + + + + + update ui_custom_variable + set resource_id = #{record.resourceId,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + `value` = #{record.value,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + deleted = #{record.deleted,jdbcType=BIT}, + out_put = #{record.outPut,jdbcType=BIT}, + `enable` = #{record.enable,jdbcType=BIT} + + + + + + update ui_custom_variable + + + `type` = #{type,jdbcType=VARCHAR}, + + + `value` = #{value,jdbcType=VARCHAR}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + deleted = #{deleted,jdbcType=BIT}, + + + out_put = #{outPut,jdbcType=BIT}, + + + `enable` = #{enable,jdbcType=BIT}, + + + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + update ui_custom_variable + set `type` = #{type,jdbcType=VARCHAR}, + `value` = #{value,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=BIT}, + out_put = #{outPut,jdbcType=BIT}, + `enable` = #{enable,jdbcType=BIT} + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + insert into ui_custom_variable + (resource_id, `type`, `value`, `name`, description, deleted, out_put, `enable`) + values + + (#{item.resourceId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR}, + #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT}, + #{item.outPut,jdbcType=BIT}, #{item.enable,jdbcType=BIT}) + + + + insert into ui_custom_variable ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.value,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.deleted,jdbcType=BIT} + + + #{item.outPut,jdbcType=BIT} + + + #{item.enable,jdbcType=BIT} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.java new file mode 100644 index 0000000000..ff632c383b --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.java @@ -0,0 +1,34 @@ +package io.metersphere.ui.mapper; + +import io.metersphere.ui.domain.UiScenarioVariable; +import io.metersphere.ui.domain.UiScenarioVariableExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface UiScenarioVariableMapper { + long countByExample(UiScenarioVariableExample example); + + int deleteByExample(UiScenarioVariableExample example); + + int deleteByPrimaryKey(String resourceId); + + int insert(UiScenarioVariable record); + + int insertSelective(UiScenarioVariable record); + + List selectByExample(UiScenarioVariableExample example); + + UiScenarioVariable selectByPrimaryKey(String resourceId); + + int updateByExampleSelective(@Param("record") UiScenarioVariable record, @Param("example") UiScenarioVariableExample example); + + int updateByExample(@Param("record") UiScenarioVariable record, @Param("example") UiScenarioVariableExample example); + + int updateByPrimaryKeySelective(UiScenarioVariable record); + + int updateByPrimaryKey(UiScenarioVariable record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioVariable.Column ... selective); +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.xml new file mode 100644 index 0000000000..98e777a1ae --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioVariableMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + 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} + + + + + + + + + + + resource_id, `type`, `value`, `name`, description + + + + + delete from ui_scenario_variable + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + delete from ui_scenario_variable + + + + + + insert into ui_scenario_variable (resource_id, `type`, `value`, + `name`, description) + values (#{resourceId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}) + + + insert into ui_scenario_variable + + + resource_id, + + + `type`, + + + `value`, + + + `name`, + + + description, + + + + + #{resourceId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + + + + update ui_scenario_variable + + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + `value` = #{record.value,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + + + + + + update ui_scenario_variable + set resource_id = #{record.resourceId,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=VARCHAR}, + `value` = #{record.value,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR} + + + + + + update ui_scenario_variable + + + `type` = #{type,jdbcType=VARCHAR}, + + + `value` = #{value,jdbcType=VARCHAR}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + update ui_scenario_variable + set `type` = #{type,jdbcType=VARCHAR}, + `value` = #{value,jdbcType=VARCHAR}, + `name` = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR} + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + insert into ui_scenario_variable + (resource_id, `type`, `value`, `name`, description) + values + + (#{item.resourceId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR}, + #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}) + + + + insert into ui_scenario_variable ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.value,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + ) + + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_8__ui_test.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_8__ui_test.sql index 2b00297e84..54f293a740 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_8__ui_test.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_8__ui_test.sql @@ -335,6 +335,44 @@ CREATE TABLE IF NOT EXISTS ui_scenario_follower( CREATE INDEX idx_user_id ON ui_scenario_follower(user_id); +DROP TABLE IF EXISTS ui_scenario_variable; +CREATE TABLE ui_scenario_variable( + `resource_id` VARCHAR(50) NOT NULL COMMENT '场景ID' , + `type` VARCHAR(100) NOT NULL COMMENT '变量类型' , + `value` VARCHAR(1000) NOT NULL COMMENT '变量值' , + `name` VARCHAR(255) NOT NULL COMMENT '变量名称' , + `description` VARCHAR(500) COMMENT '描述' , + PRIMARY KEY (resource_id) +) COMMENT = '场景变量'; + + +CREATE INDEX idx_resource_id ON ui_scenario_variable(resource_id); +CREATE INDEX idx_name ON ui_scenario_variable(name); +CREATE INDEX idx_type ON ui_scenario_variable(type); + +DROP TABLE IF EXISTS ui_custom_variable; +CREATE TABLE ui_custom_variable( + `resource_id` VARCHAR(50) NOT NULL COMMENT '指令ID' , + `type` VARCHAR(100) NOT NULL COMMENT '变量类型' , + `value` VARCHAR(1000) NOT NULL COMMENT '变量值' , + `name` VARCHAR(255) NOT NULL COMMENT '变量名称' , + `description` VARCHAR(500) COMMENT '描述' , + `deleted` BIT NOT NULL DEFAULT 0 COMMENT '删除状态' , + `out_put` BIT NOT NULL DEFAULT 0 COMMENT '是否是出参' , + `enable` BIT NOT NULL DEFAULT 1 COMMENT '启用禁用' , + PRIMARY KEY (resource_id) +) COMMENT = '指令初入参变量'; + + +CREATE INDEX idx_resource_id ON ui_custom_variable(resource_id); +CREATE INDEX idx_type ON ui_custom_variable(type); +CREATE INDEX idx_enable ON ui_custom_variable(enable); +CREATE INDEX idx_name ON ui_custom_variable(name); +CREATE INDEX idx_deleted ON ui_custom_variable(deleted); +CREATE INDEX idx_out_put ON ui_custom_variable(out_put); + + -- 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; +