Przeglądaj źródła

大屏统计优化

xuxiaofei 2 lat temu
rodzic
commit
76b9107c60

+ 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>