2022-04-11 15:03:55 +08:00
|
|
|
<?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="io.renren.modules.sys.dao.SysDeptDao">
|
|
|
|
|
2022-09-29 17:51:37 +08:00
|
|
|
<select id="getList" resultType="io.renren.modules.sys.entity.SysDeptEntity">
|
|
|
|
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
|
2022-10-20 09:33:01 +08:00
|
|
|
where 1 = 1 AND name != '访客部门'
|
|
|
|
<if test="deptIdList != null">
|
2022-11-01 13:41:37 +08:00
|
|
|
AND t1.id in
|
2022-10-20 09:33:01 +08:00
|
|
|
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
2022-11-04 09:55:50 +08:00
|
|
|
<if test="deptName != null and deptName.trim() != ''">
|
|
|
|
and t1.name LIKE CONCAT( '%', #{deptName}, '%' )
|
|
|
|
</if>
|
2022-09-29 17:51:37 +08:00
|
|
|
order by t1.sort asc
|
|
|
|
</select>
|
2022-04-11 15:03:55 +08:00
|
|
|
|
2022-09-29 17:51:37 +08:00
|
|
|
<select id="getById" resultType="io.renren.modules.sys.entity.SysDeptEntity">
|
|
|
|
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
|
|
|
|
where t1.id = #{value}
|
|
|
|
</select>
|
2022-04-11 15:03:55 +08:00
|
|
|
|
2022-09-29 17:51:37 +08:00
|
|
|
<select id="getIdAndPidList" resultType="io.renren.modules.sys.entity.SysDeptEntity">
|
|
|
|
select t1.id, t1.pid from sys_dept t1
|
|
|
|
</select>
|
2022-04-11 15:03:55 +08:00
|
|
|
|
2022-09-29 17:51:37 +08:00
|
|
|
<select id="getSubDeptIdList" resultType="long">
|
|
|
|
select id from sys_dept where pids like #{id}
|
|
|
|
</select>
|
2022-04-11 15:03:55 +08:00
|
|
|
|
2022-09-29 17:51:37 +08:00
|
|
|
<select id="getByName" resultType="io.renren.modules.sys.entity.SysDeptEntity">
|
|
|
|
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
|
|
|
|
where t1.name = #{name} LIMIT 1
|
|
|
|
</select>
|
2022-04-20 15:05:19 +08:00
|
|
|
|
2022-12-10 16:10:20 +08:00
|
|
|
<select id="selectLCDeptByUcsDeptName" resultType="java.util.Map">
|
|
|
|
SELECT * FROM t_ucs_lc_dept_rel WHERE ucs_name = #{provideDept}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectLCDeptByRegion" resultType="java.lang.String">
|
|
|
|
SELECT lc_name FROM t_ucs_lc_dept_rel WHERE district = #{region}
|
|
|
|
</select>
|
|
|
|
<select id="selectUCSDeptByLCDeptName" resultType="java.util.Map">
|
|
|
|
SELECT * FROM t_ucs_lc_dept_rel WHERE lc_name = #{deptName}
|
|
|
|
</select>
|
|
|
|
|
2022-04-11 15:03:55 +08:00
|
|
|
</mapper>
|