-- 查询(oracle自带递归)
SELECT DEPT_ID, DEPT_NAME,SUPER_DEPT_ID FROM system_dept
where
connect_by_isleaf=1 -- 只选叶子节点
START WITH DEPT_ID in(
select a.object_id from system_role_object a,(select role_id from system_role where role_name='组织单位') b
where a.role_id=b.role_id and a.object_type='d'
)
CONNECT BY prior DEPT_ID = SUPER_DEPT_ID
----- 上网搜