Changes提交修改
This commit is contained in:
@@ -39,6 +39,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tenantName != null and tenantName != ''"> and d.tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDocAllList" parameterType="Doc" resultMap="DocResult">
|
||||
<include refid="selectDocVo"/>
|
||||
<where>
|
||||
<!-- <if test="deptId != null "> and dept_id = #{deptId}</if>-->
|
||||
<if test="deptId != null and deptId != 0 ">
|
||||
and d.dept_id in (
|
||||
SELECT #{deptId} AS dept_id
|
||||
UNION ALL
|
||||
SELECT DISTINCT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ancestors, ',', n.n), ',', -1) AS SIGNED) AS dept_id
|
||||
FROM sys_dept de
|
||||
JOIN (
|
||||
SELECT 1 AS n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
|
||||
UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10
|
||||
) n ON CHAR_LENGTH(ancestors) - CHAR_LENGTH(REPLACE(ancestors, ',', '')) >= n.n - 1
|
||||
WHERE de.dept_id = #{deptId}
|
||||
AND SUBSTRING_INDEX(SUBSTRING_INDEX(ancestors, ',', n.n), ',', -1) != ''
|
||||
)
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''"> and d.file_name like concat('%', #{fileName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDocById" parameterType="Long" resultMap="DocResult">
|
||||
<include refid="selectDocVo"/>
|
||||
|
||||
Reference in New Issue
Block a user