Prechádzať zdrojové kódy

稽查缺陷名称bug处理

chengyao 4 rokov pred
rodič
commit
64fd05eb92

+ 162 - 41
src/main/java/com/diagbot/dto/MedicalCheckDTO.java

@@ -16,7 +16,7 @@ import java.util.Map;
  */
 @Getter
 @Setter
-public class MedicalCheckDTO extends Object {
+public class MedicalCheckDTO{
 
     //科室名称
     private String deptName;
@@ -27,63 +27,184 @@ public class MedicalCheckDTO extends Object {
     //医生
     private String doctorName;
 
-    //入院记录未24小时内
-    private Integer ryjlw_24 = 0;
+    //入院记录未24小时内_id
+    private String entry_2658_id;
 
-    //首次病程记录未8小时内
-    private Integer scbcjlw_8h = 0;
+    //入院记录未24小时内_name
+    private String entry_2658_name;
 
-    //副主任/主任医师首次查房72小时内未完成
-    private Integer zrsccfw_72h = 0;
+    //入院记录未24小时内_num
+    private Integer entry_2658_num = 0;
 
-    //入院后未连记3天病程
-    private Integer ryhljbcw_3d = 0;
+    //首次病程记录未8小时内_id
+    private String entry_2686_id;
 
-    //每周未至少2次副主任/主任医师查房
-    private Integer zrcfw_2w = 0;
+    //首次病程记录未8小时内_name
+    private String entry_2686_name;
 
-    //每周未至少3次主治医师查房记录
-    private Integer zzcfw_3w = 0;
+    //首次病程记录未8小时内_num
+    private Integer entry_2686_num = 0;
 
-    //抢救记录未6小时内完成
-    private Integer qjjlw_6h = 0;
+    //副主任/主任医师首次查房72小时内未完成_id
+    private String entry_2657_id;
 
-    //会诊记录在会诊申请后未24小时完成
-    private Integer hzjlw_24h = 0;
+    //副主任/主任医师首次查房72小时内未完成_name
+    private String entry_2657_name;
 
-    //术前讨论、术前小结未完成
-    private Integer sqtlxjw = 0;
+    //副主任/主任医师首次查房72小时内未完成_num
+    private Integer entry_2657_num = 0;
 
-    //手术记录术后24小时内未完成
-    private Integer sxjlsw_24h = 0;
+    //入院后未连记3天病程_id
+    private String entry_3010_id;
 
-    //术后首程在术后30分钟内未完成
-    private Integer xhscw_30m = 0;
+    //入院后未连记3天病程_name
+    private String entry_3010_name;
 
-    //术后主刀查房24小时内未完成
-    private Integer shzdcfw_24h = 0;
+    //入院后未连记3天病程_num
+    private Integer entry_3010_num = 0;
 
-    //术后未连记3天病程
-    private Integer shjbcw_3d = 0;
+    //每周未至少2次副主任/主任医师查房_id
+    private String entry_2655_id;
 
-    //转科后未连记3天病程
-    private Integer zkjbcw_3d = 0;
+    //每周未至少2次副主任/主任医师查房_name
+    private String entry_2655_name;
 
-    //转接科记录专科后24小时内未完成
-    private Integer zkjlw_24 = 0;
+    //每周未至少2次副主任/主任医师查房_num
+    private Integer entry_2655_num = 0;
 
-    //病危/重患者未每日记录病程
-    private Integer bwzhjlbcw_md = 0;
+    //每周未至少3次主治医师查房记录_id
+    private String entry_2654_id;
 
-    //输血后未完成输血记录
-    private Integer sxhwjl = 0;
+    //每周未至少3次主治医师查房记录_name
+    private String entry_2654_name;
 
-    //24小时未完成输血后评价
-    private Integer sxpjw_24 = 0;
+    //每周未至少3次主治医师查房记录_num
+    private Integer entry_2654_num = 0;
 
-    //危急值未记录
-    private Integer wjzwjl = 0;
+    //抢救记录未6小时内完成_id
+    private String entry_2852_id;
 
-    //住院30天未阶段小结
-    private Integer wywwcxj = 0;
+    //抢救记录未6小时内完成_name
+    private String entry_2852_name;
+
+    //抢救记录未6小时内完成-num
+    private Integer entry_2852_num = 0;
+
+    //会诊记录在会诊申请后未24小时完成_id
+    private String entry_2287_id;
+
+    //会诊记录在会诊申请后未24小时完成_name
+    private String entry_2287_name;
+
+    //会诊记录在会诊申请后未24小时完成_num
+    private Integer entry_2287_num = 0;
+
+    //术前讨论、术前小结未完成_id
+    private String entry_3025_id;
+
+    //术前讨论、术前小结未完成_name
+    private String entry_3025_name;
+
+    //术前讨论、术前小结未完成_num
+    private Integer entry_3025_num = 0;
+
+    //手术记录术后24小时内未完成_id
+    private String entry_2170_id;
+
+    //手术记录术后24小时内未完成_name
+    private String entry_2170_name;
+
+    //手术记录术后24小时内未完成_num
+    private Integer entry_2170_num = 0;
+
+    //术后首程在术后30分钟内未完成_id
+    private String entry_2930_id;
+
+    //术后首程在术后30分钟内未完成_name
+    private String entry_2930_name;
+
+    //术后首程在术后30分钟内未完成_num
+    private Integer entry_2930_num = 0;
+
+    //术后主刀查房24小时内未完成_id
+    private String entry_2900_id;
+
+    //术后主刀查房24小时内未完成_name
+    private String entry_2900_name;
+
+    //术后主刀查房24小时内未完成_num
+    private Integer entry_2900_num = 0;
+
+    //术后未连记3天病程_id
+    private String entry_2229_id;
+
+    //术后未连记3天病程_name
+    private String entry_2229_name;
+
+    //术后未连记3天病程_num
+    private Integer entry_2229_num = 0;
+
+    //转科后未连记3天病程_id
+    private String entry_2217_id;
+
+    //转科后未连记3天病程_name
+    private String entry_2217_name;
+
+    //转科后未连记3天病程_num
+    private Integer entry_2217_num = 0;
+
+    //转接科记录专科后24小时内未完成_id
+    private String entry_2218_id;
+
+    //转接科记录专科后24小时内未完成_name
+    private String entry_2218_name;
+
+    //转接科记录专科后24小时内未完成_num
+    private Integer entry_2218_num = 0;
+
+    //病危/重患者未每日记录病程_id
+    private String entry_2220_id;
+
+    //病危/重患者未每日记录病程_name
+    private String entry_2220_name;
+
+    //病危/重患者未每日记录病程_num
+    private Integer entry_2220_num = 0;
+
+    //输血后未完成输血记录_id
+    private String entry_2486_id;
+
+    //输血后未完成输血记录_name
+    private String entry_2486_name;
+
+    //输血后未完成输血记录_num
+    private Integer entry_2486_num = 0;
+
+    //24小时未完成输血后评价_id
+    private String entry_3063_id;
+
+    //24小时未完成输血后评价_name
+    private String entry_3063_name;
+
+    //24小时未完成输血后评价_num
+    private Integer entry_3063_num = 0;
+
+    //危急值未记录_id
+    private String entry_3062_id;
+
+    //危急值未记录_name
+    private String entry_3062_name;
+
+    //危急值未记录_num
+    private Integer entry_3062_num = 0;
+
+    //住院30天未阶段小结_id
+    private String entry_2495_id;
+
+    //住院30天未阶段小结_name
+    private String entry_2495_name;
+
+    //住院30天未阶段小结_num
+    private Integer entry_2495_num = 0;
 }
+

+ 18 - 0
src/main/java/com/diagbot/dto/MedicalCheckIdNameDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalCheckIdNameDTO {
+
+    private String id;
+    private String name;
+}
+

+ 25 - 3
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -1315,7 +1315,29 @@ public class ConsoleFacade {
      */
     public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO) {
         filterFacade.getMedicalCheckVOSet(filterVO);
-        IPage<MedicalCheckDTO> medicalCheck = behospitalInfoFacade.getMedicalCheck(filterVO);
+        //colums
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", filterVO.getHospitalId())
+                .eq("code", "medical_check_form");
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+
+        //表头生成
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+
+        //目标条目
+        List<Long> casesEntryIds = Lists.newArrayList();
+        //遍历第一个条目
+        for (String valueStr : columnSet) {
+            if (StringUtil.isBlank(valueStr)) {
+                continue;
+            }
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                casesEntryIds.add(Long.valueOf(keyValue[0]));
+            }
+        }
+        IPage<MedicalCheckDTO> medicalCheck = behospitalInfoFacade.getMedicalCheck(filterVO,casesEntryIds);
         return medicalCheck;
     }
 
@@ -1358,7 +1380,7 @@ public class ConsoleFacade {
         orderNo++;
         ColumnDTO columnMedicalName = new ColumnDTO();
         columnMedicalName.setOrderNo(orderNo);
-        columnMedicalName.setFieldName("medicalName");
+        columnMedicalName.setFieldName("doctorName");
         columnMedicalName.setColumnName("医疗组");
         columnMedicalName.setIsShow(1);
         columns.add(columnMedicalName);
@@ -1369,7 +1391,7 @@ public class ConsoleFacade {
                 ColumnDTO columnNum = new ColumnDTO();
                 columnNum.setOrderNo(orderNo);
                 columnNum.setId(Long.valueOf(keyValue[0]));
-                columnNum.setFieldName("entry_" + keyValue[0] + "_num");
+                columnNum.setFieldName("entry_" + keyValue[0] + "_name");
                 columnNum.setColumnName(keyValue[1]);
                 columnNum.setIsShow(1);
                 columns.add(columnNum);

+ 2 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -332,6 +332,8 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<MedicalCheckDTO>  getMedicalCheck(@Param("filterVO")FilterMedicalCheckVO filterVO);
 
+    public List<MedicalCheckIdNameDTO>  getMedicalEntryIds(@Param("casesEntryIds")List<Long> casesEntryIds);
+
     /**
      * 病历稽查表导出
      *

+ 1 - 1
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -313,7 +313,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * 病历稽查表
      * @return
      */
-    IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO);
+    IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
 
     /**
      * 病历稽查表导出

+ 93 - 3
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -1,11 +1,13 @@
 package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.mapper.BehospitalInfoMapper;
 import com.diagbot.service.BehospitalInfoService;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.*;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -463,8 +465,97 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO) {
-        return baseMapper.getMedicalCheck(filterVO);
+    public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds) {
+        IPage<MedicalCheckDTO> medicalCheck = baseMapper.getMedicalCheck(filterVO);
+        List<MedicalCheckIdNameDTO> medicalEntryIds = baseMapper.getMedicalEntryIds(casesEntryIds);
+
+        List<MedicalCheckDTO> records = medicalCheck.getRecords();
+        for (MedicalCheckDTO record : records) {
+            for (MedicalCheckIdNameDTO medicalEntryId : medicalEntryIds) {
+                if ("2170".equals(medicalEntryId.getId())) {
+                    record.setEntry_2170_id(medicalEntryId.getId());
+                    record.setEntry_2170_name(medicalEntryId.getName());
+                }
+                if ("2217".equals(medicalEntryId.getId())) {
+                    record.setEntry_2217_id(medicalEntryId.getId());
+                    record.setEntry_2217_name(medicalEntryId.getName());
+                }
+                if ("2218".equals(medicalEntryId.getId())) {
+                    record.setEntry_2218_id(medicalEntryId.getId());
+                    record.setEntry_2218_name(medicalEntryId.getName());
+                }
+                if ("2220".equals(medicalEntryId.getId())) {
+                    record.setEntry_2220_id(medicalEntryId.getId());
+                    record.setEntry_2220_name(medicalEntryId.getName());
+                }
+                if ("2229".equals(medicalEntryId.getId())) {
+                    record.setEntry_2229_id(medicalEntryId.getId());
+                    record.setEntry_2229_name(medicalEntryId.getName());
+                }
+                if ("2287".equals(medicalEntryId.getId())) {
+                    record.setEntry_2287_id(medicalEntryId.getId());
+                    record.setEntry_2287_name(medicalEntryId.getName());
+                }
+                if ("2486".equals(medicalEntryId.getId())) {
+                    record.setEntry_2486_id(medicalEntryId.getId());
+                    record.setEntry_2486_name(medicalEntryId.getName());
+                }
+                if ("2495".equals(medicalEntryId.getId())) {
+                    record.setEntry_2495_id(medicalEntryId.getId());
+                    record.setEntry_2495_name(medicalEntryId.getName());
+                }
+                if ("2654".equals(medicalEntryId.getId())) {
+                    record.setEntry_2654_id(medicalEntryId.getId());
+                    record.setEntry_2654_name(medicalEntryId.getName());
+                }
+                if ("2655".equals(medicalEntryId.getId())) {
+                    record.setEntry_2655_id(medicalEntryId.getId());
+                    record.setEntry_2655_name(medicalEntryId.getName());
+                }
+                if ("2657".equals(medicalEntryId.getId())) {
+                    record.setEntry_2657_id(medicalEntryId.getId());
+                    record.setEntry_2657_name(medicalEntryId.getName());
+                }
+                if ("2658".equals(medicalEntryId.getId())) {
+                    record.setEntry_2658_id(medicalEntryId.getId());
+                    record.setEntry_2658_name(medicalEntryId.getName());
+                }
+                if ("2686".equals(medicalEntryId.getId())) {
+                    record.setEntry_2686_id(medicalEntryId.getId());
+                    record.setEntry_2686_name(medicalEntryId.getName());
+                }
+                if ("2852".equals(medicalEntryId.getId())) {
+                    record.setEntry_2852_id(medicalEntryId.getId());
+                    record.setEntry_2852_name(medicalEntryId.getName());
+                }
+                if ("2900".equals(medicalEntryId.getId())) {
+                    record.setEntry_2900_id(medicalEntryId.getId());
+                    record.setEntry_2900_name(medicalEntryId.getName());
+                }
+                if ("2930".equals(medicalEntryId.getId())) {
+                    record.setEntry_2930_id(medicalEntryId.getId());
+                    record.setEntry_2930_name(medicalEntryId.getName());
+                }
+                if ("3010".equals(medicalEntryId.getId())) {
+                    record.setEntry_3010_id(medicalEntryId.getId());
+                    record.setEntry_3010_name(medicalEntryId.getName());
+                }
+                if ("3025".equals(medicalEntryId.getId())) {
+                    record.setEntry_3025_id(medicalEntryId.getId());
+                    record.setEntry_3025_name(medicalEntryId.getName());
+                }
+                if ("3062".equals(medicalEntryId.getId())) {
+                    record.setEntry_3062_id(medicalEntryId.getId());
+                    record.setEntry_3062_name(medicalEntryId.getName());
+                }
+                if ("3063".equals(medicalEntryId.getId())) {
+                    record.setEntry_3063_id(medicalEntryId.getId());
+                    record.setEntry_3063_name(medicalEntryId.getName());
+                }
+            }
+        }
+
+        return medicalCheck;
 
     }
 
@@ -482,7 +573,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
 
-
     /**
      * 未整改病历质控评分页(内页)
      *

+ 144 - 95
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -41,7 +41,7 @@
 
     <select id="getPage" resultType="com.diagbot.dto.BehospitalInfoDTO">
         SELECT * FROM (
-        select   t.*,
+        select t.*,
         CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
         CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
         g.check_type AS ch_type,
@@ -415,10 +415,10 @@
             AND p.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  p.ch_name  like CONCAT('%',#{chName},'%')
+            AND p.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND p.mr_name  like CONCAT('%',#{mrName},'%')
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
@@ -526,10 +526,10 @@
             AND p.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  p.ch_name  like CONCAT('%',#{chName},'%')
+            AND p.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND p.mr_name  like CONCAT('%',#{mrName},'%')
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
@@ -636,10 +636,10 @@
             AND p.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  p.ch_name  like CONCAT('%',#{chName},'%')
+            AND p.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND p.mr_name  like CONCAT('%',#{mrName},'%')
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
@@ -1697,7 +1697,8 @@
     </select>
 
     <!-- 各科室缺陷占比(组合)-全院-根据内外科系统统计(台州) -->
-    <select id="levelStatisticsByDeptClass_TZ" parameterType="com.diagbot.vo.FilterOrderVO" resultType="com.diagbot.dto.LevelStatisticsTZDTO">
+    <select id="levelStatisticsByDeptClass_TZ" parameterType="com.diagbot.vo.FilterOrderVO"
+            resultType="com.diagbot.dto.LevelStatisticsTZDTO">
         SELECT
         t1.deptId,
         t1.deptName,
@@ -2070,10 +2071,12 @@
         h1.mrNum,
         h2.entryNum,
         h1.mrNum * h2.entryNum AS entryTotleNum,
-        ROUND( ( h1.mrNum * h2.entryNum  - h1.emptyNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS emptyPercent,
-        ROUND( ( h1.mrNum * h2.entryNum  - h1.errorNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS errorPercent,
-        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS emptyPercentStr,
-        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS errorPercentStr
+        ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS emptyPercent,
+        ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS errorPercent,
+        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS
+        emptyPercentStr,
+        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS
+        errorPercentStr
         FROM
         (
         SELECT
@@ -2568,8 +2571,10 @@
         h1.mrNum * h2.entryNum AS entryTotleNum,
         ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS emptyPercent,
         ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS errorPercent,
-        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS emptyPercentStr,
-        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS errorPercentStr
+        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS
+        emptyPercentStr,
+        CONCAT( ROUND( ( h1.mrNum * h2.entryNum - h1.errorNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ), '%' ) AS
+        errorPercentStr
         FROM
         (
         SELECT
@@ -2947,10 +2952,10 @@
             AND tu.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  tu.ch_name  like CONCAT('%',#{chName},'%')
+            AND tu.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND tu.mr_name  like CONCAT('%',#{mrName},'%')
+            AND tu.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and tu.ch_time >= #{chTimeStart}]]>
@@ -2967,7 +2972,7 @@
     </select>
 
     <!-- 科室质控评分导出到excel-->
-    <select  id="exportQcresultByDept" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
+    <select id="exportQcresultByDept" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
         SELECT * FROM (
         SELECT tp.*,CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
         CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
@@ -3158,10 +3163,10 @@
             AND tu.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  tu.ch_name  like CONCAT('%',#{chName},'%')
+            AND tu.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND tu.mr_name  like CONCAT('%',#{mrName},'%')
+            AND tu.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and tu.ch_time >= #{chTimeStart}]]>
@@ -3178,7 +3183,7 @@
     </select>
 
     <!-- 医疗组质控评分导出到excel-->
-    <select  id="exportQcresultByGroup" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
+    <select id="exportQcresultByGroup" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
         SELECT * FROM (
         SELECT tp.*,CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
         CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
@@ -3375,10 +3380,10 @@
             AND tu.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
-            AND  tu.ch_name  like CONCAT('%',#{chName},'%')
+            AND tu.ch_name like CONCAT('%',#{chName},'%')
         </if>
         <if test="mrName != null and mrName !=''">
-            AND tu.mr_name  like CONCAT('%',#{mrName},'%')
+            AND tu.mr_name like CONCAT('%',#{mrName},'%')
         </if>
         <if test="chTimeStart != null">
             <![CDATA[ and tu.ch_time >= #{chTimeStart}]]>
@@ -3776,7 +3781,7 @@
     </select>
 
     <update id="updateBatchByKey">
-        <foreach collection="list" item="item"  separator=";">
+        <foreach collection="list" item="item" separator=";">
             update med_behospital_info
             <set>
                 <if test="item.name != null">
@@ -3866,7 +3871,8 @@
     </update>
 
     <!-- 关键条目缺陷统计报表-->
-    <select id="entryStatistics" parameterType="com.diagbot.vo.EntryStatisticsVO" resultType="com.diagbot.dto.EntryStatisticsDTO">
+    <select id="entryStatistics" parameterType="com.diagbot.vo.EntryStatisticsVO"
+            resultType="com.diagbot.dto.EntryStatisticsDTO">
         SELECT
         deptId,
         deptName,
@@ -3891,7 +3897,8 @@
         '术后首次病程未即刻完成' AS operation15MinuteEntryName,
         operation15MinuteNum,
         ROUND( IFNULL( operation15MinuteNum / operationMRNum, 0 ), 4 ) AS operation15MinutePercent,
-        CONCAT( ROUND( IFNULL( operation15MinuteNum / operationMRNum, 0 ) * 100, 2 ), '%' ) AS operation15MinutePercentStr,
+        CONCAT( ROUND( IFNULL( operation15MinuteNum / operationMRNum, 0 ) * 100, 2 ), '%' ) AS
+        operation15MinutePercentStr,
         2419 AS crisisEntryId,
         '危急值记录未在接到危急值报告后6小时内完成' AS crisisEntryName,
         crisisMRNum,
@@ -4608,7 +4615,8 @@
     </select>
 
     <!-- 病案首页完整率统计-全院(首页)-->
-    <select id="hmEmptyEntryPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.HomePageNumDTO">
+    <select id="hmEmptyEntryPercent" parameterType="com.diagbot.vo.FilterVO"
+            resultType="com.diagbot.dto.HomePageNumDTO">
         SELECT
         h1.emptyNum,
         h1.mrNum,
@@ -4864,7 +4872,7 @@
             med_medical_record_content c
             WHERE
             b.is_deleted = 'N'
-            and	c.is_deleted = 'N'
+            and c.is_deleted = 'N'
             and t1.hospital_id = b.hospital_id
             and t1.hospital_id = c.hospital_id
             AND t1.behospital_code = b.behospital_code
@@ -4916,7 +4924,8 @@
     </select>
 
     <!-- 病案首页改善率统计(首页)-->
-    <select id="homePageImproveCount" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.HomePageImproveDTO">
+    <select id="homePageImproveCount" parameterType="com.diagbot.vo.FilterVO"
+            resultType="com.diagbot.dto.HomePageImproveDTO">
         SELECT
         t2.homePageMRNum,
         t1.improveNum,
@@ -5070,7 +5079,8 @@
     </select>
 
     <!-- 质控核查统计(内页)-->
-    <select id="qcCheckStatistics" parameterType="com.diagbot.vo.FilterOrderVO" resultType="com.diagbot.dto.HomePageImproveDTO">
+    <select id="qcCheckStatistics" parameterType="com.diagbot.vo.FilterOrderVO"
+            resultType="com.diagbot.dto.HomePageImproveDTO">
         SELECT
         t.*
         FROM
@@ -6419,29 +6429,29 @@
     </select>
 
     <resultMap id="MedicalCheckMap" type="com.diagbot.dto.MedicalCheckDTO">
-                <result column="deptName" property="deptName"/>
-                <result column="deptId" property="deptId"/>
-                <result column="doctorName" property="doctorName"/>
-                <result column="RYJLW_24" property="ryjlw_24"/>
-                <result column="SCBCJLW_8H" property="scbcjlw_8h"/>
-                <result column="ZRSCCFW_72H" property="zrsccfw_72h"/>
-                <result column="RYHLJBCW_3D" property="ryhljbcw_3d"/>
-                <result column="ZRCFW_2W" property="zrcfw_2w"/>
-                <result column="ZZCFW_3W" property="zzcfw_3w"/>
-                <result column="QJJLW_6H" property="qjjlw_6h"/>
-                <result column="HZJLW_24H" property="hzjlw_24h"/>
-                <result column="SQTLXJW" property="sqtlxjw"/>
-                <result column="SXJLSW_24H" property="sxjlsw_24h"/>
-                <result column="XHSCW_30M" property="xhscw_30m"/>
-                <result column="SHZDCFW_24H" property="shzdcfw_24h"/>
-                <result column="SHJBCW_3D" property="shjbcw_3d"/>
-                <result column="ZKJBCW_3D" property="zkjbcw_3d"/>
-                <result column="ZKJLW_24" property="zkjlw_24"/>
-                <result column="BWZHJLBCW_MD" property="bwzhjlbcw_md"/>
-                <result column="SXHWJL" property="sxhwjl"/>
-                <result column="SXPJW_24" property="sxpjw_24"/>
-                <result column="WJZWJL" property="wjzwjl"/>
-                <result column="WYWWCXJ" property="wywwcxj"/>
+        <result column="deptName" property="deptName"/>
+        <result column="deptId" property="deptId"/>
+        <result column="doctorName" property="doctorName"/>
+        <result column="entry_2658_num" property="entry_2658_num"/>
+        <result column="entry_2686_num" property="entry_2686_num"/>
+        <result column="entry_2657_num" property="entry_2657_num"/>
+        <result column="entry_3010_num" property="entry_3010_num"/>
+        <result column="entry_2655_num" property="entry_2655_num"/>
+        <result column="entry_2654_num" property="entry_2654_num"/>
+        <result column="entry_2852_num" property="entry_2852_num"/>
+        <result column="entry_2287_num" property="entry_2287_num"/>
+        <result column="entry_3025_num" property="entry_3025_num"/>
+        <result column="entry_2170_num" property="entry_2170_num"/>
+        <result column="entry_2930_num" property="entry_2930_num"/>
+        <result column="entry_2900_num" property="entry_2900_num"/>
+        <result column="entry_2229_num" property="entry_2229_num"/>
+        <result column="entry_2217_num" property="entry_2217_num"/>
+        <result column="entry_2218_num" property="entry_2218_num"/>
+        <result column="entry_2220_num" property="entry_2220_num"/>
+        <result column="entry_2486_num" property="entry_2486_num"/>
+        <result column="entry_3063_num" property="entry_3063_num"/>
+        <result column="entry_3062_num" property="entry_3062_num"/>
+        <result column="entry_2495_num" property="entry_2495_num"/>
     </resultMap>
 
     <!--    病历稽查表最新sql-->
@@ -6450,26 +6460,26 @@
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName,
         a.doctor_name as doctorName,
-        sum(c.cases_entry_id = 2658) as RYJLW_24,
-        sum(c.cases_entry_id = 2686) as SCBCJLW_8H,
-        sum(c.cases_entry_id = 2657) as ZRSCCFW_72H,
-        sum(c.cases_entry_id = 3010) as RYHLJBCW_3D,
-        sum(c.cases_entry_id = 2655) as ZRCFW_2W,
-        sum(c.cases_entry_id = 2654) as ZZCFW_3W,
-        sum(c.cases_entry_id = 2852) as QJJLW_6H,
-        sum(c.cases_entry_id = 2287) as HZJLW_24H,
-        sum(c.cases_entry_id = 3025) as SQTLXJW,
-        sum(c.cases_entry_id = 2170) as SXJLSW_24H,
-        sum(c.cases_entry_id = 2930) as XHSCW_30M,
-        sum(c.cases_entry_id = 2900) as SHZDCFW_24H,
-        sum(c.cases_entry_id = 2229) as SHJBCW_3D,
-        sum(c.cases_entry_id = 2217) as ZKJBCW_3D,
-        sum(c.cases_entry_id = 2218) as ZKJLW_24,
-        sum(c.cases_entry_id = 2220) as BWZHJLBCW_MD,
-        sum(c.cases_entry_id = 2486) as SXHWJL,
-        sum(c.cases_entry_id = 3063) as SXPJW_24,
-        sum(c.cases_entry_id = 3062) as WJZWJL,
-        sum(c.cases_entry_id = 2495) as WYWWCXJ
+        sum(c.cases_entry_id = 2658) as entry_2658_num,
+        sum(c.cases_entry_id = 2686) as entry_2686_num,
+        sum(c.cases_entry_id = 2657) as entry_2657_num,
+        sum(c.cases_entry_id = 3010) as entry_3010_num,
+        sum(c.cases_entry_id = 2655) as entry_2655_num,
+        sum(c.cases_entry_id = 2654) as entry_2654_num,
+        sum(c.cases_entry_id = 2852) as entry_2852_num,
+        sum(c.cases_entry_id = 2287) as entry_2287_num,
+        sum(c.cases_entry_id = 3025) as entry_3025_num,
+        sum(c.cases_entry_id = 2170) as entry_2170_num,
+        sum(c.cases_entry_id = 2930) as entry_2930_num,
+        sum(c.cases_entry_id = 2900) as entry_2900_num,
+        sum(c.cases_entry_id = 2229) as entry_2229_num,
+        sum(c.cases_entry_id = 2217) as entry_2217_num,
+        sum(c.cases_entry_id = 2218) as entry_2218_num,
+        sum(c.cases_entry_id = 2220) as entry_2220_num,
+        sum(c.cases_entry_id = 2486) as entry_2486_num,
+        sum(c.cases_entry_id = 3063) as entry_3063_num,
+        sum(c.cases_entry_id = 3062) as entry_3062_num,
+        sum(c.cases_entry_id = 2495) as entry_2495_num
         FROM
         med_behospital_info a,
         med_qcresult_info b,
@@ -6523,11 +6533,29 @@
         a.doctor_id
     </select>
 
+    <!--    病历稽查表最新sql、id&&name-->
+    <select id="getMedicalEntryIds" resultType="com.diagbot.dto.MedicalCheckIdNameDTO">
+        SELECT
+        d.id,
+        d.name
+        from
+        qc_cases_entry d
+        where
+        1=1
+        <if test="casesEntryIds != null and casesEntryIds.size() > 0">
+            and d.id in
+            <foreach collection="casesEntryIds" open="(" separator="," close=")" item="item">
+                '${item}'
+            </foreach>
+        </if>
+    </select>
     <resultMap id="MedicalCheckExcelMap" type="com.diagbot.dto.MedicalCheckExportDTO">
         <result column="deptName" property="deptName"/>
-        <collection property="medicalDoctorExportDTOS" javaType="ArrayList" ofType="com.diagbot.dto.MedicalDoctorExportDTO">
+        <collection property="medicalDoctorExportDTOS" javaType="ArrayList"
+                    ofType="com.diagbot.dto.MedicalDoctorExportDTO">
             <result column="doctorName" property="doctorName"/>
-            <collection property="medicalCheckTitleDTOS" javaType="ArrayList" ofType="com.diagbot.dto.MedicalCheckTitleDTO">
+            <collection property="medicalCheckTitleDTOS" javaType="ArrayList"
+                        ofType="com.diagbot.dto.MedicalCheckTitleDTO">
                 <result column="RYJLW_24" property="ryjlw_24"/>
                 <result column="SCBCJLW_8H" property="scbcjlw_8h"/>
                 <result column="ZRSCCFW_72H" property="zrsccfw_72h"/>
@@ -6558,46 +6586,46 @@
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName,
         GROUP_CONCAT( DISTINCT a.doctor_name) as doctorName,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN  a.behospital_code else null END ) as RYJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN  a.behospital_code else null END ) as SCBCJLW_8H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN  a.behospital_code else null END ) as ZRSCCFW_72H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN  a.behospital_code else null END ) as RYHLJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN  a.behospital_code else null END ) as ZRCFW_2W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN  a.behospital_code else null END ) as ZZCFW_3W,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN  a.behospital_code else null END ) as QJJLW_6H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN  a.behospital_code else null END ) as HZJLW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN  a.behospital_code else null END ) as SQTLXJW,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN  a.behospital_code else null END ) as SXJLSW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN  a.behospital_code else null END ) as XHSCW_30M,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN  a.behospital_code else null END ) as SHZDCFW_24H,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN  a.behospital_code else null END ) as SHJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN  a.behospital_code else null END ) as ZKJBCW_3D,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN  a.behospital_code else null END ) as ZKJLW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN  a.behospital_code else null END ) as BWZHJLBCW_MD,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN  a.behospital_code else null END ) as SXHWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN  a.behospital_code else null END ) as SXPJW_24,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN  a.behospital_code else null END ) as WJZWJL,
-        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN  a.behospital_code else null END ) as WYWWCXJ
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.behospital_code else null END ) as RYJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.behospital_code else null END ) as SCBCJLW_8H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.behospital_code else null END ) as ZRSCCFW_72H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.behospital_code else null END ) as RYHLJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.behospital_code else null END ) as ZRCFW_2W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.behospital_code else null END ) as ZZCFW_3W,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.behospital_code else null END ) as QJJLW_6H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.behospital_code else null END ) as HZJLW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.behospital_code else null END ) as SQTLXJW,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.behospital_code else null END ) as SXJLSW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.behospital_code else null END ) as XHSCW_30M,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.behospital_code else null END ) as SHZDCFW_24H,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.behospital_code else null END ) as SHJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.behospital_code else null END ) as ZKJBCW_3D,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.behospital_code else null END ) as ZKJLW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.behospital_code else null END ) as BWZHJLBCW_MD,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.behospital_code else null END ) as SXHWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.behospital_code else null END ) as SXPJW_24,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.behospital_code else null END ) as WJZWJL,
+        GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.behospital_code else null END ) as WYWWCXJ
+        -- sum(c.cases_entry_id = 2658) as RYJLW_24,
+        -- sum(c.cases_entry_id = 2686) as SCBCJLW_8H,
+        -- sum(c.cases_entry_id = 2657) as ZRSCCFW_72H,
+        -- sum(c.cases_entry_id = 3010) as RYHLJBCW_3D,
+        -- sum(c.cases_entry_id = 2655) as ZRCFW_2W,
+        -- sum(c.cases_entry_id = 2654) as ZZCFW_3W,
+        -- sum(c.cases_entry_id = 2852) as QJJLW_6H,
+        -- sum(c.cases_entry_id = 2287) as HZJLW_24H,
+        -- sum(c.cases_entry_id = 3025) as SQTLXJW,
+        -- sum(c.cases_entry_id = 2170) as SXJLSW_24H,
+        -- sum(c.cases_entry_id = 2930) as XHSCW_30M,
+        -- sum(c.cases_entry_id = 2900) as SHZDCFW_24H,
+        -- sum(c.cases_entry_id = 2229) as SHJBCW_3D,
+        -- sum(c.cases_entry_id = 2217) as ZKJBCW_3D,
+        -- sum(c.cases_entry_id = 2218) as ZKJLW_24,
+        -- sum(c.cases_entry_id = 2220) as BWZHJLBCW_MD,
+        -- sum(c.cases_entry_id = 2486) as SXHWJL,
+        -- sum(c.cases_entry_id = 3063) as SXPJW_24,
+        -- sum(c.cases_entry_id = 3062) as WJZWJL,
+        -- sum(c.cases_entry_id = 2495) as WYWWCXJ
         FROM
         med_behospital_info a,
         med_qcresult_info b,
@@ -6651,7 +6679,8 @@
     </select>
 
     <!-- 未整改病历统计-->
-    <select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO" parameterType="com.diagbot.vo.FilterUnModifyMRVO">
+    <select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO"
+            parameterType="com.diagbot.vo.FilterUnModifyMRVO">
         SELECT
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName,