增加用户编码
This commit is contained in:
parent
3f614f44ba
commit
bda5bfac98
|
|
@ -31,6 +31,11 @@ public class SysUser extends BaseEntity {
|
|||
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户编码
|
||||
*/
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
|
|
@ -199,6 +204,14 @@ public class SysUser extends BaseEntity {
|
|||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode) {
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id"/>
|
||||
<id property="userCode" column="user_code"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="userType" column="user_type"/>
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id,
|
||||
u.user_code,
|
||||
u.dept_id,
|
||||
CASE d.ancestors
|
||||
WHEN ('0') THEN
|
||||
|
|
@ -117,7 +119,7 @@
|
|||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,u.sex, u.status, u.birthday,
|
||||
select u.user_id, u.user_code, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,u.sex, u.status, u.birthday,
|
||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.approval_status,
|
||||
u.is_permanent,u.is_built_in, u.effective_start_day, u.effective_end_day,
|
||||
d.dept_name, d.leader,r.role_id,
|
||||
|
|
@ -205,7 +207,7 @@
|
|||
<!-- </select>-->
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.is_built_in
|
||||
select distinct u.user_id, u.user_code, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.is_built_in
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
|
|
@ -222,7 +224,7 @@
|
|||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.is_built_in
|
||||
select distinct u.user_id, u.user_code, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.is_built_in
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
|
|
@ -300,6 +302,7 @@
|
|||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="userCode != null and userCode != 0">user_code,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="userType != null and userType != ''">user_type,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
|
|
@ -323,6 +326,7 @@
|
|||
create_time, update_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="userCode != null and userCode != ''">#{userCode},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="userType != null and userType != ''">#{userType},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
|
|
@ -350,6 +354,7 @@
|
|||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="userCode != null and userCode != 0">user_code = #{userCode},</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue