SELECT DISTINCT
b.parent_id pid, a.dept_id deptId
FROM
sys_role_dept a
INNER JOIN sys_dept b ON a.dept_id = b.dept_id AND a.role_id='24' AND b.parent_id NOT in(SELECT e.dept_id FROM sys_role_dept e WHERE e.role_id='24');
根据子节点查出父节点
最新推荐文章于 2024-09-24 17:13:56 发布