合并代码提交

This commit is contained in:
2022-11-17 15:10:16 +08:00
parent f368ebd623
commit 52645fa5b0
3 changed files with 63 additions and 62 deletions

View File

@@ -24,6 +24,8 @@ public class DeptDTO implements Serializable {
private String name;
private String code;
private String area;
private String remark;

View File

@@ -41,7 +41,6 @@ public class Dept extends BaseEntity {
/**
* 部门编号
*/
@TableField(exist=false)
private String code;
/**

View File

@@ -12,12 +12,12 @@
AND ${ew.sqlSegment}
</select>
<!-- &lt;!&ndash;查询排序&ndash;&gt;-->
<!-- <select id="getSortNum" resultType="int">-->
<!-- SELECT MAX(sys_dept.sort) sort-->
<!-- FROM sys_dept sys_dept-->
<!-- WHERE sys_dept.state = 1-->
<!-- </select>-->
<!-- &lt;!&ndash;查询排序&ndash;&gt;-->
<!-- <select id="getSortNum" resultType="int">-->
<!-- SELECT MAX(sys_dept.sort) sort-->
<!-- FROM sys_dept sys_dept-->
<!-- WHERE sys_dept.state = 1-->
<!-- </select>-->
<select id="getIdString" resultType="String">
SELECT sys_dept.pids pids
@@ -28,33 +28,32 @@
<select id="getDeptTree" resultType="DeptTreeVO">
SELECT
T3.*,
T5.id area,
T5.name areaName
T3.*,
T5.id area,
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
sys_dept T3,
sys_area T5
WHERE
FIND_IN_SET( T3.id, T2._ids )
AND t3.area = t5.id
AND t3.State = 1
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">
@@ -121,38 +120,39 @@
<select id="getDeptDescendantIndexes" resultType="DeptDTO">
SELECT
T3.id,
T3.pid,
T3.pids,
T3.NAME,
T3.type,
T5.NAME area ,
T3.Remark,
T3.sort
T3.id,
T3.pid,
T3.pids,
T3.NAME,
T3.code,
T3.type,
T5.NAME area ,
T3.Remark,
T3.sort
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
(
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
FIND_IN_SET( T3.id, T2._ids )
AND t3.area = t5.id
AND t3.State = 1
@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 )
AND t3.area = t5.id
AND t3.State = 1
Order by T3.sort asc
</select>