fix: 修改
This commit is contained in:
40
base-fast/src/main/resources/mapper/dept/SysDeptMapper.xml
Normal file
40
base-fast/src/main/resources/mapper/dept/SysDeptMapper.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.boge.modules.dept.dao.mapper.SysDeptMapper">
|
||||
|
||||
<insert id="saveDeptRelation">
|
||||
replace into sys_user_dept values
|
||||
<foreach collection="depts" item="dept" separator=",">
|
||||
(#{user},#{dept})
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="delDeptRelation">
|
||||
delete from sys_user_dept where user_id = #{user}
|
||||
</delete>
|
||||
|
||||
<update id="updateSubCount">
|
||||
update sys_dept set sub_count =
|
||||
(select m.count from (select count(*) count from sys_dept where pid = #{pid}) as m)
|
||||
where dept_id = #{pid}
|
||||
</update>
|
||||
<select id="findAllChild" resultType="java.lang.String">
|
||||
SELECT
|
||||
max(t3.childId) as deptIds
|
||||
from
|
||||
(
|
||||
select *,
|
||||
if( find_in_set(t1.pid, @p) > 0,@p := concat(@p,',',id),0 ) as childId
|
||||
from
|
||||
(select dept_id as id, pid from sys_dept t order by id) t1,
|
||||
(select @p := #{pid}) t2
|
||||
) t3
|
||||
where childId != '0'
|
||||
</select>
|
||||
<select id="getDeptRelation" resultType="java.util.Map">
|
||||
select * from sys_user_dept where dept_id in (
|
||||
<foreach collection="deptIds" separator="," item="dept">
|
||||
#{dept}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.boge.modules.dept.dao.mapper.SysUserDeptMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.boge.modules.dict.dao.mapper.SysDictMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user