This commit is contained in:
caixiang
2023-02-27 15:49:58 +08:00
parent fed8f82ff0
commit bb8986c98d
11 changed files with 35 additions and 43 deletions

View File

@@ -6,9 +6,8 @@
<select id="getList" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
<where>
t1.valid = 1
<if test="deptIdList != null">
and t1.id in
t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id}
</foreach>
@@ -19,15 +18,15 @@
<select id="getById" resultType="com.cnbm.admin.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.valid = 1
where t1.id = #{value}
</select>
<select id="getIdAndPidList" resultType="com.cnbm.admin.entity.SysDeptEntity">
select t1.id, t1.pid from sys_dept t1 AND t1.valid = 1
select t1.id, t1.pid from sys_dept t1
</select>
<select id="getSubDeptIdList" resultType="long">
select id from sys_dept where pids like #{id} AND valid = 1
select id from sys_dept where pids like #{id}
</select>
</mapper>