合并代码提交
This commit is contained in:
@@ -24,6 +24,8 @@ public class DeptDTO implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private String code;
|
||||
|
||||
private String area;
|
||||
|
||||
private String remark;
|
||||
|
||||
@@ -41,7 +41,6 @@ public class Dept extends BaseEntity {
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,31 +30,30 @@
|
||||
SELECT
|
||||
T3.*,
|
||||
T5.id area,
|
||||
T5.name areaName
|
||||
T5.NAME areaName
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@codes AS _ids,
|
||||
(
|
||||
SELECT @codes := GROUP_CONCAT( id ) FROM sys_dept WHERE FIND_IN_SET( pid, @codes ) ) AS T1
|
||||
FROM
|
||||
sys_dept s,
|
||||
( SELECT @codes := #{id} ) T4
|
||||
WHERE
|
||||
@codes IS NOT NULL
|
||||
<if test="type != null">
|
||||
AND s.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) T2,
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
FIND_IN_SET( T3.id, T2._ids )
|
||||
FIND_IN_SET( #{id}, T3.pids )
|
||||
and t3.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND t3.area = t5.id
|
||||
AND t3.State = 1
|
||||
UNION
|
||||
SELECT
|
||||
T3.*,
|
||||
T5.id area,
|
||||
T5.NAME areaName
|
||||
FROM
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
t3.area = t5.id
|
||||
and T3.id = #{id}
|
||||
AND t3.State = 1
|
||||
</select>
|
||||
|
||||
<select id="getAllDeptTree" resultType="DeptAllTreeVO">
|
||||
@@ -125,6 +124,7 @@
|
||||
T3.pid,
|
||||
T3.pids,
|
||||
T3.NAME,
|
||||
T3.code,
|
||||
T3.type,
|
||||
T5.NAME area ,
|
||||
T3.Remark,
|
||||
|
||||
Reference in New Issue
Block a user