添加部门树

This commit is contained in:
zhangzhiqiang
2022-12-01 08:51:50 +08:00
parent f0c119865d
commit e306540bb8
3 changed files with 23 additions and 5 deletions

View File

@@ -31,8 +31,9 @@ import java.util.Objects;
@Getter
@Setter
public class DeptTree implements Serializable {
private Long Dept_id;
private Long pid;
private String name;
@JsonInclude(JsonInclude.Include.NON_EMPTY)

View File

@@ -92,3 +92,20 @@
ENDSELECT
ENDPAGEQUERY
ENDIF
IF 输入.flag = "2"
PAGEQUERY
SELECT
max(t3.childId)
from
(
select *,
if( find_in_set(t1.pid, @p) > 0,@p := concat(@p,',',id),0 ) as childId
from
(select dept_id as id, pid from sys_dept t order by id) t1,
(select @p := '输入.pid') t2
) t3
where childId != '0'
ENDSELECT
ENDPAGEQUERY
ENDIF