Browse Source

用户增加 姓、名字段

zhc
review512jwy@163.com 4 weeks ago
parent
commit
16dc1691cd
  1. 42
      dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml
  2. 2
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml
  3. 8
      dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml
  4. 6
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/OptUserParam.java
  5. 68
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java
  6. 140
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java
  7. 6
      dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserPageDTO.java
  8. 6
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java

42
dongjian-dashboard-back-dao/src/main/resources/mappers/auto/BasicUserMapper.xml

@ -26,6 +26,8 @@
<result column="modifier_id" jdbcType="BIGINT" property="modifierId" />
<result column="super_role" jdbcType="INTEGER" property="superRole" />
<result column="create_platform" jdbcType="INTEGER" property="createPlatform" />
<result column="last_name" jdbcType="VARCHAR" property="lastName" />
<result column="first_name" jdbcType="VARCHAR" property="firstName" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -100,7 +102,7 @@
-->
id, user_type, company_id, username, login_name, `password`, salt, email, mfa_secret,
mfa_bind, mobile_number, last_login_time, flag, expire_time, create_time, creator_id,
modify_time, modifier_id, super_role, create_platform
modify_time, modifier_id, super_role, create_platform, last_name, first_name
</sql>
<select id="selectByExample" parameterType="com.dongjian.dashboard.back.model.BasicUserExample" resultMap="BaseResultMap">
<!--
@ -163,14 +165,16 @@
mobile_number, last_login_time, flag,
expire_time, create_time, creator_id,
modify_time, modifier_id, super_role,
create_platform)
create_platform, last_name, first_name
)
values (#{userType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR},
#{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{mfaSecret,jdbcType=VARCHAR}, #{mfaBind,jdbcType=INTEGER},
#{mobileNumber,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=BIGINT}, #{flag,jdbcType=INTEGER},
#{expireTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
#{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}, #{superRole,jdbcType=INTEGER},
#{createPlatform,jdbcType=INTEGER})
#{createPlatform,jdbcType=INTEGER}, #{lastName,jdbcType=VARCHAR}, #{firstName,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.dongjian.dashboard.back.model.BasicUser">
<!--
@ -239,6 +243,12 @@
<if test="createPlatform != null">
create_platform,
</if>
<if test="lastName != null">
last_name,
</if>
<if test="firstName != null">
first_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userType != null">
@ -298,6 +308,12 @@
<if test="createPlatform != null">
#{createPlatform,jdbcType=INTEGER},
</if>
<if test="lastName != null">
#{lastName,jdbcType=VARCHAR},
</if>
<if test="firstName != null">
#{firstName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.dongjian.dashboard.back.model.BasicUserExample" resultType="java.lang.Long">
@ -377,6 +393,12 @@
<if test="record.createPlatform != null">
create_platform = #{record.createPlatform,jdbcType=INTEGER},
</if>
<if test="record.lastName != null">
last_name = #{record.lastName,jdbcType=VARCHAR},
</if>
<if test="record.firstName != null">
first_name = #{record.firstName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -407,7 +429,9 @@
modify_time = #{record.modifyTime,jdbcType=BIGINT},
modifier_id = #{record.modifierId,jdbcType=BIGINT},
super_role = #{record.superRole,jdbcType=INTEGER},
create_platform = #{record.createPlatform,jdbcType=INTEGER}
create_platform = #{record.createPlatform,jdbcType=INTEGER},
last_name = #{record.lastName,jdbcType=VARCHAR},
first_name = #{record.firstName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -476,6 +500,12 @@
<if test="createPlatform != null">
create_platform = #{createPlatform,jdbcType=INTEGER},
</if>
<if test="lastName != null">
last_name = #{lastName,jdbcType=VARCHAR},
</if>
<if test="firstName != null">
first_name = #{firstName,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -503,7 +533,9 @@
modify_time = #{modifyTime,jdbcType=BIGINT},
modifier_id = #{modifierId,jdbcType=BIGINT},
super_role = #{superRole,jdbcType=INTEGER},
create_platform = #{createPlatform,jdbcType=INTEGER}
create_platform = #{createPlatform,jdbcType=INTEGER},
last_name = #{lastName,jdbcType=VARCHAR},
first_name = #{firstName,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

2
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/BasicUserMapperExt.xml

@ -24,6 +24,8 @@
buser.username username,
buser.login_name loginName,
buser.email,
buser.last_name,
buser.first_name,
buser.mfa_bind,
buser.mobile_number mobileNumber,
buser.create_time createTime,

8
dongjian-dashboard-back-dao/src/main/resources/mappers/ex/OperationLogMapperExt.xml

@ -16,7 +16,13 @@
dolog.request_params,
dolog.execution_time_ms,
dolog.created_at,
buser.login_name `user`
COALESCE(
NULLIF(
CONCAT_WS('', buser.last_name, buser.first_name),
''
),
buser.login_name
) AS `user`
FROM
dashboard_operation_log dolog
INNER JOIN data_center_aeon_admin.basic_user buser ON buser.id = dolog.user_id

6
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/dto/user/OptUserParam.java

@ -37,5 +37,11 @@ public class OptUserParam {
@Schema(description = "所属企业ID",example = "2", hidden = true)
private Long companyId;
@Schema(description = "姓",example = "鸠山", required = true)
private String lastName;
@Schema(description = "名",example = "由纪夫", required = true)
private String firstName;
}

68
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUser.java

@ -183,6 +183,24 @@ public class BasicUser implements Serializable {
*/
private Integer createPlatform;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_user.last_name
*
* @mbg.generated
*/
private String lastName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_user.first_name
*
* @mbg.generated
*/
private String firstName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table basic_user
@ -671,6 +689,54 @@ public class BasicUser implements Serializable {
this.createPlatform = createPlatform;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_user.last_name
*
* @return the value of basic_user.last_name
*
* @mbg.generated
*/
public String getLastName() {
return lastName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_user.last_name
*
* @param lastName the value for basic_user.last_name
*
* @mbg.generated
*/
public void setLastName(String lastName) {
this.lastName = lastName == null ? null : lastName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_user.first_name
*
* @return the value of basic_user.first_name
*
* @mbg.generated
*/
public String getFirstName() {
return firstName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_user.first_name
*
* @param firstName the value for basic_user.first_name
*
* @mbg.generated
*/
public void setFirstName(String firstName) {
this.firstName = firstName == null ? null : firstName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table basic_user
@ -703,6 +769,8 @@ public class BasicUser implements Serializable {
sb.append(", modifierId=").append(modifierId);
sb.append(", superRole=").append(superRole);
sb.append(", createPlatform=").append(createPlatform);
sb.append(", lastName=").append(lastName);
sb.append(", firstName=").append(firstName);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

140
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/model/BasicUserExample.java

@ -1463,6 +1463,146 @@ public class BasicUserExample {
addCriterion("create_platform not between", value1, value2, "createPlatform");
return (Criteria) this;
}
public Criteria andLastNameIsNull() {
addCriterion("last_name is null");
return (Criteria) this;
}
public Criteria andLastNameIsNotNull() {
addCriterion("last_name is not null");
return (Criteria) this;
}
public Criteria andLastNameEqualTo(String value) {
addCriterion("last_name =", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameNotEqualTo(String value) {
addCriterion("last_name <>", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameGreaterThan(String value) {
addCriterion("last_name >", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameGreaterThanOrEqualTo(String value) {
addCriterion("last_name >=", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameLessThan(String value) {
addCriterion("last_name <", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameLessThanOrEqualTo(String value) {
addCriterion("last_name <=", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameLike(String value) {
addCriterion("last_name like", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameNotLike(String value) {
addCriterion("last_name not like", value, "lastName");
return (Criteria) this;
}
public Criteria andLastNameIn(List<String> values) {
addCriterion("last_name in", values, "lastName");
return (Criteria) this;
}
public Criteria andLastNameNotIn(List<String> values) {
addCriterion("last_name not in", values, "lastName");
return (Criteria) this;
}
public Criteria andLastNameBetween(String value1, String value2) {
addCriterion("last_name between", value1, value2, "lastName");
return (Criteria) this;
}
public Criteria andLastNameNotBetween(String value1, String value2) {
addCriterion("last_name not between", value1, value2, "lastName");
return (Criteria) this;
}
public Criteria andFirstNameIsNull() {
addCriterion("first_name is null");
return (Criteria) this;
}
public Criteria andFirstNameIsNotNull() {
addCriterion("first_name is not null");
return (Criteria) this;
}
public Criteria andFirstNameEqualTo(String value) {
addCriterion("first_name =", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameNotEqualTo(String value) {
addCriterion("first_name <>", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameGreaterThan(String value) {
addCriterion("first_name >", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameGreaterThanOrEqualTo(String value) {
addCriterion("first_name >=", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameLessThan(String value) {
addCriterion("first_name <", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameLessThanOrEqualTo(String value) {
addCriterion("first_name <=", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameLike(String value) {
addCriterion("first_name like", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameNotLike(String value) {
addCriterion("first_name not like", value, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameIn(List<String> values) {
addCriterion("first_name in", values, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameNotIn(List<String> values) {
addCriterion("first_name not in", values, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameBetween(String value1, String value2) {
addCriterion("first_name between", value1, value2, "firstName");
return (Criteria) this;
}
public Criteria andFirstNameNotBetween(String value1, String value2) {
addCriterion("first_name not between", value1, value2, "firstName");
return (Criteria) this;
}
}
/**

6
dongjian-dashboard-back-model/src/main/java/com/dongjian/dashboard/back/vo/user/UserPageDTO.java

@ -49,4 +49,10 @@ public class UserPageDTO {
@Schema(description = "创建时间",example = "1678990326897", required = false)
private Long createTime;
@Schema(description = "姓",example = "鸠山", required = true)
private String lastName;
@Schema(description = "名",example = "由纪夫", required = true)
private String firstName;
}

6
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/UserServiceImpl.java

@ -172,6 +172,12 @@ public class UserServiceImpl implements UserService {
private SimpleDataResponse checkParam(OptUserParam param, Integer languageType) {
if(StringUtils.isBlank(param.getLastName()) || param.getLastName().length() > 50){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [lastName] error");
}
if(StringUtils.isBlank(param.getFirstName()) || param.getFirstName().length() > 50){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [firstName] error");
}
if(StringUtils.isBlank(param.getEmail()) || param.getEmail().length() > 100){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Parameter [email] error");
}

Loading…
Cancel
Save