ソースを参照

Merge remote-tracking branch 'origin/dev/20200903_1.4.5' into innerDevelop

chengyao 4 年 前
コミット
933b2d7fd9
52 ファイル変更2744 行追加637 行削除
  1. 18 0
      doc/022.20200911v1.4.5/qc_initv1.4.5.sql
  2. 10 2
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  3. 12 2
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  4. 68 0
      src/main/java/com/diagbot/dto/CheckInfoDTO.java
  5. 21 21
      src/main/java/com/diagbot/dto/DoctorAdviceDTO.java
  6. 75 0
      src/main/java/com/diagbot/dto/ExamineInfoDTO.java
  7. 45 0
      src/main/java/com/diagbot/dto/ExamineSonInfoDTO.java
  8. 89 0
      src/main/java/com/diagbot/dto/MedicalCheckDTO.java
  9. 27 0
      src/main/java/com/diagbot/dto/MedicalCheckExportDTO.java
  10. 96 0
      src/main/java/com/diagbot/dto/MedicalCheckTitleDTO.java
  11. 25 0
      src/main/java/com/diagbot/dto/MedicalDoctorExportDTO.java
  12. 122 0
      src/main/java/com/diagbot/enums/MedicalCheckEnum.java
  13. 9 5
      src/main/java/com/diagbot/facade/BehospitalInfoFacade.java
  14. 23 24
      src/main/java/com/diagbot/facade/ConsoleExportFacade.java
  15. 100 41
      src/main/java/com/diagbot/facade/ConsoleFacade.java
  16. 3 0
      src/main/java/com/diagbot/facade/DoctorAdviceFacade.java
  17. 14 11
      src/main/java/com/diagbot/facade/FilterFacade.java
  18. 53 2
      src/main/java/com/diagbot/facade/MedLisInfoFacade.java
  19. 30 2
      src/main/java/com/diagbot/facade/MedPacsInfoFacade.java
  20. 19 27
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  21. 4 1
      src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java
  22. 21 1
      src/main/java/com/diagbot/mapper/MedLisInfoMapper.java
  23. 21 3
      src/main/java/com/diagbot/mapper/MedPacsInfoMapper.java
  24. 0 1
      src/main/java/com/diagbot/mapper/QcresultInfoMapper.java
  25. 17 28
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  26. 7 0
      src/main/java/com/diagbot/service/MedLisInfoService.java
  27. 4 0
      src/main/java/com/diagbot/service/MedPacsInfoService.java
  28. 29 27
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  29. 26 3
      src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java
  30. 82 1
      src/main/java/com/diagbot/service/impl/MedLisInfoServiceImpl.java
  31. 47 3
      src/main/java/com/diagbot/service/impl/MedPacsInfoServiceImpl.java
  32. 10 10
      src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java
  33. 78 0
      src/main/java/com/diagbot/vo/CheckInfoVO.java
  34. 11 0
      src/main/java/com/diagbot/vo/DoctorAdviceVO.java
  35. 80 0
      src/main/java/com/diagbot/vo/ExamineInfoVO.java
  36. 43 0
      src/main/java/com/diagbot/vo/ExamineSonInfoVO.java
  37. 49 0
      src/main/java/com/diagbot/vo/FilterMedicalCheckVO.java
  38. 2 1
      src/main/java/com/diagbot/vo/FilterPageVO.java
  39. 62 0
      src/main/java/com/diagbot/vo/MedLisInfoVO.java
  40. 0 1
      src/main/java/com/diagbot/vo/QcResultShortPageVO.java
  41. 33 24
      src/main/java/com/diagbot/web/ConsoleController.java
  42. 49 8
      src/main/java/com/diagbot/web/ConsoleExportController.java
  43. 60 0
      src/main/java/com/diagbot/web/MedLisInfoController.java
  44. 49 0
      src/main/java/com/diagbot/web/MedPacsInfoController.java
  45. 1 1
      src/main/resources/application-test.yml
  46. 288 55
      src/main/resources/mapper/BehospitalInfoMapper.xml
  47. 108 48
      src/main/resources/mapper/DoctorAdviceMapper.xml
  48. 285 18
      src/main/resources/mapper/MedLisInfoMapper.xml
  49. 52 29
      src/main/resources/mapper/MedLisResultMapper.xml
  50. 142 21
      src/main/resources/mapper/MedPacsInfoMapper.xml
  51. 38 29
      src/main/resources/mapper/MedPacsResultMapper.xml
  52. 187 187
      src/main/resources/mapper/QcresultInfoMapper.xml

ファイルの差分が大きいため隠しています
+ 18 - 0
doc/022.20200911v1.4.5/qc_initv1.4.5.sql


+ 10 - 2
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -62,6 +62,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/page_person").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_group").permitAll()
                 .antMatchers("/qc/casesEntryHospital/findQcCasesEntry").permitAll()
+                .antMatchers("/qc/dataimport/import").permitAll()
+                .antMatchers("/qc/dataimport/test").permitAll()
                 .antMatchers("/qc/behospitalInfo/exportExcel").permitAll()
                 .antMatchers("/qc/behospitalInfo/exportQcresult").permitAll()
                 .antMatchers("/qc/behospitalInfo/exportQcresultByDept").permitAll()
@@ -156,7 +158,13 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/sendHomeOperation").permitAll()
                 .antMatchers("/qc/data/sendCrisis").permitAll()
                 .antMatchers("/qc/doctoradvice/getPage").permitAll()
-                .antMatchers("/qc/behospitalInfo/analyzeCds").permitAll()
+                .antMatchers("/qc/medPacsInfo/getCheckPage").permitAll()
+                .antMatchers("/qc/medLisInfo/getExaminePage").permitAll()
+                .antMatchers("/qc/medLisInfo/getExamineSonPage").permitAll()
+                .antMatchers("/console/medicalCheckForm").permitAll()
+                .antMatchers("/console/medicalCheckTitle").permitAll()
+                .antMatchers("/console/export/medicalCheckExport").permitAll()
+                .antMatchers("/console/export/medicalCheckInnerExport").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }
@@ -188,4 +196,4 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
         log.info("Created jwtTokenEnhancerClient success");
         return converter;
     }
-}
+}

+ 12 - 2
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -106,6 +106,9 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/page_group", request)
                 || matchers("/qc/casesEntryHospital/findQcCasesEntry", request)
                 || matchers("/qc/behospitalInfo/exportExcel", request)
+                || matchers("/qc/dataimport/import", request)
+                || matchers("/qc/dataimport/test", request)
+                || matchers("/qc/behospitalInfo/exportExcel", request)
                 || matchers("/qc/behospitalInfo/exportQcresult", request)
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
                 || matchers("/qc/behospitalInfo/exportQcresultByGroup", request)
@@ -199,13 +202,20 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/data/sendHomeOperation", request)
                 || matchers("/qc/data/sendCrisis", request)
                 || matchers("/qc/doctoradvice/getPage", request)
-                || matchers("/qc/behospitalInfo/analyzeCds", request)
+                || matchers("/qc/medPacsInfo/getCheckPage", request)
+                || matchers("/qc/medLisInfo/getExaminePage", request)
+                || matchers("/qc/medLisInfo/getExamineSonPage", request)
+                || matchers("/console/medicalCheckForm", request)
+                || matchers("/console/medicalCheckTitle", request)
+                || matchers("/console/export/medicalCheckExport", request)
+                || matchers("/console/export/medicalCheckInnerExport", request)
                 || matchers("/", request)) {
             return true;
         }
         return false;
     }
 
+
     private boolean matchers(String url, HttpServletRequest request) {
         AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
         if (matcher.matches(request)) {
@@ -213,4 +223,4 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
         }
         return false;
     }
-}
+}

+ 68 - 0
src/main/java/com/diagbot/dto/CheckInfoDTO.java

@@ -0,0 +1,68 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/03 15:00
+ */
+@Getter
+@Setter
+public class CheckInfoDTO {
+
+    /**
+     * 检查类型判别
+     */
+    private String checkItemType;
+
+    /**
+     * 检查项目名称
+     */
+    private String checkItemName;
+
+    /**
+     * 检查结果
+     */
+    private String checkResult;
+
+    /**
+     * 检查时间
+     */
+    private Date checkTime;
+
+    /**
+     * 报告时间
+     */
+    private Date reptTime;
+
+    /**
+     * 入院时间
+     */
+    @JsonIgnore
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @JsonIgnore
+    private Date leaveHospitalDate;
+
+    /**
+     * 开单医生
+     */
+    private String doctorName;
+
+    /**
+     * 质检提示信息
+     */
+    @JsonIgnore
+    private String info;
+}

+ 21 - 21
src/main/java/com/diagbot/dto/DoctorAdviceDTO.java

@@ -56,25 +56,25 @@ public class DoctorAdviceDTO {
 //     */
 //    private String usageUnit;
 //
-//    /**
-//     * 医嘱单次剂量
-//     */
-//    private String dose;
-//
-//    /**
-//     * 单次剂量单位
-//     */
-//    private String doseUnit;
-//
-//    /**
-//     * 给药方式
-//     */
-//    private String medModeType;
-//
-//    /**
-//     * 医嘱频率
-//     */
-//    private String daFrequency;
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
 //
 //    /**
 //     * 医嘱处理类型
@@ -84,7 +84,7 @@ public class DoctorAdviceDTO {
     /**
      * 医嘱开始时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date daStartDate;
 
     /**
@@ -100,7 +100,7 @@ public class DoctorAdviceDTO {
     /**
      * 医嘱结束时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date daStopDate;
 
 //    /**

+ 75 - 0
src/main/java/com/diagbot/dto/ExamineInfoDTO.java

@@ -0,0 +1,75 @@
+package com.diagbot.dto;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/07 15:00
+ */
+@Getter
+@Setter
+public class ExamineInfoDTO {
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病历号
+     */
+    private String behospitalCode;
+
+    /**
+     * 检验类型判别
+     */
+    private String examineItemType;
+
+    /**
+     * 检验项目名称
+     */
+    private String examineItemName;
+
+
+
+    /**
+     * 返回检查时间
+     */
+    private Date checkTime;
+
+
+    /**
+     * 返回报告时间
+     */
+    private Date reptTime;
+
+    /**
+     * 入院时间
+     */
+    @JsonIgnore
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @JsonIgnore
+    private Date leaveHospitalDate;
+
+    /**
+     * 开单医生
+     */
+    private String doctorName;
+
+    /**
+     * 报告单号
+     */
+    private String repNo;
+
+    /**
+     * 质检提示信息
+     */
+    @JsonIgnore
+    private String info;
+}

+ 45 - 0
src/main/java/com/diagbot/dto/ExamineSonInfoDTO.java

@@ -0,0 +1,45 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/07 15:00
+ */
+@Getter
+@Setter
+public class ExamineSonInfoDTO {
+    /**
+     * 检验项目名称
+     */
+    private String examineItemName;
+
+    /**
+     * 检验结果
+     */
+    private String examineItemResult;
+
+    /**
+     * 返回检验时间
+     */
+    private Date checkTime;
+
+
+    /**
+     * 返回报告时间
+     */
+    private Date reptTime;
+
+    /**
+     * 开单医生
+     */
+    private String doctorName;
+
+}

+ 89 - 0
src/main/java/com/diagbot/dto/MedicalCheckDTO.java

@@ -0,0 +1,89 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalCheckDTO extends Object {
+
+    //科室名称
+    private String deptName;
+
+    //科室id
+    private String deptId;
+
+    //医生
+    private String doctorName;
+
+    //入院记录未24小时内
+    private Integer ryjlw_24 = 0;
+
+    //首次病程记录未8小时内
+    private Integer scbcjlw_8h = 0;
+
+    //副主任/主任医师首次查房72小时内未完成
+    private Integer zrsccfw_72h = 0;
+
+    //入院后未连记3天病程
+    private Integer ryhljbcw_3d = 0;
+
+    //每周未至少2次副主任/主任医师查房
+    private Integer zrcfw_2w = 0;
+
+    //每周未至少3次主治医师查房记录
+    private Integer zzcfw_3w = 0;
+
+    //抢救记录未6小时内完成
+    private Integer qjjlw_6h = 0;
+
+    //会诊记录在会诊申请后未24小时完成
+    private Integer hzjlw_24h = 0;
+
+    //术前讨论、术前小结未完成
+    private Integer sqtlxjw = 0;
+
+    //手术记录术后24小时内未完成
+    private Integer sxjlsw_24h = 0;
+
+    //术后首程在术后30分钟内未完成
+    private Integer xhscw_30m = 0;
+
+    //术后主刀查房24小时内未完成
+    private Integer shzdcfw_24h = 0;
+
+    //术后未连记3天病程
+    private Integer shjbcw_3d = 0;
+
+    //转科后未连记3天病程
+    private Integer zkjbcw_3d = 0;
+
+    //转接科记录专科后24小时内未完成
+    private Integer zkjlw_24 = 0;
+
+    //病危/重患者未每日记录病程
+    private Integer bwzhjlbcw_md = 0;
+
+    //输血后未完成输血记录
+    private Integer sxhwjl = 0;
+
+    //24小时未完成输血后评价
+    private Integer sxpjw_24 = 0;
+
+    //危急值未记录
+    private Integer wjzwjl = 0;
+
+    //住院30天未阶段小结
+    private Integer wywwcxj = 0;
+}

+ 27 - 0
src/main/java/com/diagbot/dto/MedicalCheckExportDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalCheckExportDTO  {
+
+    //科室名称
+    @Excel(name = "科室",width = 18,needMerge = true,orderNum = "1")
+    private String deptName;
+
+    @ExcelCollection(name = "",orderNum = "2")
+    private List<MedicalDoctorExportDTO> medicalDoctorExportDTOS;
+}

+ 96 - 0
src/main/java/com/diagbot/dto/MedicalCheckTitleDTO.java

@@ -0,0 +1,96 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalCheckTitleDTO {
+
+    //入院记录未24小时内
+    @Excel(name = "入院记录24小时内",orderNum = "1")
+    private String ryjlw_24 ;
+
+    //首次病程记录未8小时内
+    @Excel(name = "首次病程记录8小时内",orderNum = "2")
+    private String scbcjlw_8h;
+
+    @Excel( name = "副主任/主任医师首次查房72小时内完成",orderNum = "3")
+    //副主任/主任医师首次查房72小时内未完成
+    private String zrsccfw_72h;
+
+    //入院后未连记3天病程
+    @Excel(name = "入院后连记3天病程(不包括术后首程)",orderNum = "4")
+    private String ryhljbcw_3d;
+
+    //每周至少2次副主任/主任医师查房
+    @Excel(name = "每周至少2次副主任/主任医师查房",orderNum = "5")
+    private String zrcfw_2w;
+
+    //每周至少3次主治医师查房记录
+    @Excel(name = "每周至少3次主治医师查房记录",orderNum = "6")
+    private String zzcfw_3w;
+
+    //抢救记录未6小时内完成
+    @Excel(name = "抢救记录6小时内完成",orderNum = "7")
+    private String qjjlw_6h;
+
+    //会诊记录在会诊申请后未24小时完成
+    @Excel(name = "会诊记录在会诊申请后24小时完成",orderNum = "8")
+    private String hzjlw_24h;
+
+    //术前讨论、术前小结未完成
+    @Excel(name = "术前讨论、术前小结完成",orderNum = "9")
+    private String sqtlxjw;
+
+    //手术记录术后24小时内未完成
+    @Excel(name = "手术记录术后24小时内完成",orderNum = "10")
+    private String sxjlsw_24h;
+
+    //术后首程在术后30分钟内未完成
+    @Excel(name = "术后首程在术后30分钟内完成",orderNum = "11")
+    private String xhscw_30m;
+
+    //术后主刀查房24小时内未完成
+    @Excel(name = "术后主刀查房24小时内完成",orderNum = "12")
+    private String shzdcfw_24h;
+
+    //术后未连记3天病程
+    @Excel(name = "术后连记3天病程(包括术后首程)",orderNum = "13")
+    private String shjbcw_3d;
+
+    //转科后未连记3天病程
+    @Excel(name = "转科后连记3天病程(包括专科记录)",orderNum = "14")
+    private String zkjbcw_3d;
+
+    //转接科记录专科后24小时内未完成
+    @Excel(name = "转接科记录专科后24小时内完成",orderNum = "15")
+    private String zkjlw_24;
+
+    //病危/重患者未每日记录病程
+    @Excel(name = "病危/重患者每日记录病程",orderNum = "16")
+    private String bwzhjlbcw_md;
+
+    //输血后未完成输血记录
+    @Excel(name = "输血后完成输血记录",orderNum = "17")
+    private String sxhwjl;
+
+    //24小时未完成输血后评价
+    @Excel(name = "24小时完成输血后评价",orderNum = "18")
+    private String sxpjw_24;
+
+    //危急值未记录
+    @Excel(name = "危急值记录",orderNum = "19")
+    private String wjzwjl;
+
+    //住院30天未阶段小结
+    @Excel(name = "住院30天阶段小结",orderNum = "20")
+    private String wywwcxj;
+
+}

+ 25 - 0
src/main/java/com/diagbot/dto/MedicalDoctorExportDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:19
+ */
+@Getter
+@Setter
+public class MedicalDoctorExportDTO {
+
+    //医疗组
+    @Excel(name = "医疗组",needMerge = true,orderNum = "1")
+    private String doctorName;
+
+    @ExcelCollection(name = "",orderNum = "2")
+    private List<MedicalCheckTitleDTO> medicalCheckTitleDTOS;
+}

+ 122 - 0
src/main/java/com/diagbot/enums/MedicalCheckEnum.java

@@ -0,0 +1,122 @@
+package com.diagbot.enums;
+
+
+
+/**
+ * 稽查质控条目
+ * @author cy
+ */
+public enum MedicalCheckEnum  {
+
+    /**
+     * 入院记录未24小时内
+     */
+    RYJLW_24("2658"),
+
+    /**
+     * 首次病程记录未8小时内
+     */
+    SCBCJLW_8H("2686"),
+
+    /**
+     * 副主任/主任医师首次查房72小时内未完成
+     */
+    ZRSCCFW_72H("2657"),
+
+    /**
+     * 入院后未连记3天病程
+     */
+    RYHLJBCW_3D("3010"),
+
+    /**
+     * 每周至少2次副主任/主任医师查房
+     */
+    ZRCFW_2W ("2655"),
+
+    /**
+     * 每周至少3次主治医师查房记录
+     */
+    ZZCFW_3W("2654"),
+
+    /**
+     * 抢救记录6小时内完成
+     */
+    QJJLW_6H("2852"),
+
+    /**
+     * 会诊记录在会诊申请后24小时完成
+     */
+    HZJLW_24H("2287"),
+
+
+
+
+    /**
+     * 术前讨论、术前小结完成
+     */
+    SQTLXJW("3025"),
+
+    /**
+     * 手术记录术后24小时内完成
+     */
+    SXJLSW_24H("2170"),
+
+    /**
+     * 术后首程在术后30分钟内完成
+     */
+    XHSCW_30M("2930"),
+
+    /**
+     * 术后主刀查房24小时内完成
+     */
+    SHZDCFW_24H("2900"),
+
+    /**
+     * 术后连记3天病程(包括术后首程)
+     */
+    SHJBCW_3D("2229"),
+
+    /**
+     * 转科后连记3天病程(包括专科记录)
+     */
+    ZKJBCW_3D("2217"),
+
+    /**
+     * 转接科记录专科后24小时内完成
+     */
+    ZKJLW_24("2218"),
+
+    /**
+     * 病危/重患者未每日记录病程
+     */
+    BWZHJLBCW_MD("2220"),
+
+    /**
+     * 输血后完成输血记录
+     */
+    SXHWJL("2486"),
+
+    /**
+     * 24小时完成输血后评价
+     */
+    SXPJW_24("3063"),
+    /**
+     * 危急值记录
+     */
+    WJZWJL("3062"),
+
+    /**
+     * 住院30天阶段小结
+     */
+    WYWWCXJ("2495");
+
+    private String status;
+
+    MedicalCheckEnum(String status) {
+        this.status = status;
+    }
+
+    public String getStatus() {
+        return this.status;
+    }
+}

+ 9 - 5
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -340,7 +340,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
 
     // 化验
-        //List<MedLisResult> medLisResultList = getMedLisResultList(behospitalInfoList.get(0));
+       // List<MedLisResult> medLisResultList = getMedLisResultList(behospitalInfoList.get(0));
     //使用sql进行关联优化数据查询
         List<MedLisResultDTO> medLisResultListDTO = medLisResultFacade.getMedLisResultList(behospitalInfoList.get(0));
         List<MedLisResult> medLisResultList =new ArrayList<>();
@@ -423,7 +423,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return queryVo;
     }
 
-    private List<MedLisResult> getMedLisResultList(BehospitalInfo behospitalInfo) {
+   /* private List<MedLisResult> getMedLisResultList(BehospitalInfo behospitalInfo) {
         String behospitalDate = null, leaveHospitalDate = null;
         try {
             behospitalDate = DateUtil.format(behospitalInfo.getBehospitalDate(), DateUtil.DATE_TIME_FORMAT);
@@ -472,9 +472,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             });
         }
         return medLisResultList;
-    }
+    }*/
 
-    private List<MedPacsResult> getMedPacsResultList(BehospitalInfo behospitalInfo) {
+   /* private List<MedPacsResult> getMedPacsResultList(BehospitalInfo behospitalInfo) {
         String behospitalDate = null, leaveHospitalDate = null;
         try {
             behospitalDate = DateUtil.format(behospitalInfo.getBehospitalDate(), DateUtil.DATE_TIME_FORMAT);
@@ -516,7 +516,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             );
         }
         return medPacsResultList;
-    }
+    }*/
 
     /**
      * 评分-终末质控
@@ -1253,6 +1253,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         // 医嘱信息
         pageMap.put("医嘱信息", null);
+        // 医嘱信息
+        pageMap.put("检查信息", null);
+        // 医嘱信息
+        pageMap.put("检验信息", null);
         // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
         pageMap.put("知情同意书", recordDTOList);
         pageMap.put("谈话告知书", recordMap.get(54L));

+ 23 - 24
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -3,22 +3,7 @@ package com.diagbot.facade;
 import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.AverageStatisticsFeeDTO;
-import com.diagbot.dto.AverageStatisticsFeeMonthDTO;
-import com.diagbot.dto.AverageStatisticsMonthDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.ExportExcelDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultPercentDTO;
-import com.diagbot.dto.ReBeHosDTO;
-import com.diagbot.dto.UnModifyMRDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.SysHospitalSet;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -27,13 +12,7 @@ import com.diagbot.util.ExcelUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByAverageVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
+import com.diagbot.vo.*;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -87,6 +66,26 @@ public class ConsoleExportFacade {
         ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumDTO.class, fileName, response, 12.8f);
     }
 
+    /**
+     * 稽查统计导出(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public void medicalCheckExport(HttpServletResponse response, FilterMedicalCheckVO filterVO) {
+        filterVO.setCurrent(1L);
+        filterVO.setSize(Long.MAX_VALUE);
+        filterVO.setSearchCount(false);
+        String fileName = null;
+        if ( "1".equals(filterVO.getIsPlacefile())) {
+            fileName = "终末病历稽查表.xls";
+        } else {
+            fileName = "运行病历稽查表.xls";
+        }
+        List<MedicalCheckExportDTO> records = consoleFacade.medicalCheckExport(filterVO);
+        ExcelUtils.exportExcel(records, null, "sheet1", MedicalCheckExportDTO.class, fileName, response, 15.8f);
+    }
+
     /**
      * 各科室缺陷占比(组合)
      *
@@ -445,4 +444,4 @@ public class ConsoleExportFacade {
         String fileName = "质控核查病历导出.xls";
         ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
     }
-}
+}

+ 100 - 41
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -6,43 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.aggregate.AverageStatisticsAggregate;
 import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.AverageStatisticsFeeDTO;
-import com.diagbot.dto.ColumnDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultPercentDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.ReBeHosDTO;
-import com.diagbot.dto.ReBeHosDetailDTO;
-import com.diagbot.dto.ReBeHosMergeDTO;
-import com.diagbot.dto.UnModifyMRDTO;
-import com.diagbot.dto.UnModifyMRDetailDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.QcCasesEntry;
 import com.diagbot.entity.SysHospitalSet;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.ClassUtil;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.ObjectUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByAverageVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
+import com.diagbot.util.*;
+import com.diagbot.vo.*;
 import com.google.common.collect.Lists;
 import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
 import org.apache.ibatis.annotations.Param;
@@ -52,13 +22,7 @@ import org.springframework.stereotype.Component;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -1053,10 +1017,13 @@ public class ConsoleFacade {
         qcCasesEntryQueryWrapper.eq("is_deleted", "N")
                 .in("id", casesEntryIds);
         List<QcCasesEntry> casesEntryList = qcCasesEntryFacade.list(qcCasesEntryQueryWrapper);
+        // 实体类中将实体类转化为map形式,其中条目id对应目标条目名称
         Map<Long, String> basCasesEntryMap = EntityUtil.makeMapWithKeyValue(casesEntryList, "id", "name");
 
         List<UnModifyMRDetailDTO> records = behospitalInfoFacade.unModifyMRStatistics(filterUnModifyMRVO);
+        //以科室分组,将符合科室的每条数据以map形式存储
         Map<String, List<UnModifyMRDetailDTO>> deptMap = EntityUtil.makeEntityListMap(records, "deptName");
+        //科室对应科室id
         Map<String, String> deptInfoMap = EntityUtil.makeMapWithKeyValue(records, "deptName", "deptId");
         Map<String, Map<Long, UnModifyMRDetailDTO>> deptEntryMap = new LinkedHashMap<>();
         for (Map.Entry<String, List<UnModifyMRDetailDTO>> entry : deptMap.entrySet()) {
@@ -1321,4 +1288,96 @@ public class ConsoleFacade {
         filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
         return behospitalInfoFacade.qcCheckMRPage(qcResultShortPageVO);
     }
-}
+
+    /*
+     */
+
+    /**
+     * 病历稽查表导出(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+
+
+    public List<MedicalCheckExportDTO> medicalCheckExport(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        filterFacade.getMedicalCheckVOSet(filterVO);
+        List<MedicalCheckExportDTO> medicalCheck = behospitalInfoFacade.getMedicalCheckExport(filterVO);
+        return medicalCheck;
+    }
+
+
+    /**
+     * 病历稽查表(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        filterFacade.getMedicalCheckVOSet(filterVO);
+        IPage<MedicalCheckDTO> medicalCheck = behospitalInfoFacade.getMedicalCheck(filterVO);
+        return medicalCheck;
+    }
+
+    /**
+     * 病历稽查表(title)
+     *
+     * @param
+     * @return
+     */
+    public List<ColumnDTO> getMedicalCheckTitle() {
+        //病历稽查入参拼接
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        //colums
+        QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
+        hospitalSetQueryWrapper.eq("is_deleted", 'N')
+                .eq("hospital_id", hospitalId)
+                .eq("code", "medical_check_form");
+        List<ColumnDTO> columns = Lists.newLinkedList();
+        SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
+        if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
+            return columns;
+        }
+
+        //表头生成
+        List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
+        Integer orderNo = 1;
+        ColumnDTO columnDeptId = new ColumnDTO();
+        columnDeptId.setOrderNo(orderNo);
+        columnDeptId.setFieldName("deptId");
+        columnDeptId.setColumnName("科室编码");
+        columnDeptId.setIsShow(0);
+        columns.add(columnDeptId);
+        orderNo++;
+        ColumnDTO columnDeptName = new ColumnDTO();
+        columnDeptName.setOrderNo(orderNo);
+        columnDeptName.setFieldName("deptName");
+        columnDeptName.setColumnName("科室");
+        columnDeptName.setIsShow(1);
+        columns.add(columnDeptName);
+        orderNo++;
+        ColumnDTO columnMedicalName = new ColumnDTO();
+        columnMedicalName.setOrderNo(orderNo);
+        columnMedicalName.setFieldName("medicalName");
+        columnMedicalName.setColumnName("医疗组");
+        columnMedicalName.setIsShow(1);
+        columns.add(columnMedicalName);
+        orderNo++;
+        for (String valueStr : columnSet) {
+            String[] keyValue = valueStr.split("--");
+            if (keyValue != null || keyValue.length > 1) {
+                ColumnDTO columnNum = new ColumnDTO();
+                columnNum.setOrderNo(orderNo);
+                columnNum.setId(Long.valueOf(keyValue[0]));
+                columnNum.setFieldName("entry_" + keyValue[0] + "_num");
+                columnNum.setColumnName(keyValue[1]);
+                columnNum.setIsShow(1);
+                columns.add(columnNum);
+                orderNo++;
+            }
+        }
+
+        return columns;
+    }
+}
+

+ 3 - 0
src/main/java/com/diagbot/facade/DoctorAdviceFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.DoctorAdviceServiceImpl;
@@ -10,6 +11,8 @@ import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.DoctorAdviceVO;
 import org.springframework.stereotype.Component;
 
+import java.util.Collection;
+
 /**
  * @Description:
  * @author: zhoutg

+ 14 - 11
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -4,16 +4,7 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.FilterOrderByDeptVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByAverageVO;
-import com.diagbot.vo.FilterPageByDeptVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
+import com.diagbot.vo.*;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -291,4 +282,16 @@ public class FilterFacade {
         reBeHosPageVO.setHospitalId(hospitalId);
         reBeHosPageVO.setUserId(Long.valueOf(userId));
     }
-}
+
+    /**
+     * 病历稽查统计入参拼接
+     *
+     * @param filterVO
+     */
+    public void getMedicalCheckVOSet(FilterMedicalCheckVO filterVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+    }
+}

+ 53 - 2
src/main/java/com/diagbot/facade/MedLisInfoFacade.java

@@ -1,13 +1,64 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.*;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedLisInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.CheckInfoVO;
+import com.diagbot.vo.ExamineInfoVO;
+import com.diagbot.vo.ExamineSonInfoVO;
 import org.springframework.stereotype.Component;
 
+
+import com.diagbot.dto.DoctorAdviceDTO;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
 /**
  * @Description:
- * @author: rengb
- * @time: 2020/7/28 15:48
+ * @author: cy
+ * @time: 2020/9/7 15:48
  */
+
 @Component
 public class MedLisInfoFacade extends MedLisInfoServiceImpl {
+/**
+     * 获取检验信息翻页
+     *
+     * @param examineInfoVO 获取检验信息入参
+     * @return
+     */
+
+    public IPage<ExamineInfoDTO> getExaminePage(ExamineInfoVO examineInfoVO) {
+        examineInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        if (null != examineInfoVO.getJyDateStart()) {
+            examineInfoVO.setJyDateStart(DateUtil.getFirstTimeOfDay(examineInfoVO.getJyDateStart()));
+          }
+        if (null != examineInfoVO.getJyDateEnd()) {
+            examineInfoVO.setJyDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(examineInfoVO.getJyDateEnd(), 1)));
+        }
+        if (null != examineInfoVO.getJyDateStart() && null != examineInfoVO.getJyDateEnd()) {
+            if (DateUtil.after(examineInfoVO.getJyDateStart(), examineInfoVO.getJyDateEnd())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+            }
+        }
+        return this.getExamineInfo(examineInfoVO);
+    }
+
+    /**
+     * 获取检验子项信息
+     * @param examineSonInfoVO 获取检验子项信息入参
+     * @return
+     */
+
+    public IPage<ExamineSonInfoDTO> getExamineSonPage(ExamineSonInfoVO examineSonInfoVO)  {
+       examineSonInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        return this.getExamineSonInfo(examineSonInfoVO);
+    }
+
 }

+ 30 - 2
src/main/java/com/diagbot/facade/MedPacsInfoFacade.java

@@ -1,13 +1,41 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
+import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedPacsInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.CheckInfoVO;
 import org.springframework.stereotype.Component;
 
 /**
  * @Description:
- * @author: rengb
- * @time: 2020/7/28 15:49
+ * @author: cy
+ * @time: 2020/9/04 15:49
  */
 @Component
 public class MedPacsInfoFacade extends MedPacsInfoServiceImpl {
+    /**
+     * 获取检查信息翻页
+     * @param checkInfoVO 获取检查信息入参
+     * @return 检查翻页信息
+     */
+    public IPage<CheckInfoDTO> getCheckPage(CheckInfoVO checkInfoVO) {
+        checkInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        if (null != checkInfoVO.getJxDateStart()) {
+            checkInfoVO.setJxDateStart(DateUtil.getFirstTimeOfDay(checkInfoVO.getJxDateStart()));
+        }
+        if (null != checkInfoVO.getJxDateEnd()) {
+            checkInfoVO.setJxDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(checkInfoVO.getJxDateEnd(), 1)));
+        }
+        if (null != checkInfoVO.getJxDateStart() && null != checkInfoVO.getJxDateEnd()) {
+            if (DateUtil.after(checkInfoVO.getJxDateStart(), checkInfoVO.getJxDateEnd())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
+            }
+        }
+        return this.getCheckInfo(checkInfoVO);
+    }
 }

+ 19 - 27
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -2,34 +2,9 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.BehospitalInfoDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.ExportExcelDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.MsgDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.ReBeHosMergeDTO;
-import com.diagbot.dto.UnModifyMRDetailDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
-import com.diagbot.vo.AnalyzeCodeVO;
-import com.diagbot.vo.AnalyzeVO;
-import com.diagbot.vo.BehospitalPageVO;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.ExportQcresultVO;
-import com.diagbot.vo.FilterOrderByDeptVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByDeptVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
-import com.diagbot.vo.TaskVO;
+import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -349,6 +324,23 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
+    /**
+     * 病历稽查表
+     *
+     * @param filterVO
+     * @return
+     */
+    public IPage<MedicalCheckDTO>  getMedicalCheck(@Param("filterVO")FilterMedicalCheckVO filterVO);
+
+    /**
+     * 病历稽查表导出
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<MedicalCheckExportDTO>  getMedicalCheckExport(@Param("filterVO")FilterMedicalCheckVO filterVO);
+
+
     /**
      * 未整改病历质控评分页(内页)
      *

+ 4 - 1
src/main/java/com/diagbot/mapper/DoctorAdviceMapper.java

@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAdviceDTO;
 import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.vo.DoctorAdviceVO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -18,6 +20,7 @@ import java.util.List;
  */
 public interface DoctorAdviceMapper extends BaseMapper<DoctorAdvice> {
     public void updateBatchByKey(List<DoctorAdvice> list);
+    IPage<DoctorAdviceDTO> getPage(@Param("doctorAdviceVO")DoctorAdviceVO doctorAdviceVO, @Param("infos") Set<String> infos);
+    List<String> getInfo(@Param("hospitalId")Long hospitalId, @Param("behospitalCode")String behospitalCode);
 
-    IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO);
 }

+ 21 - 1
src/main/java/com/diagbot/mapper/MedLisInfoMapper.java

@@ -1,16 +1,36 @@
 package com.diagbot.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
+import com.diagbot.dto.ExamineInfoDTO;
+import com.diagbot.dto.ExamineSonInfoDTO;
 import com.diagbot.entity.MedLisInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.CheckInfoVO;
+import com.diagbot.vo.ExamineInfoVO;
+import com.diagbot.vo.ExamineSonInfoVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
  * @author zhoutg
  * @since 2020-07-28
  */
 public interface MedLisInfoMapper extends BaseMapper<MedLisInfo> {
+    Map<String, Object> getTime(@Param("behospitalCode") String behospitalCode);
+
+    List<String> getBadExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos);
+
+    IPage<ExamineInfoDTO> getExamineInfo(@Param("examineInfoVO") ExamineInfoVO examineInfoVO, @Param("infos") Set<String> infos,@Param("badCheckInfo") List<String> badCheckInfo);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 
+    IPage<ExamineSonInfoDTO> getExamineSonInfo(@Param("examineSonInfoVO") ExamineSonInfoVO examineSonInfoVO, @Param("infos") Set<String> infos);
 }

+ 21 - 3
src/main/java/com/diagbot/mapper/MedPacsInfoMapper.java

@@ -1,16 +1,34 @@
 package com.diagbot.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
+import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.MedPacsInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.CheckInfoVO;
+import com.diagbot.vo.DoctorAdviceVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
- * @author zhoutg
- * @since 2020-07-28
+ * @author cy
+ * @since 2020-09-04
  */
 public interface MedPacsInfoMapper extends BaseMapper<MedPacsInfo> {
 
+    Map<String,Object> getTime(@Param("behospitalCode") String behospitalCode);
+
+
+    IPage<CheckInfoDTO> getCheckInfo(@Param("checkInfoVO") CheckInfoVO checkInfoVO, @Param("infos") Set<String> infos);
+
+    List<String> getInfo(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
+
 }

+ 0 - 1
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -151,7 +151,6 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public IPage<DeptEntryNumDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
-
     /**
      * 条目缺陷占比基础数据(内页)
      *

+ 17 - 28
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -2,37 +2,13 @@ package com.diagbot.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.BehospitalInfoDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.ExportExcelDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.MsgDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.ReBeHosMergeDTO;
-import com.diagbot.dto.UnModifyMRDetailDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
-import com.diagbot.vo.AnalyzeCodeVO;
-import com.diagbot.vo.AnalyzeVO;
-import com.diagbot.vo.BehospitalPageVO;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.ExportQcresultVO;
-import com.diagbot.vo.FilterOrderByDeptVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByDeptVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
-import com.diagbot.vo.TaskVO;
+import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -333,6 +309,19 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<UnModifyMRDetailDTO> unModifyMRStatistics(FilterUnModifyMRVO filterUnModifyMRVO);
 
+    /**
+     * 病历稽查表
+     * @return
+     */
+    IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO);
+
+    /**
+     * 病历稽查表导出
+     * @return
+     */
+    List<MedicalCheckExportDTO>  getMedicalCheckExport(FilterMedicalCheckVO filterVO);
+
+
     /**
      * 未整改病历质控评分页(内页)
      *
@@ -404,4 +393,4 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
-}
+}

+ 7 - 0
src/main/java/com/diagbot/service/MedLisInfoService.java

@@ -1,7 +1,12 @@
 package com.diagbot.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.ExamineInfoDTO;
+import com.diagbot.dto.ExamineSonInfoDTO;
 import com.diagbot.entity.MedLisInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.ExamineInfoVO;
+import com.diagbot.vo.ExamineSonInfoVO;
 
 /**
  * <p>
@@ -12,5 +17,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2020-07-28
  */
 public interface MedLisInfoService extends IService<MedLisInfo> {
+    IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO);
+    IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO);
 
 }

+ 4 - 0
src/main/java/com/diagbot/service/MedPacsInfoService.java

@@ -1,7 +1,10 @@
 package com.diagbot.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
 import com.diagbot.entity.MedPacsInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.CheckInfoVO;
 
 /**
  * <p>
@@ -12,5 +15,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2020-07-28
  */
 public interface MedPacsInfoService extends IService<MedPacsInfo> {
+    IPage<CheckInfoDTO> getCheckInfo(CheckInfoVO checkInfoVO);
 
 }

+ 29 - 27
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -2,36 +2,11 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.dto.BehospitalInfoDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.ExportExcelDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.MsgDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.ReBeHosMergeDTO;
-import com.diagbot.dto.UnModifyMRDetailDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.mapper.BehospitalInfoMapper;
 import com.diagbot.service.BehospitalInfoService;
-import com.diagbot.vo.AnalyzeCodeVO;
-import com.diagbot.vo.AnalyzeVO;
-import com.diagbot.vo.BehospitalPageVO;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.ExportQcresultVO;
-import com.diagbot.vo.FilterOrderByDeptVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByDeptVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
-import com.diagbot.vo.TaskVO;
+import com.diagbot.vo.*;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -481,6 +456,33 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRStatistics(filterUnModifyMRVO);
     }
 
+    /**
+     * 病历稽查表
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        return baseMapper.getMedicalCheck(filterVO);
+
+    }
+
+    /**
+     * 病历稽查表导出
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<MedicalCheckExportDTO> getMedicalCheckExport(@Param("filterVO") FilterMedicalCheckVO filterVO) {
+        List<MedicalCheckExportDTO> medicalCheckExport = baseMapper.getMedicalCheckExport(filterVO);
+        return medicalCheckExport;
+
+    }
+
+
+
     /**
      * 未整改病历质控评分页(内页)
      *

+ 26 - 3
src/main/java/com/diagbot/service/impl/DoctorAdviceServiceImpl.java

@@ -7,9 +7,12 @@ import com.diagbot.mapper.DoctorAdviceMapper;
 import com.diagbot.service.DoctorAdviceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.DoctorAdviceVO;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -23,13 +26,33 @@ import java.util.List;
 public class DoctorAdviceServiceImpl extends ServiceImpl<DoctorAdviceMapper, DoctorAdvice> implements DoctorAdviceService {
     /**
      * 根据医嘱ID和医院编码-批量更新数据
+     *
      * @param list
      */
-    public void updateBatchByKey(List<DoctorAdvice> list){
+    public void updateBatchByKey(List<DoctorAdvice> list) {
         this.baseMapper.updateBatchByKey(list);
     }
 
-    public IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO){
-        return this.baseMapper.getPage(doctorAdviceVO);
+
+    public IPage<DoctorAdviceDTO> getPage(DoctorAdviceVO doctorAdviceVO) {
+
+        List<String> infos = this.baseMapper.getInfo(doctorAdviceVO.getHospitalId(), doctorAdviceVO.getBehospitalCode());
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("医嘱:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String target : targetInfos) {
+                        if (!"医嘱".equals(target)) {
+                            infoSet.add(target);
+                        }
+                    }
+                }
+            }
+        }
+
+        IPage<DoctorAdviceDTO> page = this.baseMapper.getPage(doctorAdviceVO, infoSet);
+        return page;
     }
 }

+ 82 - 1
src/main/java/com/diagbot/service/impl/MedLisInfoServiceImpl.java

@@ -1,20 +1,101 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
+import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.dto.ExamineInfoDTO;
+import com.diagbot.dto.ExamineSonInfoDTO;
 import com.diagbot.entity.MedLisInfo;
 import com.diagbot.mapper.MedLisInfoMapper;
 import com.diagbot.service.MedLisInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.CheckInfoVO;
+import com.diagbot.vo.DoctorAdviceVO;
+import com.diagbot.vo.ExamineInfoVO;
+import com.diagbot.vo.ExamineSonInfoVO;
 import org.springframework.stereotype.Service;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author zhoutg
  * @since 2020-07-28
  */
+
 @Service
 public class MedLisInfoServiceImpl extends ServiceImpl<MedLisInfoMapper, MedLisInfo> implements MedLisInfoService {
 
+
+    public IPage<ExamineInfoDTO> getExamineInfo(ExamineInfoVO examineInfoVO) {
+
+        List<String> infos = this.baseMapper.getInfo(examineInfoVO.getHospitalId(), examineInfoVO.getBehospitalCode());
+
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("化验:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"化验".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+                    }
+                }
+            }
+        }
+
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(examineInfoVO.getBehospitalCode());
+        if (null != timeMap) {
+            Date behospital_date = (Date) timeMap.get("behospital_date");
+            examineInfoVO.setBehospitalDate(behospital_date);
+            Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+            examineInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+        }
+
+        String behospitalCode = examineInfoVO.getBehospitalCode();
+        if (2l == examineInfoVO.getHospitalId()) {
+            examineInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        //获取缺陷检验项目
+        List<String> badCheckInfo = this.baseMapper.getBadExamineInfo(examineInfoVO, infoSet);
+        //获取缺陷判别类别检查项目
+        IPage<ExamineInfoDTO> page = this.baseMapper.getExamineInfo(examineInfoVO, infoSet,badCheckInfo);
+        return page;
+    }
+
+    public IPage<ExamineSonInfoDTO> getExamineSonInfo(ExamineSonInfoVO examineSonInfoVO) {
+        List<String> infos = this.baseMapper.getInfo(examineSonInfoVO.getHospitalId(), examineSonInfoVO.getBehospitalCode());
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("化验:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"化验".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+                    }
+                }
+            }
+        }
+        String behospitalCode = examineSonInfoVO.getBehospitalCode();
+        if (2l == examineSonInfoVO.getHospitalId()) {
+            examineSonInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        IPage<ExamineSonInfoDTO> page = this.baseMapper.getExamineSonInfo(examineSonInfoVO, infoSet);
+        return page;
+    }
+
+
 }

+ 47 - 3
src/main/java/com/diagbot/service/impl/MedPacsInfoServiceImpl.java

@@ -1,20 +1,64 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.CheckInfoDTO;
 import com.diagbot.entity.MedPacsInfo;
 import com.diagbot.mapper.MedPacsInfoMapper;
 import com.diagbot.service.MedPacsInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.CheckInfoVO;
 import org.springframework.stereotype.Service;
 
+import javax.validation.constraints.NotBlank;
+import java.util.*;
+
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
- * @author zhoutg
- * @since 2020-07-28
+ * @author cy
+ * @since 2020-09-04
  */
 @Service
 public class MedPacsInfoServiceImpl extends ServiceImpl<MedPacsInfoMapper, MedPacsInfo> implements MedPacsInfoService {
 
+
+    public IPage<CheckInfoDTO> getCheckInfo(CheckInfoVO checkInfoVO) {
+
+        List<String> infos = this.baseMapper.getInfo(checkInfoVO.getHospitalId(), checkInfoVO.getBehospitalCode());
+
+        Set<String> infoSet = new HashSet<>();
+        for (String s : infos) {
+            if (s.contains("检查:")) {
+                String[] split = s.split("_");
+                for (String info : split) {
+                    String[] targetInfos = info.split(":");
+                    for (String targetInfo : targetInfos) {
+                        if (!"检查".equals(targetInfo)) {
+                            infoSet.add(targetInfo);
+                        }
+
+                    }
+
+                }
+            }
+        }
+
+        //获取病人进出院时间
+        Map<String, Object> timeMap = this.baseMapper.getTime(checkInfoVO.getBehospitalCode());
+        if (null != timeMap) {
+            Date behospital_date = (Date) timeMap.get("behospital_date");
+            checkInfoVO.setBehospitalDate(behospital_date);
+            Date leaveHospitalDate = (Date) timeMap.get("leave_hospital_date");
+            checkInfoVO.setLeaveHospitalDate(leaveHospitalDate);
+        }
+        String behospitalCode = checkInfoVO.getBehospitalCode();
+        if(2l == checkInfoVO.getHospitalId()){
+            checkInfoVO.setBehospitalCode(behospitalCode.split("_")[0]);
+        }
+
+        IPage<CheckInfoDTO> page = this.baseMapper.getCheckInfo(checkInfoVO, infoSet);
+        return page;
+    }
 }

+ 10 - 10
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -209,28 +209,28 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
      */
     @Override
     public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
-       //基础数据
-        IPage<EntryNumDTO> entryNumDTOIPage  = baseMapper.entryGroupByEntryInnerPage(filterPageVO);
+        //基础数据
+        IPage<EntryNumDTO> entryNumDTOIPage = baseMapper.entryGroupByEntryInnerPage(filterPageVO);
         List<EntryNumDTO> records = entryNumDTOIPage.getRecords();
-        if(CollectionUtils.isEmpty(records)){
+        if (CollectionUtils.isEmpty(records)) {
             return entryNumDTOIPage;
         }
         String hospitalId = filterPageVO.getHospitalId();
         //缺陷总数
-          Integer sumInteget = baseMapper.entryGroupByEntrySum(filterPageVO.getHospitalId(),filterPageVO.getIsPlacefile(),
-                                                                filterPageVO.getStartDate(),filterPageVO.getEndDate());
+        Integer sumInteget = baseMapper.entryGroupByEntrySum(filterPageVO.getHospitalId(), filterPageVO.getIsPlacefile(),
+                filterPageVO.getStartDate(), filterPageVO.getEndDate());
         float nsum = 0;
-          Set<Long> ids = new HashSet<Long>();
+        Set<Long> ids = new HashSet<Long>();
         for (EntryNumDTO record : records) {
             ids.add(record.getId());
             int num = record.getNum().intValue();
-            if(sumInteget!=null && sumInteget!=0 ){
+            if (sumInteget != null && sumInteget != 0) {
                 int sum = sumInteget.intValue();
-                 nsum =(float) num/sum;
+                nsum = (float) num / sum;
             }
             DecimalFormat df = new DecimalFormat("0.00");
-            String percent = df.format(nsum*100);
-            record.setPercentStr(percent+"%");
+            String percent = df.format(nsum * 100);
+            record.setPercentStr(percent + "%");
             record.setTotleNum(sumInteget);
         }
         //缺陷分值

+ 78 - 0
src/main/java/com/diagbot/vo/CheckInfoVO.java

@@ -0,0 +1,78 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class CheckInfoVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 检查项类型缺陷判别(0-全部检查项 1-缺陷检查项  2-非缺陷检查项 )
+     */
+    private Integer checkType = 0;
+
+    /**
+     * 病历号
+     */
+    @NotBlank(message = "请输入病历号")
+    private String behospitalCode;
+
+    /**
+     * 检查类型判别
+     */
+    private String checkItemType;
+
+    /**
+     * 检查项目名称
+     */
+    private String checkItemName;
+
+    /**
+     * 检查时间开始
+     */
+    private Date jxDateStart;
+
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
+    /**
+     * 检查时间结束
+     */
+    private Date jxDateEnd;
+
+    /**
+     * 是否归档 (0-未归档 1-归档)
+     */
+    private String isPlacefile;
+
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
+
+}

+ 11 - 0
src/main/java/com/diagbot/vo/DoctorAdviceVO.java

@@ -1,6 +1,7 @@
 package com.diagbot.vo;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -22,6 +23,11 @@ public class DoctorAdviceVO extends Page {
     @ApiModelProperty(hidden = true)
     private Long hospitalId;
 
+    /**
+     * 医嘱类型缺陷判别(0-全部医嘱 1-缺陷医嘱 2-非缺陷医嘱)
+     */
+    private Integer adviceType = 0;
+
     /**
      * 病历号
      */
@@ -47,5 +53,10 @@ public class DoctorAdviceVO extends Page {
      * 医嘱开始时间结束
      */
     private Date daStartDateEnd;
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
 
 }

+ 80 - 0
src/main/java/com/diagbot/vo/ExamineInfoVO.java

@@ -0,0 +1,80 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/7 14:59
+ */
+@Getter
+@Setter
+public class ExamineInfoVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 检验项类型缺陷判别(0-全部检验项 1-缺陷检验项  2-非缺陷检验项 )
+     */
+    private Integer examineType = 0;
+
+    /**
+     * 病历号
+     */
+    @NotBlank(message = "请输入病历号")
+    private String behospitalCode;
+
+    /**
+     * 检验类型判别
+     */
+    private String examineItemType;
+
+    /**
+     * 检验项目名称
+     */
+    private String examineItemName;
+
+    /**
+     * 检验时间开始
+     */
+    private Date jyDateStart;
+
+    /**
+     * 检验时间结束
+     */
+    private Date jyDateEnd;
+
+    /**
+     * 入院时间
+     */
+    @JsonIgnore
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    @JsonIgnore
+    private Date leaveHospitalDate;
+
+    /**
+     * 是否归档 (0-未归档 1-归档)
+     */
+    private String isPlacefile;
+
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
+
+}

+ 43 - 0
src/main/java/com/diagbot/vo/ExamineSonInfoVO.java

@@ -0,0 +1,43 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/7 14:59
+ */
+@Getter
+@Setter
+public class ExamineSonInfoVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 病历号
+     */
+    @NotBlank(message = "请输入病历号")
+    private String behospitalCode;
+
+    /**
+     * 报告单号
+     */
+    private String repNo;
+
+    /**
+     * 检验信息缺陷判别
+     */
+    private String examineType;
+
+
+}

+ 49 - 0
src/main/java/com/diagbot/vo/FilterMedicalCheckVO.java

@@ -0,0 +1,49 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:cy
+ * @time: 2020/9/9 13:06
+ */
+@Getter
+@Setter
+public class FilterMedicalCheckVO extends Page {
+    /**
+     * 起始时间
+     */
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+    /**
+     * 结束时间
+     */
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private String hospitalId;
+    /**
+     * 医生id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+
+    /**
+     * 科室名称
+     */
+    private String name;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+}

+ 2 - 1
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -71,4 +71,5 @@ public class FilterPageVO extends Page {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
-}
+
+}

+ 62 - 0
src/main/java/com/diagbot/vo/MedLisInfoVO.java

@@ -0,0 +1,62 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/3 17:20
+ */
+@Getter
+@Setter
+public class MedLisInfoVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 检查缺陷类型判别(0-全部检查项 1缺陷检查项 2非缺陷检查项)
+     */
+    private Integer checkType = 0;
+
+    /**
+     * 病历号
+     */
+    @NotBlank(message = "请输入病历号")
+    private String behospitalCode;
+
+    /**
+     * 检查类型判别
+     */
+    private String checkItemType;
+
+    /**
+     * 检查项目名称
+     */
+    private String checkItemName;
+
+    /**
+     * 检查开始时间开始
+     */
+    private Date daStartDateStart;
+
+    /**
+     * 检查开始时间结束
+     */
+    private Date daStartDateEnd;
+    /**
+     * 提示信息
+     */
+    @JsonIgnore
+    private String info;
+
+}

+ 0 - 1
src/main/java/com/diagbot/vo/QcResultShortPageVO.java

@@ -112,7 +112,6 @@ public class QcResultShortPageVO extends Page {
      * 首页核查截止时间
      */
     private Date mrTimeEnd;
-
     /**
      * 是否归档(0:未归档,1:已归档)
      */

+ 33 - 24
src/main/java/com/diagbot/web/ConsoleController.java

@@ -2,30 +2,9 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.AverageStatisticsFeeDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.EntryStatisticsDTO;
-import com.diagbot.dto.HomePageImproveDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.LevelStatisticsTZDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.ReBeHosDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.UnModifyMRDTO;
+import com.diagbot.dto.*;
 import com.diagbot.facade.ConsoleFacade;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByAverageVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
+import com.diagbot.vo.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -766,4 +745,34 @@ public class ConsoleController {
     public RespDTO<IPage<QcResultShortDTO>> qcCheckMRPage(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         return RespDTO.onSuc(consoleFacade.qcCheckMRPage(qcResultShortPageVO));
     }
-}
+
+
+    /**
+     * 病历稽查表(首页)
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "病历稽查统计[by:cy]",
+            notes = "name: 科室名称 <br>" +
+                    "asc: 排序(升序) <br>" +
+                    "desc:排序(降序) <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/medicalCheckForm")
+    @SysLogger("medicalCheckForm")
+    public RespDTO<IPage<MedicalCheckDTO> > getMedicalCheck(@RequestBody @Valid FilterMedicalCheckVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.getMedicalCheck(filterVO));
+    }
+    /**
+     * 病历稽查表(title)
+     * @param
+     * @return
+     */
+    @ApiOperation(value = "病历稽查获取title[by:cy]")
+    @PostMapping("/medicalCheckTitle")
+    @SysLogger("medicalCheckTitle")
+    public RespDTO<List<ColumnDTO>> getMedicalCheckTitle() {
+        return RespDTO.onSuc(consoleFacade.getMedicalCheckTitle());
+    }
+}

+ 49 - 8
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -2,13 +2,7 @@ package com.diagbot.web;
 
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.facade.ConsoleExportFacade;
-import com.diagbot.vo.EntryStatisticsVO;
-import com.diagbot.vo.FilterOrderVO;
-import com.diagbot.vo.FilterPageByAverageVO;
-import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterUnModifyMRVO;
-import com.diagbot.vo.QcResultShortPageVO;
-import com.diagbot.vo.ReBeHosPageVO;
+import com.diagbot.vo.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,6 +63,22 @@ public class ConsoleExportController {
         consoleExportFacade.entryGroupByEntryExport(response, filterPageVO);
     }
 
+    /**
+     * 病历稽查统计(首页)
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "病历稽查导出[by:cy]",
+            notes =  "name: 科室名称 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/medicalCheckExport")
+    @SysLogger("medicalCheckExport")
+    public void medicalCheckExport(HttpServletResponse response, @RequestBody @Valid FilterMedicalCheckVO filterVO) {
+        consoleExportFacade.medicalCheckExport(response, filterVO);
+    }
+
     /**
      * 各科室缺陷占比(组合)
      *
@@ -325,6 +335,37 @@ public class ConsoleExportController {
         consoleExportFacade.unModifyMRPageExport(response, qcResultShortPageVO);
     }
 
+
+    /**
+     * 稽查病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "稽查病历详情页导出[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/medicalCheckInnerExport")
+    @SysLogger("medicalCheckInnerExport")
+    public void medicalCheckInnerExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleExportFacade.unModifyMRPageExport(response, qcResultShortPageVO);
+    }
+
     /**
      * 未整改病历统计导出
      *
@@ -423,4 +464,4 @@ public class ConsoleExportController {
     public void qcCheckMRPageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         consoleExportFacade.qcCheckMRPageExport(response, qcResultShortPageVO);
     }
-}
+}

+ 60 - 0
src/main/java/com/diagbot/web/MedLisInfoController.java

@@ -0,0 +1,60 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.DoctorAdviceDTO;
+import com.diagbot.dto.ExamineInfoDTO;
+import com.diagbot.dto.ExamineSonInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DoctorAdviceFacade;
+import com.diagbot.facade.MedLisInfoFacade;
+import com.diagbot.vo.CheckInfoVO;
+import com.diagbot.vo.ExamineInfoVO;
+import com.diagbot.vo.ExamineSonInfoVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.validation.Valid;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author cy
+ * @since 2020-09-07
+ */
+
+@RestController
+@RequestMapping("qc/medLisInfo")
+@Api(value = "检验信息API", tags = { "检验信息API" })
+public class MedLisInfoController {
+    @Autowired
+    private MedLisInfoFacade medLisInfoFacade;
+
+    @ApiOperation(value = "获取检验信息[by:cy]",
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "examineType:检验项类型缺陷判别<br>" +
+                    "examineItemType:检验类型判别(模糊搜索)<br>" +
+                    "examineItemName:检验项目名称(模糊搜索)<br>" +
+                    "jyDateStart:检验开始时间<br>" +
+                    "jyDateEnd:检验结束时间<br>")
+    @PostMapping("/getExaminePage")
+    @SysLogger("getExaminePage")
+    public RespDTO<IPage<ExamineInfoDTO>> getExaminePage(@RequestBody @Valid ExamineInfoVO examineInfoVO) {
+        return RespDTO.onSuc(medLisInfoFacade.getExaminePage(examineInfoVO));
+    }
+
+    @ApiOperation(value = "获取检验子项信息[by:cy]",
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "repNo:报告单号<br>")
+    @PostMapping("/getExamineSonPage")
+    @SysLogger("getExamineSonPage")
+    public RespDTO<IPage<ExamineSonInfoDTO>> getExamineSonPage(@RequestBody @Valid ExamineSonInfoVO examineSonInfoVO) {
+        return RespDTO.onSuc(medLisInfoFacade.getExamineSonPage(examineSonInfoVO));
+    }
+
+}

+ 49 - 0
src/main/java/com/diagbot/web/MedPacsInfoController.java

@@ -0,0 +1,49 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.CheckInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.MedPacsInfoFacade;
+import com.diagbot.vo.CheckInfoVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author cy
+ * @since 2020-09-04
+ */
+@RestController
+@RequestMapping("qc/medPacsInfo")
+@Api(value = "检查信息API", tags = {"检查信息API"})
+public class MedPacsInfoController {
+    @Autowired
+    private MedPacsInfoFacade medPacsInfoFacade;
+
+    @ApiOperation(value = "获取检查信息[by:cy]",
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "checkType:检查项类型缺陷判别<br>" +
+                    "checkItemType:检查类型(模糊搜索)<br>" +
+                    "checkItemName:检查项目名称(模糊搜索)<br>" +
+                    "jxDateStart:检查时间开始<br>" +
+                    "jxDateEnd:检查时间结束<br>")
+    @PostMapping("/getCheckPage")
+    @SysLogger("getCheckPage")
+    public RespDTO<IPage<CheckInfoDTO>> getCheckPage(@RequestBody @Valid CheckInfoVO checkInfoVO) {
+        return RespDTO.onSuc(medPacsInfoFacade.getCheckPage(checkInfoVO));
+    }
+
+}

+ 1 - 1
src/main/resources/application-test.yml

@@ -164,7 +164,7 @@ oath.self.address: http://${myhost}:${server.port}
 
 # 加解密开关
 encrypt:
-  enable: false
+  enable: true
 
 swagger:
   enable: true

+ 288 - 55
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -50,7 +50,7 @@
         h.check_name AS mr_name,
         g.check_time AS ch_time,
         h.check_time AS mr_time
-         from (
+        from (
         select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
         grade_time, c.age from med_behospital_info a
         LEFT JOIN med_qcresult_info b
@@ -111,16 +111,16 @@
         and t.qc_type_id != 0) p
         where p.is_deleted="N"
         <if test="checkStatus != null ">
-        and p.check_status = #{checkStatus}
+            and p.check_status = #{checkStatus}
         </if>
         <if test="mrStatus != null ">
-        AND p.mr_status = #{mrStatus}
+            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}]]>
@@ -412,7 +412,7 @@
             and p.check_status = #{checkStatus}
         </if>
         <if test="mrStatus != null ">
-        AND p.mr_status = #{mrStatus}
+            AND p.mr_status = #{mrStatus}
         </if>
         <if test="chName != null and chName !=''">
             AND  p.ch_name  like CONCAT('%',#{chName},'%')
@@ -446,7 +446,7 @@
         h.check_name as mr_name,
         g.check_time as ch_time,
         h.check_time AS mr_time
-         from (SELECT
+        from (SELECT
         a.*,
         IFNULL(b.level, '未评分') AS `level`,
         b.grade_type,
@@ -557,7 +557,7 @@
         h.check_name as mr_name,
         g.check_time as ch_time,
         h.check_time AS mr_time
-         from (
+        from (
         select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
         grade_time, c.age from med_behospital_info a
         LEFT JOIN med_qcresult_info b
@@ -573,17 +573,17 @@
         AND t.hospital_id = h.hospital_id
         WHERE t.is_deleted = 'N'
         and
-            t.doctor_id in (
-                SELECT doctor_id FROM `bas_doctor_info`
-                where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
-                    select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
-                    where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
-                    and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
-                    and c1.username = c3.doctor_id
-                    and c2.hospital_id = #{hospitalId}
-                    and c1.id = #{userId}
-                )
-            )
+        t.doctor_id in (
+        SELECT doctor_id FROM `bas_doctor_info`
+        where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
+        select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
+        where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
+        and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
+        and c1.username = c3.doctor_id
+        and c2.hospital_id = #{hospitalId}
+        and c1.id = #{userId}
+        )
+        )
         <if test="deptId != null and deptId != ''">
             and t.beh_dept_id = #{deptId}
         </if>
@@ -2731,6 +2731,7 @@
         </collection>
     </resultMap>
 
+
     <select id="exportExcel" resultMap="ExportExcelMap">
         SELECT DISTINCT
         t1.beh_dept_name AS behDeptName,
@@ -2779,7 +2780,7 @@
         h.check_name AS mr_name,
         g.check_time AS ch_time,
         h.check_time AS mr_time
-         FROM (
+        FROM (
         SELECT
         t1.behDeptId,
         t1.behDeptName,
@@ -2849,13 +2850,13 @@
         </if>
         <if test="doctorName != null and doctorName != ''">
             AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
-                 OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
-                 OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
         </if>
         <if test="doctorCode != null and doctorCode != ''">
             AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
-                 OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
-                 OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
         </if>
         <if test="deptId != null and deptId != ''">
             AND a.beh_dept_id = #{deptId}
@@ -2976,7 +2977,7 @@
         h.check_name AS mr_name,
         g.check_time AS ch_time,
         h.check_time AS mr_time
-         FROM (
+        FROM (
         SELECT
         t1.behDeptId,
         t1.behDeptName,
@@ -3187,7 +3188,7 @@
         h.check_name AS mr_name,
         g.check_time AS ch_time,
         h.check_time AS mr_time
-         FROM (
+        FROM (
         SELECT
         t1.behDeptId,
         t1.behDeptName,
@@ -3234,15 +3235,15 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         AND a.doctor_id in
-            (SELECT doctor_id FROM `bas_doctor_info`
-            where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
-            select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
-            where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
-            and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
-            and c1.username = c3.doctor_id
-            and c2.hospital_id = #{hospitalId}
-            and c1.id = #{userId}
-            ))
+        (SELECT doctor_id FROM `bas_doctor_info`
+        where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
+        select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
+        where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
+        and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
+        and c1.username = c3.doctor_id
+        and c2.hospital_id = #{hospitalId}
+        and c1.id = #{userId}
+        ))
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3293,15 +3294,15 @@
         WHERE
         a.is_deleted = 'N'
         AND a.doctor_id in
-            (SELECT doctor_id FROM `bas_doctor_info`
-            where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
-            select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
-            where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
-            and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
-            and c1.username = c3.doctor_id
-            and c2.hospital_id = #{hospitalId}
-            and c1.id = #{userId}
-            ))
+        (SELECT doctor_id FROM `bas_doctor_info`
+        where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
+        select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
+        where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
+        and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
+        and c1.username = c3.doctor_id
+        and c2.hospital_id = #{hospitalId}
+        and c1.id = #{userId}
+        ))
         AND b.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
@@ -4676,17 +4677,17 @@
     </select>
     <!-- 离院病人评分详情页-->
     <select id="getAge" resultType="java.util.Map">
-    SELECT
-    a.behospital_code as behospitalCode,
-    a.age as age
-    FROM
-    med_home_page a
-    WHERE
-    a.is_deleted = 'N'
-    AND a.hospital_id = #{hospitalId}
-    AND a.behospital_code IN
+        SELECT
+        a.behospital_code as behospitalCode,
+        a.age as age
+        FROM
+        med_home_page a
+        WHERE
+        a.is_deleted = 'N'
+        AND a.hospital_id = #{hospitalId}
+        AND a.behospital_code IN
         <foreach collection="behospitalCodes" open="(" separator="," close=")" item="item">
-          '${item}'
+            '${item}'
         </foreach>
     </select>
     <!-- 离院病人评分详情页-->
@@ -4862,7 +4863,7 @@
             , med_medical_record b,
             med_medical_record_content c
             WHERE
-             b.is_deleted = 'N'
+            b.is_deleted = 'N'
             and	c.is_deleted = 'N'
             and t1.hospital_id = b.hospital_id
             and t1.hospital_id = c.hospital_id
@@ -6417,6 +6418,238 @@
         AND f1.behDeptName = f2.behDeptName
     </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"/>
+    </resultMap>
+
+    <!--    病历稽查表最新sql-->
+    <select id="getMedicalCheck" resultMap="MedicalCheckMap">
+        SELECT
+        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
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d,
+        bas_doctor_info e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_entry_id = d.id
+        and a.doctor_id=e.doctor_id
+        and e.group_id is not NULL
+        AND LENGTH(e.group_id)>0
+        AND a.qc_type_id != 0
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile != ''">
+            and a.is_placefile = #{filterVO.isPlacefile}
+        </if>
+        <if test="filterVO.hospitalId != null and filterVO.hospitalId != ''">
+            AND a.hospital_id = #{filterVO.hospitalId}
+        </if>
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 0">
+            <if test="filterVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{filterVO.startDate}]]>
+            </if>
+            <if test="filterVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{filterVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 1">
+            <if test="filterVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
+            </if>
+            <if test="filterVO.endDate != null ">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterVO.name != null and filterVO.name != ''">
+            AND a.beh_dept_name like CONCAT('%', #{filterVO.name}, '%')
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        e.group_id,
+        a.doctor_id
+    </select>
+
+    <resultMap id="MedicalCheckExcelMap" type="com.diagbot.dto.MedicalCheckExportDTO">
+        <result column="deptName" property="deptName"/>
+        <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">
+                <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"/>
+            </collection>
+        </collection>
+    </resultMap>
+
+    <!--    病历稽查表最新导出-->
+    <select id="getMedicalCheckExport" resultMap="MedicalCheckExcelMap">
+        SELECT
+        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
+--         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,
+        med_qcresult_detail c,
+        qc_cases_entry d,
+        bas_doctor_info e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_entry_id = d.id
+        and a.doctor_id=e.doctor_id
+        and e.group_id is not NULL
+        AND LENGTH(e.group_id)>0
+        AND a.qc_type_id != 0
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile != ''">
+            and a.is_placefile = #{filterVO.isPlacefile}
+        </if>
+        <if test="filterVO.hospitalId != null and filterVO.hospitalId != ''">
+            AND a.hospital_id = #{filterVO.hospitalId}
+        </if>
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 0">
+            <if test="filterVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{filterVO.startDate}]]>
+            </if>
+            <if test="filterVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{filterVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 1">
+            <if test="filterVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
+            </if>
+            <if test="filterVO.endDate != null ">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterVO.name != null and filterVO.name != ''">
+            AND a.beh_dept_name like CONCAT('%', #{filterVO.name}, '%')
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        e.group_id
+    </select>
+
     <!-- 未整改病历统计-->
     <select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO" parameterType="com.diagbot.vo.FilterUnModifyMRVO">
         SELECT

+ 108 - 48
src/main/resources/mapper/DoctorAdviceMapper.xml

@@ -4,67 +4,126 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.DoctorAdvice">
-        <id column="doctor_advice_id" property="doctorAdviceId" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="order_doctor_name" property="orderDoctorName" />
-        <result column="frequency" property="frequency" />
-        <result column="parent_type_id" property="parentTypeId" />
-        <result column="doctor_advice_type" property="doctorAdviceType" />
-        <result column="usage_num" property="usageNum" />
-        <result column="usage_unit" property="usageUnit" />
-        <result column="dose" property="dose" />
-        <result column="dose_unit" property="doseUnit" />
-        <result column="med_mode_type" property="medModeType" />
-        <result column="da_frequency" property="daFrequency" />
-        <result column="da_deal_type" property="daDealType" />
-        <result column="da_start_date" property="daStartDate" />
-        <result column="da_item_name" property="daItemName" />
-        <result column="da_status" property="daStatus" />
-        <result column="da_stop_date" property="daStopDate" />
-        <result column="da_group_no" property="daGroupNo" />
-        <result column="da_prescription_type" property="daPrescriptionType" />
-        <result column="medicine_type" property="medicineType" />
-        <result column="da_med_type" property="daMedType" />
-        <result column="doctor_notice" property="doctorNotice" />
-        <result column="doctor_id" property="doctorId" />
-        <result column="doctor_name" property="doctorName" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <id column="doctor_advice_id" property="doctorAdviceId"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="order_doctor_name" property="orderDoctorName"/>
+        <result column="frequency" property="frequency"/>
+        <result column="parent_type_id" property="parentTypeId"/>
+        <result column="doctor_advice_type" property="doctorAdviceType"/>
+        <result column="usage_num" property="usageNum"/>
+        <result column="usage_unit" property="usageUnit"/>
+        <result column="dose" property="dose"/>
+        <result column="dose_unit" property="doseUnit"/>
+        <result column="med_mode_type" property="medModeType"/>
+        <result column="da_frequency" property="daFrequency"/>
+        <result column="da_deal_type" property="daDealType"/>
+        <result column="da_start_date" property="daStartDate"/>
+        <result column="da_item_name" property="daItemName"/>
+        <result column="da_status" property="daStatus"/>
+        <result column="da_stop_date" property="daStopDate"/>
+        <result column="da_group_no" property="daGroupNo"/>
+        <result column="da_prescription_type" property="daPrescriptionType"/>
+        <result column="medicine_type" property="medicineType"/>
+        <result column="da_med_type" property="daMedType"/>
+        <result column="doctor_notice" property="doctorNotice"/>
+        <result column="doctor_id" property="doctorId"/>
+        <result column="doctor_name" property="doctorName"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
 
     <select id="getPage" parameterType="com.diagbot.vo.DoctorAdviceVO" resultType="com.diagbot.dto.DoctorAdviceDTO">
+        select b.*
+        from(
         SELECT
-            t.*
+        t.doctor_advice_id,
+        t.hospital_id,
+        t.behospital_code,
+        t.doctor_advice_type,
+        t.da_start_date,
+        t.da_stop_date,
+        t.da_item_name,
+        CONCAT( t.da_item_name, '(',DATE_FORMAT( t.da_start_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        t.da_prescription_type,
+        t.medicine_type,
+        t.dose,
+        t.dose_unit,
+        t.med_mode_type,
+        t.da_frequency,
+        t.doctor_name
         FROM
-            `med_doctor_advice` t
-        WHERE
-            t.is_deleted = 'N'
-        <if test="hospitalId != null">
-            and t.hospital_id = #{hospitalId}
+        `med_doctor_advice` t
+        where
+        t.is_deleted = 'N'
+        <if test="doctorAdviceVO.hospitalId != null">
+            and t.hospital_id = #{doctorAdviceVO.hospitalId}
         </if>
-        <if test="behospitalCode != null and behospitalCode != ''">
-            and t.behospital_code = #{behospitalCode}
+        <if test="doctorAdviceVO.behospitalCode != null and doctorAdviceVO.behospitalCode != ''">
+            and t.behospital_code = #{doctorAdviceVO.behospitalCode}
+        </if>
+        <if test="doctorAdviceVO.doctorAdviceType != null and doctorAdviceVO.doctorAdviceType != ''">
+            and t.doctor_advice_type like CONCAT('%',#{doctorAdviceVO.doctorAdviceType},'%')
+        </if>
+        <if test="doctorAdviceVO.daItemName != null and doctorAdviceVO.daItemName != ''">
+            and t.da_item_name like CONCAT('%',#{doctorAdviceVO.daItemName},'%')
+        </if>
+        <if test="doctorAdviceVO.daStartDateStart != null">
+            <![CDATA[ and t.da_start_date >= #{doctorAdviceVO.daStartDateStart}]]>
         </if>
-        <if test="doctorAdviceType != null and doctorAdviceType != ''">
-            and t.doctor_advice_type like CONCAT('%',#{doctorAdviceType},'%')
+        <if test="doctorAdviceVO.daStartDateEnd != null">
+            <![CDATA[ and t.da_start_date < #{doctorAdviceVO.daStartDateEnd}]]>
+        </if>) b
+        where 1=1
+        <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and b.info in('000000ASDQWEZXC@#$%')
+            </if>
         </if>
-        <if test="daItemName != null and daItemName != ''">
-            and t.da_item_name like CONCAT('%',#{daItemName},'%')
+        <if test="doctorAdviceVO.adviceType != null and doctorAdviceVO.adviceType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and b.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1=1
+            </if>
         </if>
-        <if test="daStartDateStart != null">
-            <![CDATA[ and t.da_start_date >= #{daStartDateStart}]]>
+    </select>
+
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
         </if>
-        <if test="daStartDateEnd != null">
-            <![CDATA[ and t.da_start_date < #{daStartDateEnd}]]>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
         </if>
     </select>
 
     <update id="updateBatchByKey">
-        <foreach collection="list" item="item"  separator=";">
+        <foreach collection="list" item="item" separator=";">
             update med_doctor_advice
             <set>
                 <if test="item.orderDoctorName != null">
@@ -140,7 +199,8 @@
                     modifier = #{item.modifier},
                 </if>
             </set>
-            where doctor_advice_id = #{item.doctorAdviceId} and hospital_id = #{item.hospitalId} and behospital_code = #{item.behospitalCode}
+            where doctor_advice_id = #{item.doctorAdviceId} and hospital_id = #{item.hospitalId} and behospital_code =
+            #{item.behospitalCode}
         </foreach>
     </update>
 

+ 285 - 18
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -4,24 +4,291 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedLisInfo">
-        <id column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="rep_type" property="repType" />
-        <result column="rep_name" property="repName" />
-        <result column="rep_type_name" property="repTypeName" />
-        <result column="slide_type" property="slideType" />
-        <result column="rep_date" property="repDate" />
-        <result column="check_date" property="checkDate" />
-        <result column="apply_doctor" property="applyDoctor" />
-        <result column="dept_id" property="deptId" />
-        <result column="dept_name" property="deptName" />
-        <result column="register_flag" property="registerFlag" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <id column="rep_no" property="repNo"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="rep_type" property="repType"/>
+        <result column="rep_name" property="repName"/>
+        <result column="rep_type_name" property="repTypeName"/>
+        <result column="slide_type" property="slideType"/>
+        <result column="rep_date" property="repDate"/>
+        <result column="check_date" property="checkDate"/>
+        <result column="apply_doctor" property="applyDoctor"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="register_flag" property="registerFlag"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
 
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="behospitalCode != null">
+            and t.behospital_code = #{behospitalCode}
+        </if>
+    </select>
+    <!--获取缺陷检验项信息-->
+    <select id="getBadExamineInfo" resultType="java.lang.String">
+        select
+        distinct
+        b.repNo
+        from(
+        SELECT
+        t1.rep_no as repNo,
+        t1.rep_name as examineItemName,
+        t1.rep_type_name as examineItemType,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
+        t1.apply_doctor as doctorName,
+        t1.hospital_id as hospitalId,
+        t1.behospital_code as behospitalCode
+        FROM
+        med_lis_info t1,
+        med_lis_result t2,
+        med_behospital_info t3
+        WHERE
+        t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t3.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t2.item_name IS NOT NULL
+        AND t1.hospital_id = t2.hospital_id
+        and t1.hospital_id = t3.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 1l">
+            and t1.behospital_code = t3.behospital_code
+        </if>
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
+            and t1.behospital_code = t3.file_code
+        </if>
+        AND t1.rep_no = t2.rep_no
+        <if test="examineInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineInfoVO.hospitalId}
+        </if>
+        <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+        <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
+        </if>
+        <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
+            and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
+            <if test="examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
+            <if test="infos != null and infos.size() > 0">
+                and b.info  in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and b.info in('000000ASDQWEZXC@#$%')
+            </if>
+
+    </select>
+
+
+    <!--获取检验信息-->
+    <select id="getExamineInfo" resultType="com.diagbot.dto.ExamineInfoDTO">
+        select
+        distinct
+        b.repNo,
+        b.examineItemName,
+        b.examineItemType,
+        b.rTime as reptTime,
+        b.cTime as checkTime,
+        b.doctorName,
+        b.hospitalId,
+        b.behospitalCode
+        from(
+        SELECT
+        t1.rep_no as repNo,
+        t1.rep_name as examineItemName,
+        t1.rep_type_name as examineItemType,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as rTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as cTime,
+        t1.apply_doctor as doctorName,
+        t1.hospital_id as hospitalId,
+        t1.behospital_code as behospitalCode
+        FROM
+        med_lis_info t1
+        right join
+        med_behospital_info t3
+        on t1.hospital_id = t3.hospital_id
+        and t1.is_deleted = "N"
+        AND t3.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 1l">
+            and t1.behospital_code = t3.behospital_code
+        </if>
+        <if test="examineInfoVO.hospitalId != null and examineInfoVO.hospitalId == 2l">
+            and t1.behospital_code = t3.file_code
+        </if>
+        left join
+        med_lis_result t2
+        on t1.hospital_id = t2.hospital_id
+        AND t2.is_deleted = "N"
+        AND t2.item_name IS NOT NULL
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        WHERE
+        1=1
+        <if test="examineInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineInfoVO.hospitalId}
+        </if>
+        <if test="examineInfoVO.behospitalCode != null and examineInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineInfoVO.behospitalCode}
+        </if>
+        <if test="examineInfoVO.examineItemType != null and examineInfoVO.examineItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{examineInfoVO.examineItemType},'%')
+        </if>
+        <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
+            and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
+        </if>
+
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
+            <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 0">
+            <if test="examineInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
+        <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and b.info in('000000ASDQWEZXC@#$%')
+            </if>
+        </if>
+        <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 2 ">
+            <if test="badCheckInfo != null and badCheckInfo.size() > 0">
+                and b.repNo not in
+                <foreach collection="badCheckInfo" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="badCheckInfo = null || badCheckInfo.size() == 0">
+                and 1=1
+            </if>
+        </if>
+    </select>
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
+        </if>
+    </select>
+
+    <!--    获取检验子项信息-->
+    <select id="getExamineSonInfo" resultType="com.diagbot.dto.ExamineSonInfoDTO">
+        select t.* from(
+        SELECT
+        t2.item_name AS examineItemName,
+        CONCAT( t2.result, ifnull(t2.unit,'') ) AS examineItemResult,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as reptTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as checkTime,
+        CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        t1.apply_doctor AS doctorName
+        FROM
+        med_lis_info t1,
+        med_lis_result t2
+        where
+        t1.is_deleted = "N"
+        AND t2.is_deleted = "N"
+        AND t1.check_date IS NOT NULL
+        AND t1.hospital_id = t2.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        <if test="examineSonInfoVO.hospitalId != null">
+            and t1.hospital_id = #{examineSonInfoVO.hospitalId}
+        </if>
+        <if test="examineSonInfoVO.behospitalCode != null and examineSonInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{examineSonInfoVO.behospitalCode}
+        </if>
+        <if test="examineSonInfoVO.repNo != null and examineSonInfoVO.repNo != ''">
+            and t1.rep_no = #{examineSonInfoVO.repNo}
+        </if>)t
+        where 1=1
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and t.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and t.info in('000000ASDQWEZXC@#$%')
+            </if>
+        </if>
+        <if test="examineSonInfoVO.examineType != null and examineSonInfoVO.examineType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and t.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1=1
+            </if>
+        </if>
+    </select>
+
 </mapper>

+ 52 - 29
src/main/resources/mapper/MedLisResultMapper.xml

@@ -4,47 +4,70 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedLisResult">
-        <result column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="item_code" property="itemCode" />
-        <result column="item_name" property="itemName" />
-        <result column="result" property="result" />
-        <result column="reference" property="reference" />
-        <result column="reference_min" property="referenceMin" />
-        <result column="reference_max" property="referenceMax" />
-        <result column="unit" property="unit" />
-        <result column="abnormal" property="abnormal" />
-        <result column="color" property="color" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <result column="rep_no" property="repNo"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="item_code" property="itemCode"/>
+        <result column="item_name" property="itemName"/>
+        <result column="result" property="result"/>
+        <result column="reference" property="reference"/>
+        <result column="reference_min" property="referenceMin"/>
+        <result column="reference_max" property="referenceMax"/>
+        <result column="unit" property="unit"/>
+        <result column="abnormal" property="abnormal"/>
+        <result column="color" property="color"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
-    <select id="getMedLisResults" parameterType="com.diagbot.entity.BehospitalInfo" resultType="com.diagbot.dto.MedLisResultDTO">
+    <select id="getMedLisResults" parameterType="com.diagbot.entity.BehospitalInfo"
+            resultType="com.diagbot.dto.MedLisResultDTO">
         SELECT
-        t1.rep_no,t1.rep_name repName,t2.behospital_code,t2.hospital_id,t2.item_code,t2.item_name reportName,t2.result,t2.reference,t2.reference_max,t2.reference_min,
-        t2.unit,t2.abnormal,t2.color,t2.is_deleted,t2.gmt_create,t2.gmt_modified,t2.creator,t2.modifier
+        t1.rep_no,
+        t1.rep_name as repName,
+        t2.behospital_code,
+        t2.hospital_id,
+        t2.item_code,
+        t2.item_name as reportName,
+        t2.result,
+        t2.reference,
+        t2.reference_max,
+        t2.reference_min,
+        t2.unit,
+        t2.abnormal,
+        t2.color,
+        t2.is_deleted,
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as gmt_create,
+        t2.gmt_modified,
+        t2.creator,
+        t2.modifier
         FROM
-            med_lis_info t1,
-            med_lis_result t2
+        med_lis_info t1,
+        med_lis_result t2
         WHERE
-            t1.is_deleted = "N"
+        t1.is_deleted = "N"
         and t2.is_deleted = "N"
         AND t1.rep_name IS NOT NULL
         AND t1.check_date IS NOT NULL
         AND t2.item_name IS NOT NULL
-        and t1.hospital_id = #{hospitalId}
         and t1.hospital_id = t2.hospital_id
         and t1.behospital_code = t2.behospital_code
-        and t1.behospital_code = #{behospitalCode}
-        and t2.rep_no in(t1.rep_no)
+        <if test="fileCode != null and fileCode != ''">
+            and t1.behospital_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            and t1.hospital_id = #{hospitalId}
+        </if>
+        and t1.rep_no = t2.rep_no
         <if test="behospitalDate != null">
-            <![CDATA[ AND t1.check_date >= #{behospitalDate}]]>
+            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{behospitalDate}]]>
         </if>
-        <if test="leaveHospitalDate != null">
-            <![CDATA[ AND t1.check_date <= #{leaveHospitalDate}]]>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="leaveHospitalDate != null">
+                <![CDATA[AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{leaveHospitalDate}]]>
+            </if>
         </if>
     </select>
 

+ 142 - 21
src/main/resources/mapper/MedPacsInfoMapper.xml

@@ -4,27 +4,148 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedPacsInfo">
-        <id column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="rep_name" property="repName" />
-        <result column="rep_type" property="repType" />
-        <result column="rep_type_name" property="repTypeName" />
-        <result column="part" property="part" />
-        <result column="rep_date" property="repDate" />
-        <result column="check_date" property="checkDate" />
-        <result column="apply_doctor" property="applyDoctor" />
-        <result column="dept_id" property="deptId" />
-        <result column="dept_name" property="deptName" />
-        <result column="register_flag" property="registerFlag" />
-        <result column="report_doctor" property="reportDoctor" />
-        <result column="checker" property="checker" />
-        <result column="yjpdz" property="yjpdz" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <id column="rep_no" property="repNo"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="rep_name" property="repName"/>
+        <result column="rep_type" property="repType"/>
+        <result column="rep_type_name" property="repTypeName"/>
+        <result column="part" property="part"/>
+        <result column="rep_date" property="repDate"/>
+        <result column="check_date" property="checkDate"/>
+        <result column="apply_doctor" property="applyDoctor"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="register_flag" property="registerFlag"/>
+        <result column="report_doctor" property="reportDoctor"/>
+        <result column="checker" property="checker"/>
+        <result column="yjpdz" property="yjpdz"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
+    <!--    获取病人的出入院时间-->
+    <select id="getTime" resultType="java.util.HashMap">
+        select
+        t.behospital_date,
+        t.leave_hospital_date
+        from med_behospital_info t
+        where
+        t.is_deleted = 'N'
+        <if test="behospitalCode != null">
+            and t.behospital_code = #{behospitalCode}
+        </if>
+    </select>
 
+    <select id="getCheckInfo" resultType="com.diagbot.dto.CheckInfoDTO">
+        select DISTINCT b.*
+        from(
+        SELECT
+        t1.rep_name as checkItemName,
+        t1.rep_type_name as checkItemType,
+        CONCAT( t1.rep_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
+        date_format (t1.rep_date,'%Y-%m-%d %H:%i:%s') as reptTime,
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as checkTime,
+        t1.apply_doctor as doctorName,
+        t2.hospital_id as hospitalId,
+        t2.behospital_code as behospitalCode,
+        t2.rept_diag as checkResult
+        FROM
+        med_pacs_info t1
+        right join
+        med_behospital_info t3
+        on t1.hospital_id = t3.hospital_id
+        AND t1.is_deleted = "N"
+        AND t3.is_deleted = "N"
+        AND t1.rep_name IS NOT NULL
+        AND t1.check_date IS NOT NULL
+        <if test="checkInfoVO.hospitalId != null and checkInfoVO.hospitalId == 1l">
+            and t1.behospital_code = t3.behospital_code
+        </if>
+        <if test="checkInfoVO.hospitalId != null and checkInfoVO.hospitalId == 2l">
+            and t1.behospital_code = t3.file_code
+        </if>
+        left join
+        med_pacs_result t2
+        on t1.hospital_id = t2.hospital_id
+        AND t2.is_deleted = "N"
+        AND t1.behospital_code = t2.behospital_code
+        AND t1.rep_no = t2.rep_no
+        WHERE
+        1=1
+        <if test="checkInfoVO.hospitalId != null">
+            and t1.hospital_id = #{checkInfoVO.hospitalId}
+        </if>
+        <if test="checkInfoVO.behospitalCode != null and checkInfoVO.behospitalCode != ''">
+            and t1.behospital_code = #{checkInfoVO.behospitalCode}
+        </if>
+        <if test="checkInfoVO.checkItemType != null and checkInfoVO.checkItemType != ''">
+            and t1.rep_type_name like CONCAT('%',#{checkInfoVO.checkItemType},'%')
+        </if>
+        <if test="checkInfoVO.checkItemName != null and checkInfoVO.checkItemName != ''">
+            and t1.rep_name like CONCAT('%',#{checkInfoVO.checkItemName},'%')
+        </if>
+        <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 1">
+            <if test="checkInfoVO.leaveHospitalDate != null and checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{checkInfoVO.leaveHospitalDate}]]>
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 0">
+            <if test="checkInfoVO.behospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{checkInfoVO.behospitalDate}]]>
+            </if>
+        </if>
+        ) b
+        where 1=1
+        <if test="checkInfoVO.jxDateStart != null">
+            <![CDATA[ AND b.checkTime >= #{checkInfoVO.jxDateStart}]]>
+        </if>
+        <if test="checkInfoVO.jxDateEnd != null">
+            <![CDATA[ AND b.checkTime <= #{checkInfoVO.jxDateEnd}]]>
+        </if>
+        <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 1">
+            <if test="infos != null and infos.size() > 0">
+                and b.info in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and b.info in('000000ASDQWEZXC@#$%')
+            </if>
+        </if>
+        <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 2 ">
+            <if test="infos != null and infos.size() > 0">
+                and b.info not in
+                <foreach collection="infos" open="(" separator="," close=")" item="item">
+                    '${item}'
+                </foreach>
+            </if>
+            <if test="infos = null || infos.size() == 0">
+                and 1=1
+            </if>
+        </if>
+    </select>
+
+    <!--    获取质控提示信息-->
+    <select id="getInfo" resultType="java.lang.String">
+        select b.info
+        from
+        med_behospital_info a,
+        med_qcresult_detail b
+        where
+        a.is_deleted = 'N'
+        and b.is_deleted = 'N'
+        and a.hospital_id = b.hospital_id
+        and a.behospital_code = b.behospital_code
+        <if test="hospitalId != null">
+            and a.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and a.behospital_code = #{behospitalCode}
+        </if>
+    </select>
 </mapper>

+ 38 - 29
src/main/resources/mapper/MedPacsResultMapper.xml

@@ -4,30 +4,31 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.MedPacsResult">
-        <result column="rep_no" property="repNo" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="behospital_code" property="behospitalCode" />
-        <result column="rept_name" property="reptName" />
-        <result column="part" property="part" />
-        <result column="clinic_sight" property="clinicSight" />
-        <result column="rept_diag" property="reptDiag" />
-        <result column="remark" property="remark" />
-        <result column="clinic_diag" property="clinicDiag" />
-        <result column="apply_doctor" property="applyDoctor" />
-        <result column="checker_doctor" property="checkerDoctor" />
-        <result column="report_doctor" property="reportDoctor" />
-        <result column="dept_name" property="deptName" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <result column="rep_no" property="repNo"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="behospital_code" property="behospitalCode"/>
+        <result column="rept_name" property="reptName"/>
+        <result column="part" property="part"/>
+        <result column="clinic_sight" property="clinicSight"/>
+        <result column="rept_diag" property="reptDiag"/>
+        <result column="remark" property="remark"/>
+        <result column="clinic_diag" property="clinicDiag"/>
+        <result column="apply_doctor" property="applyDoctor"/>
+        <result column="checker_doctor" property="checkerDoctor"/>
+        <result column="report_doctor" property="reportDoctor"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
-    <select id="getMedPacsResults" parameterType="com.diagbot.entity.BehospitalInfo" resultType="com.diagbot.entity.MedPacsResult">
+    <select id="getMedPacsResults" parameterType="com.diagbot.entity.BehospitalInfo"
+            resultType="com.diagbot.entity.MedPacsResult">
         SELECT
-        t1.rep_no,
+        t2.rep_no repNo,
         t1.rep_name as reptName,
-        t1.dept_name,
+        t2.dept_name,
         t1.part,
         t2.hospital_id,
         t2.behospital_code,
@@ -39,7 +40,8 @@
         t2.report_doctor,
         t2.checker_doctor,
         t2.is_deleted,
-        t2.gmt_create,
+--         作为时间标记
+        date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') as gmt_create,
         t2.gmt_modified,
         t2.creator,
         t2.modifier
@@ -50,16 +52,23 @@
         t1.is_deleted = "N"
         AND t2.is_deleted = "N"
         AND t1.check_date IS NOT NULL
-        and t1.hospital_id = #{hospitalId}
         and t1.hospital_id = t2.hospital_id
         and t1.behospital_code = t2.behospital_code
-        and t1.behospital_code = #{behospitalCode}
-        and t2.rep_no in(t1.rep_no)
-        <if test="behospitalDate != null">
-            <![CDATA[ AND t1.check_date >= #{behospitalDate}]]>
+        <if test="fileCode != null and fileCode != ''">
+            and t1.behospital_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            and t1.hospital_id = #{hospitalId}
         </if>
-        <if test="leaveHospitalDate != null">
-            <![CDATA[ AND t1.check_date <= #{leaveHospitalDate}]]>
+            and t1.rep_no = t2.rep_no
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="leaveHospitalDate != null">
+                <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{leaveHospitalDate}]]>
+            </if>
         </if>
+        <if test="behospitalDate != null">
+            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{behospitalDate}]]>
+        </if>
+
     </select>
 </mapper>

+ 187 - 187
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -430,186 +430,31 @@
 
     <!-- 条目缺陷占比(内页) -->
     <select id="entryGroupByEntryInnerPage" resultType="com.diagbot.dto.EntryNumDTO">
-    SELECT
-    tt2.id as id,
-    tt2.name as name,
-    tt2.cases_id as casesId,
-    tt2.cases_name as casesName,
-    tt1.num as num,
-    tt1.is_reject as isReject
-    FROM
-    (
-    SELECT
-    a.hospital_id,
-    d.cases_entry_id,
-    d.cases_id,
-    count(*) as num,
-    d.is_reject
-    FROM
-        med_behospital_info a,
-        med_qcresult_detail d
-        WHERE
-        a.is_deleted = 'N'
-        AND d.is_deleted = 'N'
-        AND a.hospital_id = d.hospital_id
-        AND a.behospital_code = d.behospital_code
-    <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
-        AND a.is_placefile = #{filterPageVO.isPlacefile}
-    </if>
-    AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
-        </if>
-    <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
-        <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
-        </if>
-        <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
-        </if>
-    </if>
-    <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
-        <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
-        </if>
-        <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
-        </if>
-    </if>
-    <if test="filterPageVO.isReject != null">
-        AND d.is_reject = #{filterPageVO.isReject}
-    </if>
-    GROUP BY
-    d.cases_entry_id,
-    d.is_reject,
-    d.cases_id
-    ) tt1,
-    qc_cases_entry tt2
-    WHERE
-    tt2.is_deleted = 'N'
-    AND tt1.cases_id = tt2.cases_id
-    AND tt1.cases_entry_id = tt2.id
-    <if test="filterPageVO.name != null and filterPageVO.name != ''">
-        AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
-    </if>
-    <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-        AND tt2.cases_name = #{filterPageVO.casesName}
-    </if>
-
-        </select>
-    <!-- 条目缺陷占比缺陷总量(内页) -->
-    <select id="entryGroupByEntrySum" resultType="java.lang.Integer">
         SELECT
-        count(*) AS mrNum
-        FROM
-        med_behospital_info a,
-        med_qcresult_info c
-        WHERE
-        a.is_deleted = 'N'
-        AND c.is_deleted = 'N'
-        AND a.hospital_id = c.hospital_id
-        AND a.behospital_code = c.behospital_code
-        <if test="isPlacefile != null and isPlacefile != ''">
-            and a.is_placefile = #{isPlacefile}
-        </if>
-        AND a.qc_type_id != 0
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null and startDate != ''">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null and endDate != ''">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
-        </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null and startDate != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null and endDate != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
-        </if>
-    </select>
-
-    <!-- 条目缺陷占比分值统计 -->
-    <select id="entryGroupByEntryScore"  resultType="com.diagbot.dto.EntryNumDTO">
-    SELECT
-        a.hospital_id as hospitalId,
-
-        <if test="isPlacefile != null and isPlacefile == 0">
-            a.score_run as score,
-        </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            a.score,
-        </if>
-        a.cases_entry_id as id
-    FROM
-        qc_cases_entry_hospital a
-    WHERE
-        a.is_deleted = 'N'
-        AND a.hospital_id = #{hospitalId}
-        AND a.cases_entry_id IN
-        <foreach collection="ids" open="(" separator="," close=")" item="item">
-            ${item}
-        </foreach>
-    </select>
-    <!-- 条目缺陷占比原始数据统计(内页) -->
-  <!--  <select id="entryGroupByEntryInnerPage" resultType="com.diagbot.dto.EntryNumDTO">
-        SELECT
-        t.*
-        FROM
-        (
-        SELECT
-        t1.id AS id,
-        t1.NAME AS NAME,
-        t1.casesId AS casesId,
-        t1.casesName AS casesName,
-        t1.num AS num,
-        t2.mrNum AS totleNum,
-        t1.score AS score,
-        t1.isReject AS isReject,
-        Round( t1.num / t2.mrNum, 4 ) AS percent,
-        CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
-        FROM
-        (
-        SELECT
-        tt2.id,
-        tt2.NAME,
-        tt2.cases_id AS casesId,
-        tt2.cases_name AS casesName,
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
-            tt3.score_run as score,
-        </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
-            tt3.score,
-        </if>
-        tt1.num,
-        tt1.is_reject AS isReject
+        tt2.id as id,
+        tt2.name as name,
+        tt2.cases_id as casesId,
+        tt2.cases_name as casesName,
+        tt1.num as num,
+        tt1.is_reject as isReject
         FROM
         (
         SELECT
         a.hospital_id,
         d.cases_entry_id,
         d.cases_id,
-        count(*) AS num,
+        count(*) as num,
         d.is_reject
         FROM
         med_behospital_info a,
-        med_qcresult_info c,
         med_qcresult_detail d
         WHERE
         a.is_deleted = 'N'
-        AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND a.hospital_id = c.hospital_id
         AND a.hospital_id = d.hospital_id
-        AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageVO.isPlacefile}
+            AND a.is_placefile = #{filterPageVO.isPlacefile}
         </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
@@ -639,23 +484,21 @@
         d.is_reject,
         d.cases_id
         ) tt1,
-        qc_cases_entry tt2,
-        qc_cases_entry_hospital tt3
+        qc_cases_entry tt2
         WHERE
         tt2.is_deleted = 'N'
-        AND tt3.is_deleted = 'N'
-        AND tt1.hospital_id = tt3.hospital_id
         AND tt1.cases_id = tt2.cases_id
         AND tt1.cases_entry_id = tt2.id
-        AND tt1.cases_entry_id = tt3.cases_entry_id
         <if test="filterPageVO.name != null and filterPageVO.name != ''">
             AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
         </if>
         <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
             AND tt2.cases_name = #{filterPageVO.casesName}
         </if>
-        ) t1,
-        (
+
+    </select>
+    <!-- 条目缺陷占比缺陷总量(内页) -->
+    <select id="entryGroupByEntrySum" resultType="java.lang.Integer">
         SELECT
         count(*) AS mrNum
         FROM
@@ -666,32 +509,189 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageVO.isPlacefile}
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
         </if>
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
             </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
             </if>
         </if>
-        ) t2
-        ) t
-    </select>-->
+    </select>
+
+    <!-- 条目缺陷占比分值统计 -->
+    <select id="entryGroupByEntryScore"  resultType="com.diagbot.dto.EntryNumDTO">
+        SELECT
+        a.hospital_id as hospitalId,
+
+        <if test="isPlacefile != null and isPlacefile == 0">
+            a.score_run as score,
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            a.score,
+        </if>
+        a.cases_entry_id as id
+        FROM
+        qc_cases_entry_hospital a
+        WHERE
+        a.is_deleted = 'N'
+        AND a.hospital_id = #{hospitalId}
+        AND a.cases_entry_id IN
+        <foreach collection="ids" open="(" separator="," close=")" item="item">
+            ${item}
+        </foreach>
+    </select>
+    <!-- 条目缺陷占比原始数据统计(内页) -->
+    <!--  <select id="entryGroupByEntryInnerPage" resultType="com.diagbot.dto.EntryNumDTO">
+          SELECT
+          t.*
+          FROM
+          (
+          SELECT
+          t1.id AS id,
+          t1.NAME AS NAME,
+          t1.casesId AS casesId,
+          t1.casesName AS casesName,
+          t1.num AS num,
+          t2.mrNum AS totleNum,
+          t1.score AS score,
+          t1.isReject AS isReject,
+          Round( t1.num / t2.mrNum, 4 ) AS percent,
+          CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
+          FROM
+          (
+          SELECT
+          tt2.id,
+          tt2.NAME,
+          tt2.cases_id AS casesId,
+          tt2.cases_name AS casesName,
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+              tt3.score_run as score,
+          </if>
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+              tt3.score,
+          </if>
+          tt1.num,
+          tt1.is_reject AS isReject
+          FROM
+          (
+          SELECT
+          a.hospital_id,
+          d.cases_entry_id,
+          d.cases_id,
+          count(*) AS num,
+          d.is_reject
+          FROM
+          med_behospital_info a,
+          med_qcresult_info c,
+          med_qcresult_detail d
+          WHERE
+          a.is_deleted = 'N'
+          AND c.is_deleted = 'N'
+          AND d.is_deleted = 'N'
+          AND a.hospital_id = c.hospital_id
+          AND a.hospital_id = d.hospital_id
+          AND a.behospital_code = c.behospital_code
+          AND a.behospital_code = d.behospital_code
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+              and a.is_placefile = #{filterPageVO.isPlacefile}
+          </if>
+          AND a.qc_type_id != 0
+          <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+              AND a.hospital_id = #{filterPageVO.hospitalId}
+          </if>
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+              <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                  <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+              </if>
+              <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                  <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+              </if>
+          </if>
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+              <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                  <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+              </if>
+              <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                  <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+              </if>
+          </if>
+          <if test="filterPageVO.isReject != null">
+              AND d.is_reject = #{filterPageVO.isReject}
+          </if>
+          GROUP BY
+          d.cases_entry_id,
+          d.is_reject,
+          d.cases_id
+          ) tt1,
+          qc_cases_entry tt2,
+          qc_cases_entry_hospital tt3
+          WHERE
+          tt2.is_deleted = 'N'
+          AND tt3.is_deleted = 'N'
+          AND tt1.hospital_id = tt3.hospital_id
+          AND tt1.cases_id = tt2.cases_id
+          AND tt1.cases_entry_id = tt2.id
+          AND tt1.cases_entry_id = tt3.cases_entry_id
+          <if test="filterPageVO.name != null and filterPageVO.name != ''">
+              AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
+          </if>
+          <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+              AND tt2.cases_name = #{filterPageVO.casesName}
+          </if>
+          ) t1,
+          (
+          SELECT
+          count(*) AS mrNum
+          FROM
+          med_behospital_info a,
+          med_qcresult_info c
+          WHERE
+          a.is_deleted = 'N'
+          AND c.is_deleted = 'N'
+          AND a.hospital_id = c.hospital_id
+          AND a.behospital_code = c.behospital_code
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+              and a.is_placefile = #{filterPageVO.isPlacefile}
+          </if>
+          AND a.qc_type_id != 0
+          <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+              AND a.hospital_id = #{filterPageVO.hospitalId}
+          </if>
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+              <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                  <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+              </if>
+              <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                  <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+              </if>
+          </if>
+          <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+              <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                  <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+              </if>
+              <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                  <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+              </if>
+          </if>
+          ) t2
+          ) t
+      </select>-->
     <!-- 单项否决缺陷占比(首页) -->
     <select id="entryRejectPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.EntryNumDTO">
         SELECT