Merge remote-tracking branch 'lis8.0/master'

This commit is contained in:
jiangs 2025-11-13 16:01:49 +08:00
commit f2a7a62345
2 changed files with 3 additions and 3 deletions

View File

@ -75,11 +75,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where dbo.find_in_set(#{deptId}, ancestors) > 0
select * from sys_dept where CHARINDEX( ','+CONVERT(varchar(100),#{deptId})+',', ','+ancestors+',')>0
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and dbo.find_in_set(#{deptId}, ancestors) > 0
select count(*) from sys_dept where status = 0 and del_flag = '0' and CHARINDEX( ','+CONVERT(varchar(100),#{deptId})+',', ','+ancestors+',')>0
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">

View File

@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND u.create_time &lt;= #{params.endTime}
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE CHARINDEX( ','+#{deptId}+',', ','+ancestors+',')>0 ))
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE CHARINDEX( ','+CONVERT(varchar(100),#{deptId})+',', ','+ancestors+',')>0 ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}