refactor(项目设置): add bug domain && ddl

This commit is contained in:
song-cc-rock 2023-10-20 10:29:02 +08:00 committed by 刘瑞斌
parent 45e7e45064
commit 453522432b
8 changed files with 134 additions and 32 deletions

View File

@ -14,64 +14,67 @@ import java.util.Arrays;
@Data @Data
public class Bug implements Serializable { public class Bug implements Serializable {
@Schema(title = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.id.not_blank}", groups = {Updated.class}) @NotBlank(message = "{bug.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 50, message = "{bug.id.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{bug.id.length_range}", groups = {Created.class, Updated.class})
private String id; private String id;
@Schema(title = "业务ID") @Schema(description = "业务ID")
private Integer num; private Integer num;
@Schema(title = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.title.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.title.not_blank}", groups = {Created.class})
@Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class})
private String title; private String title;
@Schema(title = "指派人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "指派人", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.assign_user.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.assign_user.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{bug.assign_user.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{bug.assign_user.length_range}", groups = {Created.class, Updated.class})
private String assignUser; private String assignUser;
@Schema(title = "创建人") @Schema(description = "创建人")
private String createUser; private String createUser;
@Schema(title = "创建时间") @Schema(description = "创建时间")
private Long createTime; private Long createTime;
@Schema(title = "更新时间") @Schema(description = "更新人")
private String updateUser;
@Schema(description = "更新时间")
private Long updateTime; private Long updateTime;
@Schema(title = "删除人") @Schema(description = "删除人")
private String deleteUser; private String deleteUser;
@Schema(title = "删除时间") @Schema(description = "删除时间")
private Long deleteTime; private Long deleteTime;
@Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.project_id.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.project_id.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{bug.project_id.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{bug.project_id.length_range}", groups = {Created.class, Updated.class})
private String projectId; private String projectId;
@Schema(title = "模板ID") @Schema(description = "模板ID")
private String templateId; private String templateId;
@Schema(title = "缺陷平台", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "缺陷平台", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.platform.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.platform.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{bug.platform.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{bug.platform.length_range}", groups = {Created.class, Updated.class})
private String platform; private String platform;
@Schema(title = "状态", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{bug.status.not_blank}", groups = {Created.class}) @NotBlank(message = "{bug.status.not_blank}", groups = {Created.class})
@Size(min = 1, max = 50, message = "{bug.status.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{bug.status.length_range}", groups = {Created.class, Updated.class})
private String status; private String status;
@Schema(title = "标签") @Schema(description = "标签")
private String tag; private String tag;
@Schema(title = "第三方平台缺陷ID") @Schema(description = "第三方平台缺陷ID")
private String platformBugId; private String platformBugId;
@Schema(title = "是否回收站", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "是否回收站", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{bug.trash.not_blank}", groups = {Created.class}) @NotNull(message = "{bug.trash.not_blank}", groups = {Created.class})
private Boolean trash; private Boolean trash;
@ -84,6 +87,7 @@ public class Bug implements Serializable {
assignUser("assign_user", "assignUser", "VARCHAR", false), assignUser("assign_user", "assignUser", "VARCHAR", false),
createUser("create_user", "createUser", "VARCHAR", false), createUser("create_user", "createUser", "VARCHAR", false),
createTime("create_time", "createTime", "BIGINT", false), createTime("create_time", "createTime", "BIGINT", false),
updateUser("update_user", "updateUser", "VARCHAR", false),
updateTime("update_time", "updateTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false),
deleteUser("delete_user", "deleteUser", "VARCHAR", false), deleteUser("delete_user", "deleteUser", "VARCHAR", false),
deleteTime("delete_time", "deleteTime", "BIGINT", false), deleteTime("delete_time", "deleteTime", "BIGINT", false),

View File

@ -504,6 +504,76 @@ public class BugExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateUserIsNull() {
addCriterion("update_user is null");
return (Criteria) this;
}
public Criteria andUpdateUserIsNotNull() {
addCriterion("update_user is not null");
return (Criteria) this;
}
public Criteria andUpdateUserEqualTo(String value) {
addCriterion("update_user =", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotEqualTo(String value) {
addCriterion("update_user <>", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThan(String value) {
addCriterion("update_user >", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserGreaterThanOrEqualTo(String value) {
addCriterion("update_user >=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThan(String value) {
addCriterion("update_user <", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLessThanOrEqualTo(String value) {
addCriterion("update_user <=", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserLike(String value) {
addCriterion("update_user like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotLike(String value) {
addCriterion("update_user not like", value, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserIn(List<String> values) {
addCriterion("update_user in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotIn(List<String> values) {
addCriterion("update_user not in", values, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserBetween(String value1, String value2) {
addCriterion("update_user between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateUserNotBetween(String value1, String value2) {
addCriterion("update_user not between", value1, value2, "updateUser");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() { public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null"); addCriterion("update_time is null");
return (Criteria) this; return (Criteria) this;

View File

@ -8,6 +8,7 @@
<result column="assign_user" jdbcType="VARCHAR" property="assignUser" /> <result column="assign_user" jdbcType="VARCHAR" property="assignUser" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> <result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="delete_user" jdbcType="VARCHAR" property="deleteUser" /> <result column="delete_user" jdbcType="VARCHAR" property="deleteUser" />
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" /> <result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
@ -78,8 +79,9 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, num, title, assign_user, create_user, create_time, update_time, delete_user, id, num, title, assign_user, create_user, create_time, update_user, update_time,
delete_time, project_id, template_id, platform, `status`, tag, platform_bug_id, trash delete_user, delete_time, project_id, template_id, platform, `status`, tag, platform_bug_id,
trash
</sql> </sql>
<select id="selectByExample" parameterType="io.metersphere.bug.domain.BugExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.bug.domain.BugExample" resultMap="BaseResultMap">
select select
@ -114,16 +116,16 @@
<insert id="insert" parameterType="io.metersphere.bug.domain.Bug"> <insert id="insert" parameterType="io.metersphere.bug.domain.Bug">
insert into bug (id, num, title, insert into bug (id, num, title,
assign_user, create_user, create_time, assign_user, create_user, create_time,
update_time, delete_user, delete_time, update_user, update_time, delete_user,
project_id, template_id, platform, delete_time, project_id, template_id,
`status`, tag, platform_bug_id, platform, `status`, tag,
trash) platform_bug_id, trash)
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
#{assignUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{assignUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{deleteUser,jdbcType=VARCHAR}, #{deleteTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{deleteUser,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{deleteTime,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR}, #{platformBugId,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR},
#{trash,jdbcType=BIT}) #{platformBugId,jdbcType=VARCHAR}, #{trash,jdbcType=BIT})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.bug.domain.Bug"> <insert id="insertSelective" parameterType="io.metersphere.bug.domain.Bug">
insert into bug insert into bug
@ -146,6 +148,9 @@
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="updateUser != null">
update_user,
</if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
@ -196,6 +201,9 @@
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
</if> </if>
@ -255,6 +263,9 @@
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
</if> </if>
@ -298,6 +309,7 @@
assign_user = #{record.assignUser,jdbcType=VARCHAR}, assign_user = #{record.assignUser,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
delete_user = #{record.deleteUser,jdbcType=VARCHAR}, delete_user = #{record.deleteUser,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT}, delete_time = #{record.deleteTime,jdbcType=BIGINT},
@ -330,6 +342,9 @@
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
</if> </if>
@ -370,6 +385,7 @@
assign_user = #{assignUser,jdbcType=VARCHAR}, assign_user = #{assignUser,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
delete_user = #{deleteUser,jdbcType=VARCHAR}, delete_user = #{deleteUser,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT}, delete_time = #{deleteTime,jdbcType=BIGINT},
@ -384,17 +400,17 @@
</update> </update>
<insert id="batchInsert" parameterType="map"> <insert id="batchInsert" parameterType="map">
insert into bug insert into bug
(id, num, title, assign_user, create_user, create_time, update_time, delete_user, (id, num, title, assign_user, create_user, create_time, update_user, update_time,
delete_time, project_id, template_id, platform, `status`, tag, platform_bug_id, delete_user, delete_time, project_id, template_id, platform, `status`, tag, platform_bug_id,
trash) trash)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.title,jdbcType=VARCHAR}, (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.title,jdbcType=VARCHAR},
#{item.assignUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.assignUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT},
#{item.updateTime,jdbcType=BIGINT}, #{item.deleteUser,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=BIGINT}, #{item.deleteUser,jdbcType=VARCHAR},
#{item.projectId,jdbcType=VARCHAR}, #{item.templateId,jdbcType=VARCHAR}, #{item.platform,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR}, #{item.templateId,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR}, #{item.tag,jdbcType=VARCHAR}, #{item.platformBugId,jdbcType=VARCHAR}, #{item.platform,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.tag,jdbcType=VARCHAR},
#{item.trash,jdbcType=BIT}) #{item.platformBugId,jdbcType=VARCHAR}, #{item.trash,jdbcType=BIT})
</foreach> </foreach>
</insert> </insert>
<insert id="batchInsertSelective" parameterType="map"> <insert id="batchInsertSelective" parameterType="map">
@ -425,6 +441,9 @@
<if test="'create_time'.toString() == column.value"> <if test="'create_time'.toString() == column.value">
#{item.createTime,jdbcType=BIGINT} #{item.createTime,jdbcType=BIGINT}
</if> </if>
<if test="'update_user'.toString() == column.value">
#{item.updateUser,jdbcType=VARCHAR}
</if>
<if test="'update_time'.toString() == column.value"> <if test="'update_time'.toString() == column.value">
#{item.updateTime,jdbcType=BIGINT} #{item.updateTime,jdbcType=BIGINT}
</if> </if>

View File

@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS bug(
`assign_user` VARCHAR(50) NOT NULL COMMENT '指派人' , `assign_user` VARCHAR(50) NOT NULL COMMENT '指派人' ,
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' , `create_time` BIGINT NOT NULL COMMENT '创建时间' ,
`update_user` VARCHAR(50) NOT NULL COMMENT '更新人' ,
`update_time` BIGINT NOT NULL COMMENT '更新时间' , `update_time` BIGINT NOT NULL COMMENT '更新时间' ,
`delete_user` VARCHAR(50) NOT NULL COMMENT '删除人' , `delete_user` VARCHAR(50) NOT NULL COMMENT '删除人' ,
`delete_time` BIGINT NOT NULL COMMENT '删除时间' , `delete_time` BIGINT NOT NULL COMMENT '删除时间' ,

View File

@ -7,6 +7,8 @@ bug.assign_user.not_blank=指派人不能为空
bug.assign_user.length_range=指派人长度必须在1-50之间 bug.assign_user.length_range=指派人长度必须在1-50之间
bug.create_user.not_blank=创建人不能为空 bug.create_user.not_blank=创建人不能为空
bug.create_user.length_range=创建人长度必须在1-50之间 bug.create_user.length_range=创建人长度必须在1-50之间
bug.update_user.not_blank=更新人不能为空
bug.update_user.length_range=更新人长度必须在1-50之间
bug.delete_user.not_blank=删除人不能为空 bug.delete_user.not_blank=删除人不能为空
bug.delete_user.length_range=删除人长度必须在1-50之间 bug.delete_user.length_range=删除人长度必须在1-50之间
bug.project_id.not_blank=项目ID不能为空 bug.project_id.not_blank=项目ID不能为空

View File

@ -7,6 +7,8 @@ bug.assign_user.not_blank=assignUser cannot be empty
bug.assign_user.length_range=assignUser length must be between 1-50 bug.assign_user.length_range=assignUser length must be between 1-50
bug.create_user.not_blank=createUser cannot be empty bug.create_user.not_blank=createUser cannot be empty
bug.create_user.length_range=createUser length must be between 1-50 bug.create_user.length_range=createUser length must be between 1-50
bug.update_user.not_blank=updateUser cannot be empty
bug.update_user.length_range=updateUser length must be between 1-50
bug.delete_user.not_blank=deleteUser cannot be empty bug.delete_user.not_blank=deleteUser cannot be empty
bug.delete_user.length_range=deleteUser length must be between 1-50 bug.delete_user.length_range=deleteUser length must be between 1-50
bug.project_id.not_blank=projectId cannot be empty bug.project_id.not_blank=projectId cannot be empty

View File

@ -7,6 +7,8 @@ bug.assign_user.not_blank=指派人不能为空
bug.assign_user.length_range=指派人长度必须在1-50之间 bug.assign_user.length_range=指派人长度必须在1-50之间
bug.create_user.not_blank=创建人不能为空 bug.create_user.not_blank=创建人不能为空
bug.create_user.length_range=创建人长度必须在1-50之间 bug.create_user.length_range=创建人长度必须在1-50之间
bug.update_user.not_blank=更新人不能为空
bug.update_user.length_range=更新人长度必须在1-50之间
bug.delete_user.not_blank=删除人不能为空 bug.delete_user.not_blank=删除人不能为空
bug.delete_user.length_range=删除人长度必须在1-50之间 bug.delete_user.length_range=删除人长度必须在1-50之间
bug.project_id.not_blank=项目ID不能为空 bug.project_id.not_blank=项目ID不能为空

View File

@ -7,6 +7,8 @@ bug.assign_user.not_blank=指派人不能為空
bug.assign_user.length_range=指派人長度必須在1-50之間 bug.assign_user.length_range=指派人長度必須在1-50之間
bug.create_user.not_blank=创建人不能為空 bug.create_user.not_blank=创建人不能為空
bug.create_user.length_range=创建人長度必須在1-50之間 bug.create_user.length_range=创建人長度必須在1-50之間
bug.update_user.not_blank=更新人不能為空
bug.update_user.length_range=更新人長度必須在1-50之間
bug.delete_user.not_blank=删除人不能為空 bug.delete_user.not_blank=删除人不能為空
bug.delete_user.length_range=删除人長度必須在1-50之間 bug.delete_user.length_range=删除人長度必須在1-50之間
bug.project_id.not_blank=项目ID不能為空 bug.project_id.not_blank=项目ID不能為空