Browse Source

生成核查和分配核查
如果医疗组是全部默认查询本科室+所有医疗组组员的数据;
选医疗组查本医疗组医生数据

songxinlu 3 years ago
parent
commit
d47026c035

+ 2 - 2
src/main/java/com/diagbot/facade/MedCheckInfoFacade.java

@@ -253,9 +253,9 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
                     checkJobVO.setDoctorIds(basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList()));
                 }
                 //通过主治医生去查,病区、科室、医疗组不作为筛选条件
-                checkJobVO.setDepts(null);
+//                checkJobVO.setDepts(null);
                 checkJobVO.setWards(null);
-                checkJobVO.setMedoups(null);
+//                checkJobVO.setMedoups(null);
                 return getCheckList(checkJobVO);
             }
             return getCheckList(checkJobVO);

+ 2 - 2
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -312,7 +312,7 @@ public class MedCheckWorkFacade {
 //                deptIds.add("999999999999");
 //            }
 //            checkWorkPageVO.setDepartment(deptIds);
-            //如果没有添加医疗组筛选条件默认筛选全部医疗组
+            //如果没有添加医疗组筛选条件默认查询科室所有数据+医疗组所有人数据
             List<String> codes = null;
             if (ListUtil.isEmpty(checkWorkPageVO.getMedoups())) {
                 //获取当前用户科室
@@ -342,7 +342,7 @@ public class MedCheckWorkFacade {
                 checkWorkPageVO.setDoctorIds(basDoctorInfos.stream().map(BasDoctorInfo::getDoctorId).collect(Collectors.toList()));
             }
             //通过主治医生去查,病区、科室、医疗组不作为筛选条件
-            checkWorkPageVO.setDepts(null);
+//            checkWorkPageVO.setDepts(null);
             checkWorkPageVO.setWards(null);
         }
     }

+ 19 - 20
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -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=",">