chore: MyBatis Generator 新增批量插入插件

This commit is contained in:
jianxing 2023-07-31 14:41:21 +08:00 committed by 刘瑞斌
parent 1ec447be2b
commit 8fadf99743
192 changed files with 8239 additions and 149 deletions

View File

@ -1,14 +1,12 @@
package io.metersphere.api.domain;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.metersphere.validation.groups.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
public class ApiDefinition implements Serializable {
@ -35,8 +33,7 @@ public class ApiDefinition implements Serializable {
@Schema(title = "删除时间")
private Long deleteTime;
@Schema(title = "删除状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{api_definition.deleted.not_blank}", groups = {Created.class})
@Schema(title = "删除状态")
private Boolean deleted;
@Schema(title = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED)
@ -78,8 +75,7 @@ public class ApiDefinition implements Serializable {
@NotNull(message = "{api_definition.pos.not_blank}", groups = {Created.class})
private Long pos;
@Schema(title = "是否启用同步", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{api_definition.sync_enable.not_blank}", groups = {Created.class})
@Schema(title = "是否启用同步")
private Boolean syncEnable;
@Schema(title = "同步开始时间")
@ -93,8 +89,7 @@ public class ApiDefinition implements Serializable {
@Schema(title = "环境fk")
private String environmentId;
@Schema(title = "是否为最新版本 0:否1:是", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{api_definition.latest.not_blank}", groups = {Created.class})
@Schema(title = "是否为最新版本 0:否1:是")
private Boolean latest;
@Schema(title = "版本fk")
@ -107,4 +102,100 @@ public class ApiDefinition implements Serializable {
private String description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateTime("update_time", "updateTime", "BIGINT", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
deleteUser("delete_user", "deleteUser", "VARCHAR", false),
deleteTime("delete_time", "deleteTime", "BIGINT", false),
deleted("deleted", "deleted", "BIT", false),
name("name", "name", "VARCHAR", true),
method("method", "method", "VARCHAR", true),
protocol("protocol", "protocol", "VARCHAR", false),
path("path", "path", "VARCHAR", true),
modulePath("module_path", "modulePath", "VARCHAR", false),
status("status", "status", "VARCHAR", true),
moduleId("module_id", "moduleId", "VARCHAR", false),
num("num", "num", "INTEGER", false),
tags("tags", "tags", "VARCHAR", false),
pos("pos", "pos", "BIGINT", false),
syncEnable("sync_enable", "syncEnable", "BIT", false),
syncTime("sync_time", "syncTime", "BIGINT", false),
projectId("project_id", "projectId", "VARCHAR", false),
environmentId("environment_id", "environmentId", "VARCHAR", false),
latest("latest", "latest", "BIT", false),
versionId("version_id", "versionId", "VARCHAR", false),
refId("ref_id", "refId", "VARCHAR", false),
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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -1,13 +1,12 @@
package io.metersphere.api.domain;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.metersphere.validation.groups.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
public class ApiDefinitionBlob implements Serializable {
@ -26,4 +25,78 @@ public class ApiDefinitionBlob implements Serializable {
private byte[] remark;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
request("request", "request", "LONGVARBINARY", false),
response("response", "response", "LONGVARBINARY", false),
remark("remark", "remark", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

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

View File

@ -223,4 +223,39 @@
remark = #{remark,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into api_definition_blob
(id, request, response, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.request,jdbcType=LONGVARBINARY}, #{item.response,jdbcType=LONGVARBINARY},
#{item.remark,jdbcType=LONGVARBINARY})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into api_definition_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'request'.toString() == column.value">
#{item.request,jdbcType=LONGVARBINARY}
</if>
<if test="'response'.toString() == column.value">
#{item.response,jdbcType=LONGVARBINARY}
</if>
<if test="'remark'.toString() == column.value">
#{item.remark,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -540,4 +540,115 @@
description = #{description,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into api_definition
(id, create_time, create_user, update_time, update_user, delete_user, delete_time,
deleted, `name`, `method`, protocol, `path`, module_path, `status`, module_id,
num, tags, pos, sync_enable, sync_time, project_id, environment_id, latest, version_id,
ref_id, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR},
#{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.deleteUser,jdbcType=VARCHAR},
#{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.name,jdbcType=VARCHAR},
#{item.method,jdbcType=VARCHAR}, #{item.protocol,jdbcType=VARCHAR}, #{item.path,jdbcType=VARCHAR},
#{item.modulePath,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.moduleId,jdbcType=VARCHAR},
#{item.num,jdbcType=INTEGER}, #{item.tags,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT},
#{item.syncEnable,jdbcType=BIT}, #{item.syncTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR},
#{item.environmentId,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, #{item.versionId,jdbcType=VARCHAR},
#{item.refId,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into api_definition (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'delete_user'.toString() == column.value">
#{item.deleteUser,jdbcType=VARCHAR}
</if>
<if test="'delete_time'.toString() == column.value">
#{item.deleteTime,jdbcType=BIGINT}
</if>
<if test="'deleted'.toString() == column.value">
#{item.deleted,jdbcType=BIT}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'method'.toString() == column.value">
#{item.method,jdbcType=VARCHAR}
</if>
<if test="'protocol'.toString() == column.value">
#{item.protocol,jdbcType=VARCHAR}
</if>
<if test="'path'.toString() == column.value">
#{item.path,jdbcType=VARCHAR}
</if>
<if test="'module_path'.toString() == column.value">
#{item.modulePath,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'module_id'.toString() == column.value">
#{item.moduleId,jdbcType=VARCHAR}
</if>
<if test="'num'.toString() == column.value">
#{item.num,jdbcType=INTEGER}
</if>
<if test="'tags'.toString() == column.value">
#{item.tags,jdbcType=VARCHAR}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=BIGINT}
</if>
<if test="'sync_enable'.toString() == column.value">
#{item.syncEnable,jdbcType=BIT}
</if>
<if test="'sync_time'.toString() == column.value">
#{item.syncTime,jdbcType=BIGINT}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'environment_id'.toString() == column.value">
#{item.environmentId,jdbcType=VARCHAR}
</if>
<if test="'latest'.toString() == column.value">
#{item.latest,jdbcType=BIT}
</if>
<if test="'version_id'.toString() == column.value">
#{item.versionId,jdbcType=VARCHAR}
</if>
<if test="'ref_id'.toString() == column.value">
#{item.refId,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -4,6 +4,8 @@ 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
@ -13,8 +15,7 @@ public class Bug implements Serializable {
@Size(min = 1, max = 50, message = "{bug.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "业务ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{bug.num.not_blank}", groups = {Created.class})
@Schema(title = "业务ID")
private Integer num;
@Schema(title = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED)
@ -44,13 +45,92 @@ public class Bug implements Serializable {
@Schema(title = "缺陷来源记录创建该缺陷的测试计划的ID")
private String sourceId;
@Schema(title = "第三方平台状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.platform_status.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{bug.platform_status.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "第三方平台状态")
private String platformStatus;
@Schema(title = "第三方平台缺陷ID")
private String platformId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
num("num", "num", "INTEGER", false),
title("title", "title", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
platform("platform", "platform", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
sourceId("source_id", "sourceId", "VARCHAR", false),
platformStatus("platform_status", "platformStatus", "VARCHAR", false),
platformId("platform_id", "platformId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

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

View File

@ -303,4 +303,63 @@
platform_id = #{platformId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into bug
(id, num, title, create_time, update_time, platform, project_id, create_user, source_id,
platform_status, platform_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.title,jdbcType=VARCHAR},
#{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.platform,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.sourceId,jdbcType=VARCHAR},
#{item.platformStatus,jdbcType=VARCHAR}, #{item.platformId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into bug (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'num'.toString() == column.value">
#{item.num,jdbcType=INTEGER}
</if>
<if test="'title'.toString() == column.value">
#{item.title,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'platform'.toString() == column.value">
#{item.platform,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'source_id'.toString() == column.value">
#{item.sourceId,jdbcType=VARCHAR}
</if>
<if test="'platform_status'.toString() == column.value">
#{item.platformStatus,jdbcType=VARCHAR}
</if>
<if test="'platform_id'.toString() == column.value">
#{item.platformId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -4,6 +4,8 @@ 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
@ -18,9 +20,7 @@ public class CaseReview implements Serializable {
@Size(min = 1, max = 200, message = "{case_review.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(title = "评审状态:未开始/进行中/已完成/已结束/已归档", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{case_review.status.not_blank}", groups = {Created.class})
@Size(min = 1, max = 64, message = "{case_review.status.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "评审状态:未开始/进行中/已完成/已结束/已归档")
private String status;
@Schema(title = "创建时间")
@ -44,13 +44,92 @@ public class CaseReview implements Serializable {
@Schema(title = "创建人")
private String createUser;
@Schema(title = "评审规则:单人通过/全部通过", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{case_review.review_pass_rule.not_blank}", groups = {Created.class})
@Size(min = 1, max = 64, message = "{case_review.review_pass_rule.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "评审规则:单人通过/全部通过")
private String reviewPassRule;
@Schema(title = "描述")
private String description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
status("status", "status", "VARCHAR", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
endTime("end_time", "endTime", "BIGINT", false),
projectId("project_id", "projectId", "VARCHAR", false),
tags("tags", "tags", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
reviewPassRule("review_pass_rule", "reviewPassRule", "VARCHAR", false),
description("description", "description", "LONGVARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

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

View File

@ -355,4 +355,64 @@
review_pass_rule = #{reviewPassRule,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into case_review
(id, `name`, `status`, create_time, update_time, end_time, project_id, tags, create_user,
review_pass_rule, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR},
#{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT},
#{item.projectId,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
#{item.reviewPassRule,jdbcType=VARCHAR}, #{item.description,jdbcType=LONGVARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into case_review (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'end_time'.toString() == column.value">
#{item.endTime,jdbcType=BIGINT}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'tags'.toString() == column.value">
#{item.tags,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'review_pass_rule'.toString() == column.value">
#{item.reviewPassRule,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -4,6 +4,8 @@ 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
@ -21,8 +23,7 @@ public class ApiTemplate implements Serializable {
@Schema(title = "描述")
private String description;
@Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{api_template.internal.not_blank}", groups = {Created.class})
@Schema(title = "是否是内置模板")
private Boolean internal;
@Schema(title = "创建时间")
@ -37,4 +38,81 @@ public class ApiTemplate implements Serializable {
private String projectId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
internal("internal", "internal", "BIT", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -21,8 +23,7 @@ public class BugTemplate implements Serializable {
@Schema(title = "描述")
private String description;
@Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{bug_template.internal.not_blank}", groups = {Created.class})
@Schema(title = "是否是内置模板")
private Boolean internal;
@Schema(title = "创建时间")
@ -37,4 +38,81 @@ public class BugTemplate implements Serializable {
private String projectId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
internal("internal", "internal", "BIT", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -20,4 +22,77 @@ public class BugTemplateExtend implements Serializable {
private String content;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
title("title", "title", "VARCHAR", false),
content("content", "content", "LONGVARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -49,12 +51,94 @@ public class CustomField implements Serializable {
@Schema(title = "项目ID")
private String projectId;
@Schema(title = "是否关联第三方", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{custom_field.third_part.not_blank}", groups = {Created.class})
@Schema(title = "是否关联第三方")
private Boolean thirdPart;
@Schema(title = "自定义字段选项")
private String options;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
scene("scene", "scene", "VARCHAR", false),
type("type", "type", "VARCHAR", true),
remark("remark", "remark", "VARCHAR", false),
system("system", "system", "BIT", true),
global("global", "global", "BIT", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
thirdPart("third_part", "thirdPart", "BIT", false),
options("options", "options", "LONGVARCHAR", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -44,4 +46,83 @@ public class CustomFieldTemplate implements Serializable {
private byte[] defaultValue;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
fieldId("field_id", "fieldId", "VARCHAR", false),
templateId("template_id", "templateId", "VARCHAR", false),
scene("scene", "scene", "VARCHAR", false),
required("required", "required", "BIT", false),
pos("pos", "pos", "INTEGER", false),
customData("custom_data", "customData", "VARCHAR", false),
key("key", "key", "VARCHAR", true),
defaultValue("default_value", "defaultValue", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -25,4 +27,78 @@ public class CustomFunction implements Serializable {
private String description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
tags("tags", "tags", "VARCHAR", false),
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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -23,4 +25,78 @@ public class CustomFunctionBlob implements Serializable {
private byte[] result;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
params("params", "params", "LONGVARBINARY", false),
script("script", "script", "LONGVARBINARY", false),
result("result", "result", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -44,4 +46,83 @@ public class FakeError implements Serializable {
private Boolean status;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
errorCode("error_code", "errorCode", "VARCHAR", false),
matchType("match_type", "matchType", "VARCHAR", false),
status("status", "status", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -20,4 +22,77 @@ public class FakeErrorBlob implements Serializable {
private byte[] description;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
content("content", "content", "LONGVARBINARY", false),
description("description", "description", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -36,9 +38,7 @@ public class FileMetadata implements Serializable {
@Size(min = 1, max = 50, message = "{file_metadata.project_id.length_range}", groups = {Created.class, Updated.class})
private String projectId;
@Schema(title = "文件存储方式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{file_metadata.storage.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{file_metadata.storage.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "文件存储方式")
private String storage;
@Schema(title = "创建人")
@ -65,8 +65,7 @@ public class FileMetadata implements Serializable {
@Schema(title = "资源作用范围主要兼容2.1版本前的历史数据,后续版本不再产生数据")
private String resourceType;
@Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{file_metadata.latest.not_blank}", groups = {Created.class})
@Schema(title = "是否是最新版")
private Boolean latest;
@Schema(title = "同版本数据关联的ID", requiredMode = Schema.RequiredMode.REQUIRED)
@ -75,4 +74,92 @@ public class FileMetadata implements Serializable {
private String refId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
type("type", "type", "VARCHAR", true),
size("size", "size", "BIGINT", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
projectId("project_id", "projectId", "VARCHAR", false),
storage("storage", "storage", "VARCHAR", true),
createUser("create_user", "createUser", "VARCHAR", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
tags("tags", "tags", "VARCHAR", false),
description("description", "description", "VARCHAR", false),
moduleId("module_id", "moduleId", "VARCHAR", false),
loadJar("load_jar", "loadJar", "BIT", false),
path("path", "path", "VARCHAR", true),
resourceType("resource_type", "resourceType", "VARCHAR", false),
latest("latest", "latest", "BIT", false),
refId("ref_id", "refId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -17,4 +19,76 @@ public class FileMetadataBlob implements Serializable {
private byte[] gitInfo;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
gitInfo("git_info", "gitInfo", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -45,4 +47,84 @@ public class FileModule implements Serializable {
private String moduleType;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
parentId("parent_id", "parentId", "VARCHAR", false),
level("level", "level", "INTEGER", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
pos("pos", "pos", "DOUBLE", false),
createUser("create_user", "createUser", "VARCHAR", false),
moduleType("module_type", "moduleType", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -26,4 +28,79 @@ public class FileModuleBlob implements Serializable {
private byte[] repositoryDesc;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
repositoryPath("repository_path", "repositoryPath", "VARCHAR", false),
repositoryUserName("repository_user_name", "repositoryUserName", "VARCHAR", false),
repositoryToken("repository_token", "repositoryToken", "VARCHAR", false),
repositoryDesc("repository_desc", "repositoryDesc", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -21,8 +23,7 @@ public class FunctionalCaseTemplate implements Serializable {
@Schema(title = "描述")
private String description;
@Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{functional_case_template.internal.not_blank}", groups = {Created.class})
@Schema(title = "是否是内置模板")
private Boolean internal;
@Schema(title = "创建时间")
@ -37,4 +38,81 @@ public class FunctionalCaseTemplate implements Serializable {
private String projectId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
internal("internal", "internal", "BIT", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -16,9 +18,7 @@ public class FunctionalCaseTemplateExtend implements Serializable {
@Schema(title = "用例名称模板")
private String caseName;
@Schema(title = "编辑模式模板:步骤模式/文本模式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_template_extend.step_model.not_blank}", groups = {Created.class})
@Size(min = 1, max = 64, message = "{functional_case_template_extend.step_model.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "编辑模式模板:步骤模式/文本模式")
private String stepModel;
@Schema(title = "前置条件模板")
@ -37,4 +37,82 @@ public class FunctionalCaseTemplateExtend implements Serializable {
private String steps;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
caseName("case_name", "caseName", "VARCHAR", false),
stepModel("step_model", "stepModel", "VARCHAR", false),
prerequisite("prerequisite", "prerequisite", "LONGVARCHAR", false),
stepDescription("step_description", "stepDescription", "LONGVARCHAR", false),
expectedResult("expected_result", "expectedResult", "LONGVARCHAR", false),
actualResult("actual_result", "actualResult", "LONGVARCHAR", false),
steps("steps", "steps", "LONGVARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -44,8 +46,7 @@ public class Project implements Serializable {
@Schema(title = "删除时间")
private Long deleteTime;
@Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{project.deleted.not_blank}", groups = {Created.class})
@Schema(title = "是否删除")
private Boolean deleted;
@Schema(title = "删除人")
@ -55,4 +56,87 @@ public class Project implements Serializable {
private Boolean enable;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
num("num", "num", "BIGINT", false),
organizationId("organization_id", "organizationId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
deleteTime("delete_time", "deleteTime", "BIGINT", false),
deleted("deleted", "deleted", "BIT", false),
deleteUser("delete_user", "deleteUser", "VARCHAR", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -22,4 +24,77 @@ public class ProjectApplication implements Serializable {
private String typeValue;
private static final long serialVersionUID = 1L;
public enum Column {
projectId("project_id", "projectId", "VARCHAR", false),
type("type", "type", "VARCHAR", true),
typeValue("type_value", "typeValue", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -31,9 +33,7 @@ public class ProjectExtend implements Serializable {
@Schema(title = "azure 过滤需求的 parent workItem ID")
private String azureFilterId;
@Schema(title = "项目使用哪个平台的模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{project_extend.platform.not_blank}", groups = {Created.class})
@Size(min = 1, max = 20, message = "{project_extend.platform.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "项目使用哪个平台的模板")
private String platform;
@Schema(title = "是否使用第三方平台缺陷模板")
@ -49,4 +49,86 @@ public class ProjectExtend implements Serializable {
private String apiTemplateId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
tapdId("tapd_id", "tapdId", "VARCHAR", false),
jiraKey("jira_key", "jiraKey", "VARCHAR", false),
zentaoId("zentao_id", "zentaoId", "VARCHAR", false),
azureDevopsId("azure_devops_id", "azureDevopsId", "VARCHAR", false),
caseTemplateId("case_template_id", "caseTemplateId", "VARCHAR", false),
azureFilterId("azure_filter_id", "azureFilterId", "VARCHAR", false),
platform("platform", "platform", "VARCHAR", false),
thirdPartTemplate("third_part_template", "thirdPartTemplate", "BIT", false),
versionEnable("version_enable", "versionEnable", "BIT", false),
issueConfig("issue_config", "issueConfig", "VARCHAR", false),
apiTemplateId("api_template_id", "apiTemplateId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -49,4 +51,85 @@ public class ProjectVersion implements Serializable {
private String createUser;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
projectId("project_id", "projectId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
status("status", "status", "VARCHAR", true),
latest("latest", "latest", "BIT", false),
publishTime("publish_time", "publishTime", "BIGINT", false),
startTime("start_time", "startTime", "BIGINT", false),
endTime("end_time", "endTime", "BIGINT", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

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

View File

@ -240,4 +240,49 @@
project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into api_template
(id, `name`, description, internal, create_time, create_user, project_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},
#{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into api_template (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'internal'.toString() == column.value">
#{item.internal,jdbcType=BIT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -214,4 +214,36 @@
set title = #{title,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into bug_template_extend
(id, title, content)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into bug_template_extend (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'title'.toString() == column.value">
#{item.title,jdbcType=VARCHAR}
</if>
<if test="'content'.toString() == column.value">
#{item.content,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -240,4 +240,49 @@
project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into bug_template
(id, `name`, description, internal, create_time, create_user, project_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},
#{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into bug_template (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'internal'.toString() == column.value">
#{item.internal,jdbcType=BIT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -391,4 +391,70 @@
third_part = #{thirdPart,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into custom_field
(id, `name`, scene, `type`, remark, `system`, `global`, create_time, update_time,
create_user, project_id, third_part, `options`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.scene,jdbcType=VARCHAR},
#{item.type,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.system,jdbcType=BIT},
#{item.global,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT},
#{item.createUser,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.thirdPart,jdbcType=BIT},
#{item.options,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into custom_field (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'scene'.toString() == column.value">
#{item.scene,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'remark'.toString() == column.value">
#{item.remark,jdbcType=VARCHAR}
</if>
<if test="'system'.toString() == column.value">
#{item.system,jdbcType=BIT}
</if>
<if test="'global'.toString() == column.value">
#{item.global,jdbcType=BIT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'third_part'.toString() == column.value">
#{item.thirdPart,jdbcType=BIT}
</if>
<if test="'options'.toString() == column.value">
#{item.options,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -318,4 +318,57 @@
`key` = #{key,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into custom_field_template
(id, field_id, template_id, scene, required, pos, custom_data, `key`, default_value
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.fieldId,jdbcType=VARCHAR}, #{item.templateId,jdbcType=VARCHAR},
#{item.scene,jdbcType=VARCHAR}, #{item.required,jdbcType=BIT}, #{item.pos,jdbcType=INTEGER},
#{item.customData,jdbcType=VARCHAR}, #{item.key,jdbcType=VARCHAR}, #{item.defaultValue,jdbcType=LONGVARBINARY}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into custom_field_template (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'field_id'.toString() == column.value">
#{item.fieldId,jdbcType=VARCHAR}
</if>
<if test="'template_id'.toString() == column.value">
#{item.templateId,jdbcType=VARCHAR}
</if>
<if test="'scene'.toString() == column.value">
#{item.scene,jdbcType=VARCHAR}
</if>
<if test="'required'.toString() == column.value">
#{item.required,jdbcType=BIT}
</if>
<if test="'pos'.toString() == column.value">
#{item.pos,jdbcType=INTEGER}
</if>
<if test="'custom_data'.toString() == column.value">
#{item.customData,jdbcType=VARCHAR}
</if>
<if test="'key'.toString() == column.value">
#{item.key,jdbcType=VARCHAR}
</if>
<if test="'default_value'.toString() == column.value">
#{item.defaultValue,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -223,4 +223,39 @@
`result` = #{result,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into custom_function_blob
(id, params, script, `result`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.params,jdbcType=LONGVARBINARY}, #{item.script,jdbcType=LONGVARBINARY},
#{item.result,jdbcType=LONGVARBINARY})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into custom_function_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'params'.toString() == column.value">
#{item.params,jdbcType=LONGVARBINARY}
</if>
<if test="'script'.toString() == column.value">
#{item.script,jdbcType=LONGVARBINARY}
</if>
<if test="'result'.toString() == column.value">
#{item.result,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -193,4 +193,39 @@
description = #{description,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into custom_function
(id, `name`, tags, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR},
#{item.description,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into custom_function (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'tags'.toString() == column.value">
#{item.tags,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -208,4 +208,36 @@
description = #{description,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into fake_error_blob
(id, content, description)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARBINARY}, #{item.description,jdbcType=LONGVARBINARY}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into fake_error_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'content'.toString() == column.value">
#{item.content,jdbcType=LONGVARBINARY}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -273,4 +273,57 @@
`status` = #{status,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into fake_error
(id, project_id, create_time, update_time, create_user, update_user, error_code,
match_type, `status`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
#{item.updateTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR},
#{item.errorCode,jdbcType=VARCHAR}, #{item.matchType,jdbcType=VARCHAR}, #{item.status,jdbcType=BIT}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into fake_error (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'error_code'.toString() == column.value">
#{item.errorCode,jdbcType=VARCHAR}
</if>
<if test="'match_type'.toString() == column.value">
#{item.matchType,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=BIT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -191,4 +191,32 @@
set git_info = #{gitInfo,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into file_metadata_blob
(id, git_info)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.gitInfo,jdbcType=LONGVARBINARY})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into file_metadata_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'git_info'.toString() == column.value">
#{item.gitInfo,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -415,4 +415,88 @@
ref_id = #{refId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into file_metadata
(id, `name`, `type`, `size`, create_time, update_time, project_id, `storage`, create_user,
update_user, tags, description, module_id, load_jar, `path`, resource_type, latest,
ref_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.size,jdbcType=BIGINT}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT},
#{item.projectId,jdbcType=VARCHAR}, #{item.storage,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
#{item.updateUser,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},
#{item.moduleId,jdbcType=VARCHAR}, #{item.loadJar,jdbcType=BIT}, #{item.path,jdbcType=VARCHAR},
#{item.resourceType,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, #{item.refId,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into file_metadata (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'size'.toString() == column.value">
#{item.size,jdbcType=BIGINT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'storage'.toString() == column.value">
#{item.storage,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'tags'.toString() == column.value">
#{item.tags,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'module_id'.toString() == column.value">
#{item.moduleId,jdbcType=VARCHAR}
</if>
<if test="'load_jar'.toString() == column.value">
#{item.loadJar,jdbcType=BIT}
</if>
<if test="'path'.toString() == column.value">
#{item.path,jdbcType=VARCHAR}
</if>
<if test="'resource_type'.toString() == column.value">
#{item.resourceType,jdbcType=VARCHAR}
</if>
<if test="'latest'.toString() == column.value">
#{item.latest,jdbcType=BIT}
</if>
<if test="'ref_id'.toString() == column.value">
#{item.refId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -248,4 +248,43 @@
repository_token = #{repositoryToken,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into file_module_blob
(id, repository_path, repository_user_name, repository_token, repository_desc)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.repositoryPath,jdbcType=VARCHAR}, #{item.repositoryUserName,jdbcType=VARCHAR},
#{item.repositoryToken,jdbcType=VARCHAR}, #{item.repositoryDesc,jdbcType=LONGVARBINARY}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into file_module_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'repository_path'.toString() == column.value">
#{item.repositoryPath,jdbcType=VARCHAR}
</if>
<if test="'repository_user_name'.toString() == column.value">
#{item.repositoryUserName,jdbcType=VARCHAR}
</if>
<if test="'repository_token'.toString() == column.value">
#{item.repositoryToken,jdbcType=VARCHAR}
</if>
<if test="'repository_desc'.toString() == column.value">
#{item.repositoryDesc,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

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

View File

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

View File

@ -295,4 +295,54 @@
step_model = #{stepModel,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_template_extend
(id, case_name, step_model, prerequisite, step_description, expected_result, actual_result,
steps)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.caseName,jdbcType=VARCHAR}, #{item.stepModel,jdbcType=VARCHAR},
#{item.prerequisite,jdbcType=LONGVARCHAR}, #{item.stepDescription,jdbcType=LONGVARCHAR},
#{item.expectedResult,jdbcType=LONGVARCHAR}, #{item.actualResult,jdbcType=LONGVARCHAR},
#{item.steps,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_template_extend (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'case_name'.toString() == column.value">
#{item.caseName,jdbcType=VARCHAR}
</if>
<if test="'step_model'.toString() == column.value">
#{item.stepModel,jdbcType=VARCHAR}
</if>
<if test="'prerequisite'.toString() == column.value">
#{item.prerequisite,jdbcType=LONGVARCHAR}
</if>
<if test="'step_description'.toString() == column.value">
#{item.stepDescription,jdbcType=LONGVARCHAR}
</if>
<if test="'expected_result'.toString() == column.value">
#{item.expectedResult,jdbcType=LONGVARCHAR}
</if>
<if test="'actual_result'.toString() == column.value">
#{item.actualResult,jdbcType=LONGVARCHAR}
</if>
<if test="'steps'.toString() == column.value">
#{item.steps,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -240,4 +240,49 @@
project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into functional_case_template
(id, `name`, description, internal, create_time, create_user, project_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},
#{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into functional_case_template (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'internal'.toString() == column.value">
#{item.internal,jdbcType=BIT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -178,4 +178,36 @@
where project_id = #{projectId,jdbcType=VARCHAR}
and `type` = #{type,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into project_application
(project_id, `type`, type_value)
values
<foreach collection="list" item="item" separator=",">
(#{item.projectId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.typeValue,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into project_application (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'type_value'.toString() == column.value">
#{item.typeValue,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -320,4 +320,67 @@
api_template_id = #{apiTemplateId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into project_extend
(id, tapd_id, jira_key, zentao_id, azure_devops_id, case_template_id, azure_filter_id,
platform, third_part_template, version_enable, issue_config, api_template_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.tapdId,jdbcType=VARCHAR}, #{item.jiraKey,jdbcType=VARCHAR},
#{item.zentaoId,jdbcType=VARCHAR}, #{item.azureDevopsId,jdbcType=VARCHAR}, #{item.caseTemplateId,jdbcType=VARCHAR},
#{item.azureFilterId,jdbcType=VARCHAR}, #{item.platform,jdbcType=VARCHAR}, #{item.thirdPartTemplate,jdbcType=BIT},
#{item.versionEnable,jdbcType=BIT}, #{item.issueConfig,jdbcType=VARCHAR}, #{item.apiTemplateId,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into project_extend (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'tapd_id'.toString() == column.value">
#{item.tapdId,jdbcType=VARCHAR}
</if>
<if test="'jira_key'.toString() == column.value">
#{item.jiraKey,jdbcType=VARCHAR}
</if>
<if test="'zentao_id'.toString() == column.value">
#{item.zentaoId,jdbcType=VARCHAR}
</if>
<if test="'azure_devops_id'.toString() == column.value">
#{item.azureDevopsId,jdbcType=VARCHAR}
</if>
<if test="'case_template_id'.toString() == column.value">
#{item.caseTemplateId,jdbcType=VARCHAR}
</if>
<if test="'azure_filter_id'.toString() == column.value">
#{item.azureFilterId,jdbcType=VARCHAR}
</if>
<if test="'platform'.toString() == column.value">
#{item.platform,jdbcType=VARCHAR}
</if>
<if test="'third_part_template'.toString() == column.value">
#{item.thirdPartTemplate,jdbcType=BIT}
</if>
<if test="'version_enable'.toString() == column.value">
#{item.versionEnable,jdbcType=BIT}
</if>
<if test="'issue_config'.toString() == column.value">
#{item.issueConfig,jdbcType=VARCHAR}
</if>
<if test="'api_template_id'.toString() == column.value">
#{item.apiTemplateId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -335,4 +335,70 @@
`enable` = #{enable,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into project
(id, num, organization_id, `name`, description, create_time, update_time, update_user,
create_user, delete_time, deleted, delete_user, `enable`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.organizationId,jdbcType=VARCHAR},
#{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
#{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
#{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.deleteUser,jdbcType=VARCHAR},
#{item.enable,jdbcType=BIT})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into project (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'num'.toString() == column.value">
#{item.num,jdbcType=BIGINT}
</if>
<if test="'organization_id'.toString() == column.value">
#{item.organizationId,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
<if test="'delete_time'.toString() == column.value">
#{item.deleteTime,jdbcType=BIGINT}
</if>
<if test="'deleted'.toString() == column.value">
#{item.deleted,jdbcType=BIT}
</if>
<if test="'delete_user'.toString() == column.value">
#{item.deleteUser,jdbcType=VARCHAR}
</if>
<if test="'enable'.toString() == column.value">
#{item.enable,jdbcType=BIT}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -303,4 +303,63 @@
create_user = #{createUser,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into project_version
(id, project_id, `name`, description, `status`, latest, publish_time, start_time,
end_time, create_time, create_user)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
#{item.description,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT},
#{item.publishTime,jdbcType=BIGINT}, #{item.startTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT},
#{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into project_version (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'latest'.toString() == column.value">
#{item.latest,jdbcType=BIT}
</if>
<if test="'publish_time'.toString() == column.value">
#{item.publishTime,jdbcType=BIGINT}
</if>
<if test="'start_time'.toString() == column.value">
#{item.startTime,jdbcType=BIGINT}
</if>
<if test="'end_time'.toString() == column.value">
#{item.endTime,jdbcType=BIGINT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'create_user'.toString() == column.value">
#{item.createUser,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

@ -4,6 +4,8 @@ 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
@ -13,8 +15,7 @@ public class AuthSource implements Serializable {
@Size(min = 1, max = 50, message = "{auth_source.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{auth_source.enable.not_blank}", groups = {Created.class})
@Schema(title = "是否启用")
private Boolean enable;
@Schema(title = "创建时间")
@ -37,4 +38,82 @@ public class AuthSource implements Serializable {
private byte[] configuration;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
enable("enable", "enable", "BIT", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
description("description", "description", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
type("type", "type", "VARCHAR", true),
configuration("configuration", "configuration", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -23,4 +25,78 @@ public class License implements Serializable {
private String licenseCode;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
licenseCode("license_code", "licenseCode", "LONGVARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -36,9 +38,7 @@ public class MessageTask implements Serializable {
@Schema(title = "webhook地址")
private String webhook;
@Schema(title = "具体测试的ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{message_task.test_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{message_task.test_id.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "具体测试的ID")
private String testId;
@Schema(title = "创建时间")
@ -50,4 +50,83 @@ public class MessageTask implements Serializable {
private String projectId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
type("type", "type", "VARCHAR", true),
event("event", "event", "VARCHAR", false),
receiver("receiver", "receiver", "VARCHAR", false),
taskType("task_type", "taskType", "VARCHAR", false),
webhook("webhook", "webhook", "VARCHAR", false),
testId("test_id", "testId", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -17,4 +19,76 @@ public class MessageTaskBlob implements Serializable {
private String template;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
template("template", "template", "LONGVARCHAR", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -61,4 +63,85 @@ public class Notification implements Serializable {
private String resourceName;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "BIGINT", false),
type("type", "type", "VARCHAR", true),
receiver("receiver", "receiver", "VARCHAR", false),
title("title", "title", "VARCHAR", false),
status("status", "status", "VARCHAR", true),
createTime("create_time", "createTime", "BIGINT", false),
operator("operator", "operator", "VARCHAR", true),
operation("operation", "operation", "VARCHAR", true),
resourceId("resource_id", "resourceId", "VARCHAR", false),
resourceType("resource_type", "resourceType", "VARCHAR", false),
resourceName("resource_name", "resourceName", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -16,12 +18,10 @@ public class NoviceStatistics implements Serializable {
@Schema(title = "用户id")
private String userId;
@Schema(title = "新手引导完成的步骤", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{novice_statistics.guide_step.not_blank}", groups = {Created.class})
@Schema(title = "新手引导完成的步骤")
private Boolean guideStep;
@Schema(title = "新手引导的次数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{novice_statistics.guide_num.not_blank}", groups = {Created.class})
@Schema(title = "新手引导的次数")
private Integer guideNum;
@Schema(title = "")
@ -34,4 +34,81 @@ public class NoviceStatistics implements Serializable {
private byte[] dataOption;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
userId("user_id", "userId", "VARCHAR", false),
guideStep("guide_step", "guideStep", "BIT", false),
guideNum("guide_num", "guideNum", "INTEGER", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
dataOption("data_option", "dataOption", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -49,4 +51,86 @@ public class Organization implements Serializable {
private Boolean enable;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
num("num", "num", "BIGINT", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
deleted("deleted", "deleted", "BIT", false),
deleteUser("delete_user", "deleteUser", "VARCHAR", false),
deleteTime("delete_time", "deleteTime", "BIGINT", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -55,4 +57,86 @@ public class Plugin implements Serializable {
private String scenario;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
pluginId("plugin_id", "pluginId", "VARCHAR", false),
fileName("file_name", "fileName", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
enable("enable", "enable", "BIT", true),
global("global", "global", "BIT", true),
xpack("xpack", "xpack", "BIT", false),
description("description", "description", "VARCHAR", false),
scenario("scenario", "scenario", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -22,4 +24,77 @@ public class PluginFrontScript implements Serializable {
private String script;
private static final long serialVersionUID = 1L;
public enum Column {
pluginId("plugin_id", "pluginId", "VARCHAR", false),
scriptId("script_id", "scriptId", "VARCHAR", false),
script("script", "script", "LONGVARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -19,4 +21,76 @@ public class PluginOrganization implements Serializable {
private String organizationId;
private static final long serialVersionUID = 1L;
public enum Column {
pluginId("plugin_id", "pluginId", "VARCHAR", false),
organizationId("organization_id", "organizationId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -56,4 +58,87 @@ public class Schedule implements Serializable {
private String config;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
key("key", "key", "VARCHAR", true),
type("type", "type", "VARCHAR", true),
value("value", "value", "VARCHAR", true),
job("job", "job", "VARCHAR", false),
enable("enable", "enable", "BIT", true),
resourceId("resource_id", "resourceId", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
projectId("project_id", "projectId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
config("config", "config", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -26,4 +28,78 @@ public class ServiceIntegration implements Serializable {
private byte[] configuration;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
platform("platform", "platform", "VARCHAR", false),
organizationId("organization_id", "organizationId", "VARCHAR", false),
configuration("configuration", "configuration", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -16,10 +18,81 @@ public class SystemParameter implements Serializable {
@Schema(title = "参数值")
private String paramValue;
@Schema(title = "类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{system_parameter.type.not_blank}", groups = {Created.class})
@Size(min = 1, max = 100, message = "{system_parameter.type.length_range}", groups = {Created.class, Updated.class})
@Schema(title = "类型")
private String type;
private static final long serialVersionUID = 1L;
public enum Column {
paramKey("param_key", "paramKey", "VARCHAR", false),
paramValue("param_value", "paramValue", "VARCHAR", false),
type("type", "type", "VARCHAR", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -18,7 +20,7 @@ public class TestResourcePool implements Serializable {
@Size(min = 1, max = 255, message = "{test_resource_pool.name.length_range}", groups = {Created.class, Updated.class})
private String name;
@Schema(title = "类型(node/k8s)", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(title = "类型", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{test_resource_pool.type.not_blank}", groups = {Created.class})
@Size(min = 1, max = 30, message = "{test_resource_pool.type.length_range}", groups = {Created.class, Updated.class})
private String type;
@ -50,13 +52,95 @@ public class TestResourcePool implements Serializable {
@Schema(title = "ms部署地址")
private String serverUrl;
@Schema(title = "资源池应用类型(组织/全部)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_resource_pool.all_org.not_blank}", groups = {Created.class})
@Schema(title = "资源池应用类型(组织/全部)")
private Boolean allOrg;
@Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{test_resource_pool.deleted.not_blank}", groups = {Created.class})
@Schema(title = "是否删除")
private Boolean deleted;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
type("type", "type", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
enable("enable", "enable", "BIT", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
apiTest("api_test", "apiTest", "BIT", false),
loadTest("load_test", "loadTest", "BIT", false),
uiTest("ui_test", "uiTest", "BIT", false),
serverUrl("server_url", "serverUrl", "VARCHAR", false),
allOrg("all_org", "allOrg", "BIT", false),
deleted("deleted", "deleted", "BIT", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -1,20 +1,18 @@
package io.metersphere.system.domain;
import io.metersphere.validation.groups.Created;
import io.metersphere.validation.groups.Updated;
import io.metersphere.validation.groups.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
@Data
public class User implements Serializable {
@Schema(title = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{user.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{user.id.length_range}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{user.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "用户名", requiredMode = Schema.RequiredMode.REQUIRED)
@ -62,9 +60,93 @@ public class User implements Serializable {
@Schema(title = "修改人")
private String updateUser;
@Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{user.deleted.not_blank}", groups = {Created.class})
@Schema(title = "是否删除")
private Boolean deleted;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
email("email", "email", "VARCHAR", false),
password("password", "password", "VARCHAR", true),
enable("enable", "enable", "BIT", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
language("language", "language", "VARCHAR", true),
lastOrganizationId("last_organization_id", "lastOrganizationId", "VARCHAR", false),
phone("phone", "phone", "VARCHAR", false),
source("source", "source", "VARCHAR", true),
lastProjectId("last_project_id", "lastProjectId", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
deleted("deleted", "deleted", "BIT", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -20,4 +22,77 @@ public class UserExtend implements Serializable {
private byte[] platformInfo;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
seleniumServer("selenium_server", "seleniumServer", "VARCHAR", false),
platformInfo("platform_info", "platformInfo", "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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -33,4 +35,80 @@ public class UserKey implements Serializable {
private Boolean enable;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false),
accessKey("access_key", "accessKey", "VARCHAR", false),
secretKey("secret_key", "secretKey", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", 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<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -45,4 +47,83 @@ public class UserRole implements Serializable {
private String scopeId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
description("description", "description", "VARCHAR", false),
internal("internal", "internal", "BIT", false),
type("type", "type", "VARCHAR", true),
createTime("create_time", "createTime", "BIGINT", false),
updateTime("update_time", "updateTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false),
scopeId("scope_id", "scopeId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -4,6 +4,8 @@ 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
@ -24,4 +26,77 @@ public class UserRolePermission implements Serializable {
private String permissionId;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
roleId("role_id", "roleId", "VARCHAR", false),
permissionId("permission_id", "permissionId", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

@ -2,19 +2,13 @@ package io.metersphere.system.domain;
import io.metersphere.validation.groups.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author jianxing
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRoleRelation implements Serializable {
@Schema(title = "用户组关系ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{user_role_relation.id.not_blank}", groups = {Updated.class})
@ -43,4 +37,80 @@ public class UserRoleRelation implements Serializable {
private String createUser;
private static final long serialVersionUID = 1L;
public enum Column {
id("id", "id", "VARCHAR", false),
userId("user_id", "userId", "VARCHAR", false),
roleId("role_id", "roleId", "VARCHAR", false),
sourceId("source_id", "sourceId", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false),
createUser("create_user", "createUser", "VARCHAR", false);
private static final String BEGINNING_DELIMITER = "`";
private static final String ENDING_DELIMITER = "`";
private final String column;
private final boolean isColumnNameDelimited;
private final String javaProperty;
private final String jdbcType;
public String value() {
return this.column;
}
public String getValue() {
return this.column;
}
public String getJavaProperty() {
return this.javaProperty;
}
public String getJdbcType() {
return this.jdbcType;
}
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
public static Column[] all() {
return Column.values();
}
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
public String getAliasedEscapedColumnName() {
return this.getEscapedColumnName();
}
}
}

View File

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

View File

@ -301,4 +301,53 @@
`type` = #{type,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into auth_source
(id, `enable`, create_time, update_time, description, `name`, `type`, configuration
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT},
#{item.updateTime,jdbcType=BIGINT}, #{item.description,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR},
#{item.type,jdbcType=VARCHAR}, #{item.configuration,jdbcType=LONGVARBINARY})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into auth_source (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'enable'.toString() == column.value">
#{item.enable,jdbcType=BIT}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'description'.toString() == column.value">
#{item.description,jdbcType=VARCHAR}
</if>
<if test="'name'.toString() == column.value">
#{item.name,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'configuration'.toString() == column.value">
#{item.configuration,jdbcType=LONGVARBINARY}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -231,4 +231,39 @@
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into license
(id, create_time, update_time, license_code)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT},
#{item.licenseCode,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into license (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT}
</if>
<if test="'license_code'.toString() == column.value">
#{item.licenseCode,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -191,4 +191,32 @@
set `template` = #{template,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into message_task_blob
(id, `template`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.template,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into message_task_blob (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'template'.toString() == column.value">
#{item.template,jdbcType=LONGVARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -272,4 +272,57 @@
project_id = #{projectId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="batchInsert" parameterType="map">
insert into message_task
(id, `type`, event, receiver, task_type, webhook, test_id, create_time, project_id
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.event,jdbcType=VARCHAR},
#{item.receiver,jdbcType=VARCHAR}, #{item.taskType,jdbcType=VARCHAR}, #{item.webhook,jdbcType=VARCHAR},
#{item.testId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into message_task (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=VARCHAR}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'event'.toString() == column.value">
#{item.event,jdbcType=VARCHAR}
</if>
<if test="'receiver'.toString() == column.value">
#{item.receiver,jdbcType=VARCHAR}
</if>
<if test="'task_type'.toString() == column.value">
#{item.taskType,jdbcType=VARCHAR}
</if>
<if test="'webhook'.toString() == column.value">
#{item.webhook,jdbcType=VARCHAR}
</if>
<if test="'test_id'.toString() == column.value">
#{item.testId,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'project_id'.toString() == column.value">
#{item.projectId,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

View File

@ -303,4 +303,63 @@
resource_name = #{resourceName,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<insert id="batchInsert" parameterType="map">
insert into notification
(id, `type`, receiver, title, `status`, create_time, `operator`, `operation`, resource_id,
resource_type, resource_name)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=BIGINT}, #{item.type,jdbcType=VARCHAR}, #{item.receiver,jdbcType=VARCHAR},
#{item.title,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
#{item.operator,jdbcType=VARCHAR}, #{item.operation,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR},
#{item.resourceType,jdbcType=VARCHAR}, #{item.resourceName,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
insert into notification (
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
)
values
<foreach collection="list" item="item" separator=",">
(
<foreach collection="selective" item="column" separator=",">
<if test="'id'.toString() == column.value">
#{item.id,jdbcType=BIGINT}
</if>
<if test="'type'.toString() == column.value">
#{item.type,jdbcType=VARCHAR}
</if>
<if test="'receiver'.toString() == column.value">
#{item.receiver,jdbcType=VARCHAR}
</if>
<if test="'title'.toString() == column.value">
#{item.title,jdbcType=VARCHAR}
</if>
<if test="'status'.toString() == column.value">
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT}
</if>
<if test="'operator'.toString() == column.value">
#{item.operator,jdbcType=VARCHAR}
</if>
<if test="'operation'.toString() == column.value">
#{item.operation,jdbcType=VARCHAR}
</if>
<if test="'resource_id'.toString() == column.value">
#{item.resourceId,jdbcType=VARCHAR}
</if>
<if test="'resource_type'.toString() == column.value">
#{item.resourceType,jdbcType=VARCHAR}
</if>
<if test="'resource_name'.toString() == column.value">
#{item.resourceName,jdbcType=VARCHAR}
</if>
</foreach>
)
</foreach>
</insert>
</mapper>

View File

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

Some files were not shown because too many files have changed in this diff Show More