Quellcode durchsuchen

出院/入院人数统计

chengyao vor 4 Jahren
Ursprung
Commit
3025878e15

+ 0 - 25
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -375,31 +375,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     @Override
     public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPage(qcResultShortPageVO);
-        List<QcResultShortDTO> records = qcResultShortDTOIPage.getRecords();
-        if (CollectionUtils.isEmpty(records)) {
-            return qcResultShortDTOIPage;
-        }
-        String hospitalId = qcResultShortPageVO.getHospitalId();
-        Set<String> behospitalCodes = new HashSet<String>();
-        for (QcResultShortDTO record : records) {
-            if (StringUtils.isEmpty(record.getAge())) {
-                String behospitalCode = record.getBehospitalCode();
-                behospitalCodes.add(behospitalCode);
-            }
-        }
-        //目标数据个数与年龄数据为空个数对比,匹配上说明年龄字段从单独sql查出
-        if (records.size() == behospitalCodes.size()) {
-            List<Map<String, Object>> mapLists = baseMapper.getAge(hospitalId, behospitalCodes);
-            for (Map<String, Object> mapList : mapLists) {
-                for (QcResultShortDTO record : records) {
-                    if (record.getBehospitalCode().equals(mapList.get("behospitalCode"))) {
-                        record.setAge(String.valueOf(mapList.get("age")));
-                    }
-                }
-            }
-        }
-
-
         return qcResultShortDTOIPage;
 
     }

+ 7 - 2
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -5264,7 +5264,8 @@
         t1.mrName,
         t1.chTime,
         t1.mrTime,
-         t1.file_code AS fileCode
+        t2.age,
+        t1.file_code AS fileCode
         FROM
         (
         SELECT be.*,
@@ -5405,13 +5406,17 @@
         </if>
         <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
             , med_medical_record b,
-            med_medical_record_content c
+            med_medical_record_content c,
+            med_home_page t2
             WHERE
             b.is_deleted = 'N'
             and c.is_deleted = 'N'
+            and t2.is_deleted = 'N'
             and t1.hospital_id = b.hospital_id
             and t1.hospital_id = c.hospital_id
+            and t1.hospital_id = t2.hospital_id
             AND t1.behospital_code = b.behospital_code
+            AND t1.behospital_code = t2.behospital_code
             AND b.rec_id = c.rec_id
             and b.mode_id = '24'
         </if>