| | |
| | | FROM |
| | | blade_dept |
| | | WHERE |
| | | parent_id = dept.id and is_deleted = 0 |
| | | parent_id = dept.id and dept.is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM |
| | | blade_dept dept |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.dept_id = dept.id |
| | | WHERE |
| | | dept.is_deleted = 0 |
| | | <if test="type==1"> |
| | |
| | | <if test="type==2 or type==3"> |
| | | and dept_category=2 |
| | | AND dept.parent_id = "1123598813738675201" |
| | | </if> |
| | | <if test="type==4 and jurisdiction!=null and jurisdiction!=''"> |
| | | and dept_category=1 |
| | | AND dept.parent_id = "1413470343230877697" |
| | | and bu.jurisdiction = #{jurisdiction} |
| | | </if> |
| | | ) |
| | | |
| | |
| | | <if test="type==2 or type==3"> |
| | | and dept_category=2 |
| | | </if> |
| | | <if test="type==4 and jurisdiction!=null and jurisdiction!=''"> |
| | | and dept_category=1 |
| | | and bu.jurisdiction = #{jurisdiction} |
| | | </if> |
| | | ) |
| | | )c |
| | | </select> |