add companyId to sysUser

This commit is contained in:
sxu 2024-12-01 15:43:37 +08:00
parent 2e560ba205
commit 4a8f0224f5
2 changed files with 21 additions and 0 deletions

View File

@ -38,6 +38,12 @@ public class SysUser extends BaseEntity {
@Excel(name = "部门编号", type = Type.IMPORT)
private Long deptId;
/**
* 公司ID
*/
@Excel(name = "公司编号", type = Type.IMPORT)
private Long companyId;
/**
* 用户账号
*/
@ -179,6 +185,14 @@ public class SysUser extends BaseEntity {
this.deptId = deptId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
@Xss(message = "用户昵称不能包含脚本字符")
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
public String getNickName() {

View File

@ -7,6 +7,7 @@
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
<result property="companyId" column="company_id"/>
<result property="userName" column="user_name"/>
<result property="nickName" column="nick_name"/>
<result property="email" column="email"/>
@ -54,6 +55,12 @@
<sql id="selectUserVo">
select u.user_id,
u.dept_id,
CASE d.ancestors
WHEN ('0') THEN
d.dept_id
ELSE
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 2), ',', -1)
END as company_id,
u.user_name,
u.nick_name,
u.email,