|
@@ -206,29 +206,26 @@
|
|
|
<if test="name !=null and name != ''">
|
|
|
and a.`name` LIKE CONCAT('%',#{name},'%')
|
|
|
</if>
|
|
|
- <if test="depts !=null and depts.size()!=0 ">
|
|
|
- and a.beh_dept_id in
|
|
|
- <foreach collection="depts" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+
|
|
|
<if test="wards !=null and wards.size()!=0 ">
|
|
|
AND a.ward_code in
|
|
|
<foreach collection="wards" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="medoups !=null and medoups.size()!=0 ">
|
|
|
- AND mu.group_id in
|
|
|
- <foreach collection="medoups" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+
|
|
|
<if test="doctorIds !=null and doctorIds.size()!=0 ">
|
|
|
- AND a.doctor_id in
|
|
|
+ AND (a.doctor_id in
|
|
|
<foreach collection="doctorIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ <if test="depts !=null and depts.size()!=0 and(medoups!=null and medoups.size==0)">
|
|
|
+ or a.beh_dept_id in
|
|
|
+ <foreach collection="depts" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
) a
|
|
|
JOIN med_check_info b ON a.behospital_code = b.behospital_code
|
|
@@ -416,12 +413,6 @@
|
|
|
<if test="behospitalCode != null and behospitalCode != ''">
|
|
|
AND mbi.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
</if>
|
|
|
- <if test="depts !=null and depts.size > 0">
|
|
|
- and mbi.beh_dept_id in
|
|
|
- <foreach collection="depts" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
<if test="smallDay != null">
|
|
|
<![CDATA[ AND mhp.behospital_day_num >= #{smallDay}]]>
|
|
|
</if>
|
|
@@ -447,11 +438,19 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="doctorIds !=null and doctorIds.size > 0">
|
|
|
- and mbi.doctor_id IN
|
|
|
+ and (mbi.doctor_id IN
|
|
|
<foreach collection="doctorIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ <if test="depts !=null and depts.size > 0 and (medoups!=null and medoups.size==0)">
|
|
|
+ or mbi.beh_dept_id in
|
|
|
+ <foreach collection="depts" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
+
|
|
|
<if test="wards !=null and wards.size > 0">
|
|
|
AND mbi.ward_code IN
|
|
|
<foreach collection="wards" item="item" open="(" close=")" separator=",">
|