1
0
Fork 0
management/back/dkha-sz-main/dkha-admin/dkha-admin-server/target/classes/mapper/SysDeptDao.xml

31 lines
1.2 KiB
XML

<?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.dkha.dao.SysDeptDao">
<select id="getList" resultType="com.dkha.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where t1.del_flag = 0
<if test="deptIdList != null">
and t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
order by t1.sort asc
</select>
<select id="getById" resultType="com.dkha.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} and t1.del_flag = 0
</select>
<select id="getIdAndPidList" resultType="com.dkha.entity.SysDeptEntity">
select t1.id, t1.pid from sys_dept t1 where t1.del_flag = 0
</select>
<select id="getSubDeptIdList" resultType="long">
select id from sys_dept where pids like #{id} and del_flag = 0
</select>
</mapper>