| | |
| | | |
| | | <select id="treeByParentId" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, dept_name as title, id as "value", id as "key" from blade_dept where is_deleted = 0 |
| | | <if test="_parameter!=null and _parameter!=''"> |
| | | and ( |
| | | id = #{_parameter} or parent_id = #{_parameter} or parent_id in ( |
| | | select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{_parameter} |
| | | <if test="parentIds!=null and parentIds!=''"> |
| | | and |
| | | |
| | | <foreach item="id" collection="parentIds" open="(" separator="or" close=")"> |
| | | id = #{id} or parent_id = #{id} or parent_id in ( |
| | | select b.id from blade_dept b where b.is_deleted = 0 and b.PARENT_ID = #{id} |
| | | ) |
| | | ) |
| | | |
| | | </foreach> |
| | | |
| | | </if> |
| | | ORDER BY sort |
| | | </select> |