project-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -235,4 +235,15 @@ </delete> <select id="getNumByRoleKey" resultType="Long"> select u.user_id from sys_user u join sys_user_role ur on u.user_id = ur.user_id join sys_role r on r.role_id=ur.role_id where u.user_type = '01' and r.role_key = #{roleKey} and (u.dept_id = #{deptId} or u.dept_id in (SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors))) </select> </mapper>