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

View File

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

View File

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