Quellcode durchsuchen

Merge branch '20210512_yw_check' into test

songxinlu vor 4 Jahren
Ursprung
Commit
b9bca24a7a

+ 4 - 6
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -268,13 +268,11 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             }
             res.put("result", qcResultDTO);
             //增加该病历是否核查状态
-            Map<String, Object> mapAll = new HashMap<String, Object>();
-            mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
-            mapAll.put("behospital_code", getDetailVO.getBehospitalCode());
-            mapAll.put("hospital_id", hospitalId);
-            mapAll.put("check_type", 0);
             QueryWrapper<MedCheckInfo> medCheckInfoQuerys = new QueryWrapper<>();
-            medCheckInfoQuerys.allEq(mapAll);
+            medCheckInfoQuerys.eq("is_deleted", IsDeleteEnum.N.getKey());
+            medCheckInfoQuerys.eq("behospital_code", getDetailVO.getBehospitalCode());
+            medCheckInfoQuerys.eq("hospital_id", hospitalId);
+            medCheckInfoQuerys.in("check_type", 0, 2);
             int count = medCheckInfoFacade.count(medCheckInfoQuerys);
             if (count > 0) {
                 res.put("checkStatus", 1);

+ 4 - 4
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -63,7 +63,7 @@
         AND e.is_deleted = 'N'
         and e.cases_id = 243
         ) t
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
         ON t.behospital_code = g.behospital_code
         AND t.hospital_id = g.hospital_id
         LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
@@ -1034,7 +1034,7 @@
         WHERE d.is_deleted = 'N'
         AND d.user_id = #{userId}
         ) t
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
         ON t.behospital_code = g.behospital_code
         AND t.hospital_id = g.hospital_id
         LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
@@ -1166,7 +1166,7 @@
         or   a.beh_doctor_name = u1.linkman
         or   a.director_doctor_name =  u1.linkman
         ) t
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
         ON t.behospital_code = g.behospital_code
         AND t.hospital_id = g.hospital_id
         LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
@@ -1258,7 +1258,7 @@
         left join med_home_page c
         on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
         ) t
-        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
         ON t.behospital_code = g.behospital_code
         AND t.hospital_id = g.hospital_id
         LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h

+ 8 - 2
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -169,7 +169,7 @@
                 </if>
 
         ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
-        and a.hospital_id = b.hospital_id and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id and b.is_deleted = 'N' and  b.`value` is not null
     </select>
 
 
@@ -220,12 +220,18 @@
             <if test="checkId !=null and checkId != ''">
                 and b.check_id = #{checkId}
             </if>
-            <if test="deptList !=null and deptList.size()!=0">
+            <if test="deptList !=null and deptList.size()!=0 and jobType==0">
                 and a.beh_dept_id in
                 <foreach collection="deptList" item="item" open="(" close=")" separator=",">
                     #{item}
                 </foreach>
             </if>
+            <if test="deptList !=null and deptList.size()!=0 and jobType==2">
+                and a.beh_dept_id not in
+                <foreach collection="deptList" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
         ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
         and a.hospital_id = b.hospital_id and b.is_deleted = 'N'
     </select>