|
@@ -203,10 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM
|
|
FROM
|
|
|
lab_risk_plan_abnormal_group gp
|
|
lab_risk_plan_abnormal_group gp
|
|
|
INNER JOIN lab_subject s ON gp.`subject_id` = s.`id`
|
|
INNER JOIN lab_subject s ON gp.`subject_id` = s.`id`
|
|
|
- INNER JOIN lab_risk_plan_abnormal_log al ON gp.`id` = al.`group_id`
|
|
|
|
|
- INNER JOIN sys_dept x2 ON s.`dept_id` = x2.`dept_id`
|
|
|
|
|
<where>
|
|
<where>
|
|
|
- 1=1 and al.`risk_status`=1
|
|
|
|
|
<if test="deptId != null and deptId !=''">
|
|
<if test="deptId != null and deptId !=''">
|
|
|
and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
|
|
and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
|
|
|
</if>
|
|
</if>
|
|
@@ -253,6 +250,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="subjectId != null and subjectId != '' ">
|
|
<if test="subjectId != null and subjectId != '' ">
|
|
|
AND s.`id` = #{subjectId}
|
|
AND s.`id` = #{subjectId}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="deptId != null and deptId !=''"> <!-- 部门id-->
|
|
|
|
|
+ and ( s.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or s.dept_id = #{deptId} )
|
|
|
|
|
+ </if>
|
|
|
<if test="beginTimeStr != null and beginTimeStr != ''"><!-- 开始时间检索 -->
|
|
<if test="beginTimeStr != null and beginTimeStr != ''"><!-- 开始时间检索 -->
|
|
|
AND date_format(gp.create_time,'%y%m%d') >= date_format(#{beginTimeStr},'%y%m%d')
|
|
AND date_format(gp.create_time,'%y%m%d') >= date_format(#{beginTimeStr},'%y%m%d')
|
|
|
</if>
|
|
</if>
|