select sdDept.id from (
select sd.id dept_id, sd.dept_index
from sys_dept_emp sde
left join sys_dept sd on (sd.id = sde.dept_id and sd.del_state = 0 and sd.dept_state = 0)
where sde.emp_id = #{nowUserId}
and sde.company_id = #{companyId}
) temp
left join sys_dept sdDept ON (sdDept.dept_index like CONCAT('%',temp.dept_index,'%') and sdDept.del_state = 0 and sdDept.dept_state = 0)
where sdDept.company_id = #{companyId}
最后
以上就是玩命灯泡最近收集整理的关于SQL案例自用的全部内容,更多相关SQL案例自用内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复