| | |
| | | |
| | | <!--懒加载获取部门树形结构(包含用户数据)app--> |
| | | <select id="lazyTreeUserApp" resultType="org.springblade.modules.system.vo.DeptAndUserVO" > |
| | | select DISTINCT * from ( |
| | | select DISTINCT |
| | | c.id, |
| | | c.parent_id, |
| | | c.title, |
| | | c.value, |
| | | c.key, |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | blade_dept |
| | | where |
| | | id = c.parent_id |
| | | and dept_category=1 |
| | | ) AS "has_children" |
| | | from ( |
| | | (SELECT |
| | | dept.id, |
| | | dept.parent_id, |
| | |
| | | |
| | | union all |
| | | |
| | | (select |
| | | ( |
| | | select |
| | | bu.id, |
| | | bu.dept_id parent_id, |
| | | bu.real_name AS label, |
| | |
| | | |
| | | <!--懒加载获取部门树形结构(包含用户数据)--> |
| | | <select id="lazyTreeUser" resultMap="treeNodeResultMap" > |
| | | select DISTINCT * from ( |
| | | select DISTINCT |
| | | c.id, |
| | | c.parent_id, |
| | | c.title, |
| | | c.value, |
| | | c.key, |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | blade_dept |
| | | where |
| | | id = c.parent_id |
| | | <if test="parentId!=null and parentId!=''"> |
| | | and dept_category=1 |
| | | AND id = #{parentId} |
| | | </if> |
| | | ) AS "has_children" |
| | | from ( |
| | | (SELECT |
| | | dept.id, |
| | | dept.parent_id, |