build: add project and organization update user field

This commit is contained in:
song-cc-rock 2023-06-13 10:18:09 +08:00 committed by 刘瑞斌
parent 56ad4c09ce
commit 7adf0a87b9
9 changed files with 201 additions and 21 deletions

View File

@ -13,8 +13,7 @@ public class Project implements Serializable {
@Size(min = 1, max = 50, message = "{project.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{project.num.not_blank}", groups = {Created.class})
@Schema(title = "项目编号")
private Long num;
@Schema(title = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED)
@ -36,6 +35,9 @@ public class Project implements Serializable {
@Schema(title = "更新时间")
private Long updateTime;
@Schema(title = "修改人")
private String updateUser;
@Schema(title = "创建人")
private String createUser;

View File

@ -564,6 +564,76 @@ public class ProjectExample {
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 andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;

View File

@ -9,6 +9,7 @@
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
@ -74,8 +75,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, num, organization_id, `name`, description, create_time, update_time, create_user,
delete_time, deleted, delete_user, `enable`
id, num, organization_id, `name`, description, create_time, update_time, update_user,
create_user, delete_time, deleted, delete_user, `enable`
</sql>
<select id="selectByExample" parameterType="io.metersphere.project.domain.ProjectExample" resultMap="BaseResultMap">
select
@ -110,14 +111,14 @@
<insert id="insert" parameterType="io.metersphere.project.domain.Project">
insert into project (id, num, organization_id,
`name`, description, create_time,
update_time, create_user, delete_time,
deleted, delete_user, `enable`
)
update_time, update_user, create_user,
delete_time, deleted, delete_user,
`enable`)
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{createUser,jdbcType=VARCHAR}, #{deleteTime,jdbcType=BIGINT},
#{deleted,jdbcType=BIT}, #{deleteUser,jdbcType=VARCHAR}, #{enable,jdbcType=BIT}
)
#{updateTime,jdbcType=BIGINT}, #{updateUser,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{deleteTime,jdbcType=BIGINT}, #{deleted,jdbcType=BIT}, #{deleteUser,jdbcType=VARCHAR},
#{enable,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.project.domain.Project">
insert into project
@ -143,6 +144,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="createUser != null">
create_user,
</if>
@ -181,6 +185,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
@ -228,6 +235,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
@ -257,6 +267,7 @@
description = #{record.description,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
update_user = #{record.updateUser,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
deleted = #{record.deleted,jdbcType=BIT},
@ -287,6 +298,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
@ -313,6 +327,7 @@
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
update_user = #{updateUser,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT},
deleted = #{deleted,jdbcType=BIT},

View File

@ -13,8 +13,7 @@ public class Organization implements Serializable {
@Size(min = 1, max = 50, message = "{organization.id.length_range}", groups = {Created.class, Updated.class})
private String id;
@Schema(title = "组织编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{organization.num.not_blank}", groups = {Created.class})
@Schema(title = "组织编号")
private Long num;
@Schema(title = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED)
@ -34,6 +33,9 @@ public class Organization implements Serializable {
@Schema(title = "创建人")
private String createUser;
@Schema(title = "修改人")
private String updateUser;
@Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "{organization.deleted.not_blank}", groups = {Created.class})
private Boolean deleted;

View File

@ -564,6 +564,76 @@ public class OrganizationExample {
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 andDeletedIsNull() {
addCriterion("deleted is null");
return (Criteria) this;

View File

@ -9,6 +9,7 @@
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="delete_user" jdbcType="VARCHAR" property="deleteUser" />
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
@ -73,8 +74,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, num, `name`, description, create_time, update_time, create_user, deleted, delete_user,
delete_time, `enable`
id, num, `name`, description, create_time, update_time, create_user, update_user,
deleted, delete_user, delete_time, `enable`
</sql>
<select id="selectByExample" parameterType="io.metersphere.system.domain.OrganizationExample" resultMap="BaseResultMap">
select
@ -109,12 +110,14 @@
<insert id="insert" parameterType="io.metersphere.system.domain.Organization">
insert into organization (id, num, `name`,
description, create_time, update_time,
create_user, deleted, delete_user,
delete_time, `enable`)
create_user, update_user, deleted,
delete_user, delete_time, `enable`
)
values (#{id,jdbcType=VARCHAR}, #{num,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{createUser,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT}, #{deleteUser,jdbcType=VARCHAR},
#{deleteTime,jdbcType=BIGINT}, #{enable,jdbcType=BIT})
#{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR}, #{deleted,jdbcType=BIT},
#{deleteUser,jdbcType=VARCHAR}, #{deleteTime,jdbcType=BIGINT}, #{enable,jdbcType=BIT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.system.domain.Organization">
insert into organization
@ -140,6 +143,9 @@
<if test="createUser != null">
create_user,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="deleted != null">
deleted,
</if>
@ -175,6 +181,9 @@
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
#{deleted,jdbcType=BIT},
</if>
@ -219,6 +228,9 @@
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser,jdbcType=VARCHAR},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=BIT},
</if>
@ -245,6 +257,7 @@
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_user = #{record.createUser,jdbcType=VARCHAR},
update_user = #{record.updateUser,jdbcType=VARCHAR},
deleted = #{record.deleted,jdbcType=BIT},
delete_user = #{record.deleteUser,jdbcType=VARCHAR},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
@ -274,6 +287,9 @@
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=VARCHAR},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=BIT},
</if>
@ -297,6 +313,7 @@
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_user = #{createUser,jdbcType=VARCHAR},
update_user = #{updateUser,jdbcType=VARCHAR},
deleted = #{deleted,jdbcType=BIT},
delete_user = #{deleteUser,jdbcType=VARCHAR},
delete_time = #{deleteTime,jdbcType=BIGINT},

View File

@ -401,6 +401,7 @@ CREATE TABLE organization
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`create_user` VARCHAR(50) NOT NULL COMMENT '创建人',
`update_user` VARCHAR(50) NOT NULL COMMENT '修改人',
`deleted` BIT NOT NULL DEFAULT 0 COMMENT '是否删除',
`delete_user` VARCHAR(50) COMMENT '删除人',
`delete_time` BIGINT COMMENT '删除时间',
@ -417,6 +418,7 @@ CREATE INDEX idx_create_user ON organization (`create_user`);
CREATE INDEX idx_create_time ON organization (`create_time`);
CREATE INDEX idx_update_time ON organization (`update_time`);
CREATE INDEX idx_deleted ON organization (`deleted`);
CREATE INDEX idx_update_user ON organization(`update_user`);
DROP TABLE IF EXISTS user_extend;
CREATE TABLE user_extend

View File

@ -168,6 +168,7 @@ CREATE TABLE project
`description` VARCHAR(500) COMMENT '项目描述',
`create_time` BIGINT NOT NULL COMMENT '创建时间',
`update_time` BIGINT NOT NULL COMMENT '更新时间',
`update_user` VARCHAR(50) NOT NULL COMMENT '修改人',
`create_user` VARCHAR(50) COMMENT '创建人',
`delete_time` BIGINT(255) COMMENT '删除时间',
`deleted` BIT NOT NULL DEFAULT 0 COMMENT '是否删除',
@ -181,9 +182,10 @@ CREATE TABLE project
CREATE INDEX idx_organization_id ON project (organization_id);
CREATE INDEX idx_create_user ON project (create_user);
CREATE INDEX idx_create_time ON project (create_time);
CREATE INDEX idex_update_time ON project (update_time);
CREATE INDEX idx_update_time ON project (update_time);
CREATE INDEX idx_name ON project (name);
CREATE INDEX idx_deleted ON project (deleted);
CREATE INDEX idx_update_user ON project(update_user);
DROP TABLE IF EXISTS project_application;
CREATE TABLE project_application

View File

@ -2,9 +2,9 @@
SET SESSION innodb_lock_wait_timeout = 7200;
-- 初始化组织
INSERT INTO organization (id, num, name, description, create_user, create_time, update_time) VALUES (uuid(), 100001, '默认组织', '系统默认创建的组织', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
INSERT INTO organization (id, num, name, description, create_user, update_user, create_time, update_time) VALUES (uuid(), 100001, '默认组织', '系统默认创建的组织', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
-- 初始化项目
INSERT INTO project (id, num, organization_id, name, description, create_user, create_time, update_time) VALUES (uuid(), 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time) VALUES (uuid(), 100001, (SELECT id FROM organization WHERE name LIKE '默认组织'), '默认项目', '系统默认创建的项目', 'admin', 'admin', unix_timestamp() * 1000, unix_timestamp() * 1000);
-- 初始化用户
insert into user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source, last_project_id, create_user, update_user)