代码提交
This commit is contained in:
parent
964599dad6
commit
78d24309d1
|
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.remark
|
||||
from da_ky_sys_dept d
|
||||
from record_da_ky_sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="org.springblade.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
|
||||
|
|
@ -47,19 +47,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from da_ky_sys_dept d
|
||||
from record_da_ky_sys_dept d
|
||||
left join da_ky_sys_role_dept rd on d.dept_id = rd.dept_id
|
||||
where rd.role_id = #{roleId}
|
||||
<if test="deptCheckStrictly">
|
||||
and d.dept_id not in (select d.parent_id from da_ky_sys_dept d inner join da_ky_sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
and d.dept_id not in (select d.parent_id from record_da_ky_sys_dept d inner join da_ky_sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,d.remark,
|
||||
(select dept_name from da_ky_sys_dept where dept_id = d.parent_id) parent_name
|
||||
from da_ky_sys_dept d
|
||||
(select dept_name from record_da_ky_sys_dept where dept_id = d.parent_id) parent_name
|
||||
from record_da_ky_sys_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
|
|
@ -68,16 +68,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from da_ky_sys_dept
|
||||
select count(1) from record_da_ky_sys_dept
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select * from da_ky_sys_dept where find_in_set(#{deptId}, ancestors)
|
||||
select * from record_da_ky_sys_dept where find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
select count(*) from da_ky_sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
select count(*) from record_da_ky_sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
|
|
@ -87,13 +87,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTransferApplyDeptId" resultType="java.lang.Integer">
|
||||
WITH RECURSIVE DeptTree AS (
|
||||
SELECT dept_id
|
||||
FROM da_ky_sys_dept
|
||||
FROM record_da_ky_sys_dept
|
||||
WHERE dept_id = #{deptId}
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT d.dept_id
|
||||
FROM da_ky_sys_dept d
|
||||
FROM record_da_ky_sys_dept d
|
||||
INNER JOIN DeptTree dt ON d.parent_id = dt.dept_id
|
||||
)
|
||||
SELECT COUNT(*)
|
||||
|
|
@ -104,13 +104,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getSysUserDeptId" resultType="java.lang.Integer">
|
||||
WITH RECURSIVE DeptTree AS (
|
||||
SELECT dept_id
|
||||
FROM da_ky_sys_dept
|
||||
FROM record_da_ky_sys_dept
|
||||
WHERE dept_id = #{deptId}
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT d.dept_id
|
||||
FROM da_ky_sys_dept d
|
||||
FROM record_da_ky_sys_dept d
|
||||
INNER JOIN DeptTree dt ON d.parent_id = dt.dept_id
|
||||
)
|
||||
SELECT COUNT(*)
|
||||
|
|
@ -121,13 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTransferIssueDeptId" resultType="java.lang.Integer">
|
||||
WITH RECURSIVE DeptTree AS (
|
||||
SELECT dept_id
|
||||
FROM da_ky_sys_dept
|
||||
FROM record_da_ky_sys_dept
|
||||
WHERE dept_id = #{deptId}
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT d.dept_id
|
||||
FROM da_ky_sys_dept d
|
||||
FROM record_da_ky_sys_dept d
|
||||
INNER JOIN DeptTree dt ON d.parent_id = dt.dept_id
|
||||
)
|
||||
SELECT COUNT(*)
|
||||
|
|
@ -137,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into da_ky_sys_dept(
|
||||
insert into record_da_ky_sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
|
|
@ -167,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update da_ky_sys_dept
|
||||
update record_da_ky_sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
|
|
@ -185,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update da_ky_sys_dept set ancestors =
|
||||
update record_da_ky_sys_dept set ancestors =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case dept_id" close="end">
|
||||
when #{item.deptId} then #{item.ancestors}
|
||||
|
|
@ -198,14 +198,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
||||
update da_ky_sys_dept set status = '0' where dept_id in
|
||||
update record_da_ky_sys_dept set status = '0' where dept_id in
|
||||
<foreach collection="array" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update da_ky_sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
update record_da_ky_sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
email,
|
||||
status,
|
||||
del_flag AS delFlag
|
||||
FROM da_ky_sys_dept
|
||||
FROM record_da_ky_sys_dept
|
||||
WHERE del_flag = '0'
|
||||
and status = '0'
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue