소스 검색

大屏统计优化

xuxiaofei 2 년 전
부모
커밋
76b9107c60
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabNotifyplanMapper.xml

+ 3 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabNotifyplanMapper.xml

@@ -99,7 +99,9 @@
             <if test="company != null  and company != ''">and t.company  like concat('%', #{company}, '%')</if>
             <if test="conAbstract != null  and conAbstract != ''">and t.con_abstract  like concat('%', #{conAbstract}, '%')</if>
             <if test="status != null ">and t.status = #{status}</if>
-            <if test="deptId != null ">and t.dept_id = #{deptId}</if>
+            <if test="deptId != null and deptId !=''"> <!-- 部门id-->
+                and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or t.dept_id = #{deptId} )
+            </if>
             <if test="deptName != null ">and t.dept_name = #{deptName}</if>
             <if test="userId != null ">and t.user_id = #{userId}</if>
             <if test="createBy != null  and createBy != ''">and t.create_by like concat('%', #{createBy}, '%')</if>