| | |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptListNoAuth" parameterType="SysDept" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where d.del_flag = '0' |
| | | <if test="parentId != null"> |
| | | AND FIND_IN_SET(#{parentId}, ancestors) > 0 |
| | | </if> |
| | | <if test="deptName != null and deptName != ''"> |
| | | AND dept_name like concat('%', #{deptName}, '%') |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptListByRoleId" resultType="Long"> |
| | | select d.dept_id |
| | | from sys_dept d |
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="selectAncestors" resultType="java.lang.String"> |
| | | select ancestors |
| | | select SD.ancestors |
| | | from sys_user SU |
| | | INNER JOIN sys_dept SD ON SU.dept_id = SD.dept_id |
| | | where SU.user_id = #{userId} |