select USER_CODE,CN_NAME from sys_user where ID in (
select USER_ID from sys_user_org where ORG_ID in (
select ID from (select t1.ID,
if(find_in_set(PARENT_ID, @pids) > 0, @pids := concat(@pids, ',', ID), if(CODE = #{orgCode},ID,0)) as ischild
from (
select ID,CODE,PARENT_ID,NAME from sys_org t ORDER BY ORG_DESC,ID
) t1,
(select @pids := IFNULL((SELECT ID FROM sys_org where CODE = #{orgCode}),'') ) t2
) t3 WHERE ischild != 0)) order by ID
11-25
1202
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-22
1420
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)