deptUserTree

This commit is contained in:
sxu 2025-04-17 15:05:02 +08:00
parent 10a7d86281
commit 4d7c936bab
3 changed files with 25 additions and 2 deletions

View File

@ -112,6 +112,8 @@ public class SysDept extends BaseEntity {
*/
private String logo;
private Long nodeId;
//公司管理员用户ID
private Long adminUserId;
@ -203,6 +205,14 @@ public class SysDept extends BaseEntity {
this.logo = logo;
}
public Long getNodeId() {
return nodeId;
}
public void setNodeId(Long nodeId) {
this.nodeId = nodeId;
}
public Long getAdminUserId() {
return adminUserId;
}

View File

@ -25,6 +25,8 @@ public class TreeSelect implements Serializable {
/** 父部门ID */
private Long parentId;
private Long nodeId;
/**
* 节点名称
*/
@ -48,6 +50,7 @@ public class TreeSelect implements Serializable {
public TreeSelect(SysDept dept) {
this.id = dept.getDeptId();
this.parentId = dept.getParentId();
this.nodeId = dept.getNodeId();
this.status = dept.getStatus();
this.label = dept.getDeptName();
this.level = dept.getLevel();
@ -85,6 +88,14 @@ public class TreeSelect implements Serializable {
this.parentId = parentId;
}
public Long getNodeId() {
return nodeId;
}
public void setNodeId(Long nodeId) {
this.nodeId = nodeId;
}
public String getLabel() {
return label;
}

View File

@ -112,9 +112,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
d.dept_id AS deptId,
d.parent_id AS parentId,
d.dept_id as nodeId,
d.dept_name AS deptName,
LENGTH( d.ancestors ) - LENGTH(
REPLACE ( d.ancestors, ',', '' )) AS LEVEL
REPLACE ( d.ancestors, ',', '' )) AS level
FROM
sys_dept d
WHERE
@ -126,8 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
CONCAT(sd.dept_id,'9999',su.user_id) AS deptId,
sd.dept_id AS parentId,
su.user_id as nodeId,
su.nick_name AS deptName,
99 AS LEVEL
99 AS level
FROM
sys_user su
LEFT JOIN sys_user_role sr ON su.user_id = sr.user_id