Forráskód Böngészése

Merge remote-tracking branch 'origin/dev/h5&log_20220506' into debug

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
#	src/main/resources/bootstrap.yml
zhaops 3 éve
szülő
commit
85978a37e4

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -297,6 +297,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qcView/data/**").permitAll()
                 .antMatchers("/medDefectFeedback/**").permitAll()
                 .antMatchers("/medNewsNotice/**").permitAll()
+                .antMatchers("/h5/statistics/**").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -374,6 +374,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qcView/data/*", request)
                 || matchers("/medDefectFeedback/*", request)
                 || matchers("/medNewsNotice/**", request)
+                || matchers("/h5/statistics/**", request)
                 || matchers("/", request)) {
             return true;
         }

+ 26 - 0
src/main/java/com/diagbot/dto/BehInfoForH5DTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 16:16
+ */
+@Data
+public class BehInfoForH5DTO {
+    private String name;
+    private String sex;
+    private String fileCode;
+    private String doctorId;
+    private String doctorName;
+    private String deptId;
+    private String deptName;
+    private String behospitalCode;
+    private Date leaveHospitalDate;
+    private Date behospitalDate;
+    private String LEVEL;
+    private Double deductScore;
+}

+ 0 - 74
src/main/java/com/diagbot/dto/ExportGetDetailRecordListPageDTO.java

@@ -1,74 +0,0 @@
-package com.diagbot.dto;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import io.swagger.annotations.ApiModel;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * @Description: 获取医生缺陷数量出参
- * @Author: zhanghang
- * @time: 2022/4/11 19:00
- */
-@ApiModel(value = "获取医生缺陷数量出参-接口出参")
-@Getter
-@Setter
-public class ExportGetDetailRecordListPageDTO implements Serializable {
-
-    @Excel(name = "病历等级", width = 30, orderNum = "1")
-    private String level;
-
-    @Excel(name = "病历得分", width = 30, orderNum = "2")
-    private Double scoreRes;
-
-    @Excel(name = "病案首页得分", width = 30, orderNum = "4")
-    private Double scoreBn;
-
-    @Excel(name = "病人住院序号", width = 40, orderNum = "3")
-    private String behospitalCode;
-
-    @Excel(name = "病案号", width = 30, orderNum = "5")
-    private String fileCode;
-
-    @Excel(name = "病人姓名", width = 30, orderNum = "6")
-    private String name;
-
-    @Excel(name = "性别", width = 20, orderNum = "7")
-    private String sex;
-
-    @Excel(name = "年龄", width = 20, orderNum = "8")
-    private String age;
-
-    @Excel(name = "床号", width = 30, orderNum = "9")
-    private String bedCode;
-
-    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "10")
-    private Date behospitalDate;
-
-    @Excel(name = "出院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "11")
-    private Date leaveHospitalDate;
-
-    @Excel(name = "归档日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "12")
-    private Date placefileDate;
-
-    @Excel(name = "主诊断", width = 60, orderNum = "13")
-    private String diagnose;
-
-    @Excel(name = "住院医生", width = 30, orderNum = "14")
-    private String behDoctorName;
-
-    @Excel(name = "主管医生", width = 30, orderNum = "15")
-    private String doctorName;
-
-    @Excel(name = "主任医生", width = 30, orderNum = "16")
-    private String directorDoctorName;
-
-    @Excel(name = "科室", width = 70, orderNum = "17")
-    private String behDeptName;
-
-    @Excel(name = "评分时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "18")
-    private Date gradeTime;
-}

+ 0 - 22
src/main/java/com/diagbot/dto/ExportGetDoctorDetailPageDTO.java

@@ -18,38 +18,16 @@ import java.io.Serializable;
 @Setter
 public class ExportGetDoctorDetailPageDTO implements Serializable {
 
-
     @Excel(name = "缺陷名称", width = 40, orderNum = "2")
     private String name;
 
     @Excel(name = "模块名称", width = 20, orderNum = "1")
     private String casesName;
 
-    @Excel(name = "科室ID", width = 20, orderNum = "9")
-    private String deptId;
-
-    @Excel(name = "科室名称", width = 20, orderNum = "10")
-    private String deptName;
-
-    @Excel(name = "缺陷总数", width = 20, orderNum = "11")
-    private Integer totleNum = 0;
-
     @Excel(name = "数量", orderNum = "5")
     private Integer num = 0;
 
     @Excel(name = "缺陷占比", orderNum = "6")
     private String percentStr = "0.00%";
 
-    @Excel(name = "分值", orderNum = "3")
-    private Double score = 0d;
-
-    @Excel(name = "单项否决", orderNum = "4", replace = { "否_0", "是_1" })
-    private Integer isReject;
-
-    @Excel(name = "医生ID", orderNum = "7")
-    private Long doctorId;
-
-    @Excel(name = "医生ID", orderNum = "8")
-    private String doctorName;
-
 }

+ 24 - 0
src/main/java/com/diagbot/dto/LevelPercentDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 17:17
+ */
+@Data
+public class LevelPercentDTO {
+    private String deptId;
+    private String deptName;
+    private Integer totleNum;
+    private Integer firstLevelNum;
+    private Integer secondLevelNum;
+    private Integer thirdLevelNum;
+    private Double firstPercent;
+    private Double secondPercent;
+    private Double thirdPercent;
+    private String firstPercentStr;
+    private String secondPercentStr;
+    private String thirdPercentStr;
+}

+ 43 - 17
src/main/java/com/diagbot/facade/ConsoleByDoctorFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAverageLevelDTO;
 import com.diagbot.dto.DoctorAverageStatisticsDTO;
+import com.diagbot.dto.ExportExcelDTO;
 import com.diagbot.dto.GetDetailRecordListPageDTO;
 import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.exception.CommonErrorCode;
@@ -16,6 +17,8 @@ import com.diagbot.vo.GetDoctorDetailPageVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @Description:控制台(医生)统计相关处理
  * @Author:songxl
@@ -51,16 +54,16 @@ public class ConsoleByDoctorFacade {
      */
     private void transformParam(DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
 
-        if("-".equals(doctorAverageStatisticsVO.getDeptId())){
+        if ("-".equals(doctorAverageStatisticsVO.getDeptId())) {
             doctorAverageStatisticsVO.setDeptId("-0");
         }
-        if("-".equals(doctorAverageStatisticsVO.getDeptName())){
+        if ("-".equals(doctorAverageStatisticsVO.getDeptName())) {
             doctorAverageStatisticsVO.setDeptName("-0");
         }
-        if("-".equals(doctorAverageStatisticsVO.getDoctorId())){
+        if ("-".equals(doctorAverageStatisticsVO.getDoctorId())) {
             doctorAverageStatisticsVO.setDoctorId("-0");
         }
-        if("-".equals(doctorAverageStatisticsVO.getDoctorName())){
+        if ("-".equals(doctorAverageStatisticsVO.getDoctorName())) {
             doctorAverageStatisticsVO.setDoctorName("-0");
         }
     }
@@ -77,7 +80,6 @@ public class ConsoleByDoctorFacade {
     }
 
 
-
     private void doctorAverageLevelPageSet(DoctorAverageLevelVO doctorAverageLevelVO) {
         //入参验证
         //入院时间
@@ -107,16 +109,16 @@ public class ConsoleByDoctorFacade {
         doctorAverageLevelVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
 
         //医生、科室为空时参数替换
-        if("-".equals(doctorAverageLevelVO.getDeptId())){
+        if ("-".equals(doctorAverageLevelVO.getDeptId())) {
             doctorAverageLevelVO.setDeptId("-0");
         }
-        if("-".equals(doctorAverageLevelVO.getDeptName())){
+        if ("-".equals(doctorAverageLevelVO.getDeptName())) {
             doctorAverageLevelVO.setDeptName("-0");
         }
-        if("-".equals(doctorAverageLevelVO.getDoctorCode())){
+        if ("-".equals(doctorAverageLevelVO.getDoctorCode())) {
             doctorAverageLevelVO.setDoctorCode("-0");
         }
-        if("-".equals(doctorAverageLevelVO.getDoctorName())){
+        if ("-".equals(doctorAverageLevelVO.getDoctorName())) {
             doctorAverageLevelVO.setDoctorName("-0");
         }
     }
@@ -128,16 +130,16 @@ public class ConsoleByDoctorFacade {
      * @return
      */
     public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(GetDoctorDetailPageVO getDoctorDetailPageVO) {
-        if("-".equals(getDoctorDetailPageVO.getDeptId())){
+        if ("-".equals(getDoctorDetailPageVO.getDeptId())) {
             getDoctorDetailPageVO.setDeptId("-0");
         }
-        if("-".equals(getDoctorDetailPageVO.getDeptName())){
+        if ("-".equals(getDoctorDetailPageVO.getDeptName())) {
             getDoctorDetailPageVO.setDeptName("-0");
         }
-        if("-".equals(getDoctorDetailPageVO.getDoctorId())){
+        if ("-".equals(getDoctorDetailPageVO.getDoctorId())) {
             getDoctorDetailPageVO.setDoctorId("-0");
         }
-        if("-".equals(getDoctorDetailPageVO.getDoctorName())){
+        if ("-".equals(getDoctorDetailPageVO.getDoctorName())) {
             getDoctorDetailPageVO.setDoctorName("-0");
         }
         getDoctorDetailPageVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
@@ -152,16 +154,16 @@ public class ConsoleByDoctorFacade {
      * @return
      */
     public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(GetDetailRecordListPageVO getDetailRecordListPageVO) {
-        if("-".equals(getDetailRecordListPageVO.getDeptId())){
+        if ("-".equals(getDetailRecordListPageVO.getDeptId())) {
             getDetailRecordListPageVO.setDeptId("-0");
         }
-        if("-".equals(getDetailRecordListPageVO.getDeptName())){
+        if ("-".equals(getDetailRecordListPageVO.getDeptName())) {
             getDetailRecordListPageVO.setDeptName("-0");
         }
-        if("-".equals(getDetailRecordListPageVO.getDoctorId())){
+        if ("-".equals(getDetailRecordListPageVO.getDoctorId())) {
             getDetailRecordListPageVO.setDoctorId("-0");
         }
-        if("-".equals(getDetailRecordListPageVO.getDoctorName())){
+        if ("-".equals(getDetailRecordListPageVO.getDoctorName())) {
             getDetailRecordListPageVO.setDoctorName("-0");
         }
         getDetailRecordListPageVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
@@ -169,4 +171,28 @@ public class ConsoleByDoctorFacade {
         return detailPageList;
     }
 
+    /**
+     * 导出缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> getDetailRecordListExport(GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        if ("-".equals(getDetailRecordListPageVO.getDeptId())) {
+            getDetailRecordListPageVO.setDeptId("-0");
+        }
+        if ("-".equals(getDetailRecordListPageVO.getDeptName())) {
+            getDetailRecordListPageVO.setDeptName("-0");
+        }
+        if ("-".equals(getDetailRecordListPageVO.getDoctorId())) {
+            getDetailRecordListPageVO.setDoctorId("-0");
+        }
+        if ("-".equals(getDetailRecordListPageVO.getDoctorName())) {
+            getDetailRecordListPageVO.setDoctorName("-0");
+        }
+        getDetailRecordListPageVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
+        List<ExportExcelDTO> detailPageList = behospitalInfoFacade.getBaseMapper().getDetailRecordListExport(getDetailRecordListPageVO);
+        return detailPageList;
+    }
+
 }

+ 2 - 3
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -945,10 +945,9 @@ public class ConsoleExportFacade {
         }
         getDetailRecordListPageVO.setSize(Long.MAX_VALUE);
         //1.查询
-        IPage<GetDetailRecordListPageDTO> detailRecordListPage = consoleByDoctorFacade.getDetailRecordListPage(getDetailRecordListPageVO);
-        List<ExportGetDetailRecordListPageDTO> records = BeanUtil.listCopyTo(detailRecordListPage.getRecords(), ExportGetDetailRecordListPageDTO.class);
+        List<ExportExcelDTO> detailRecordListExport = consoleByDoctorFacade.getDetailRecordListExport(getDetailRecordListPageVO);
         String fileName = "缺陷病历信息.xls";
         response.setContentType("text/html;charset=UTF-8");
-        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportGetDetailRecordListPageDTO.class, fileName, response);
+        ExcelUtils.exportExcelUser(detailRecordListExport, null, "sheet1", ExportExcelDTO.class, fileName, response);
     }
 }

+ 111 - 0
src/main/java/com/diagbot/facade/StatisticsForH5Facade.java

@@ -0,0 +1,111 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.BehInfoForH5DTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.LevelPercentDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BehInfoForH5VO;
+import com.diagbot.vo.FilterVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 10:40
+ */
+@Component
+public class StatisticsForH5Facade {
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    /**
+     * 单项否决占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<EntryNumDTO> entryRejectDistribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+        }
+        List<EntryNumDTO> retList = qcresultInfoFacade.entryRejectPercent(filterVO);
+        return retList;
+    }
+
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<LevelPercentDTO> levelDistribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        List<LevelPercentDTO> retList = qcresultInfoFacade.levelPercentByDept(filterVO);
+        return retList;
+    }
+
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5Distribution(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                filterVO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        List<DeptNumDTO> retList = qcresultInfoFacade.deductGT5ByDept(filterVO);
+        return retList;
+    }
+
+
+    /**
+     * 病历详情
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    public IPage<BehInfoForH5DTO> getBehInfoPage(BehInfoForH5VO behInfoForH5VO) {
+        if (StringUtil.isBlank(behInfoForH5VO.getHospitalId())) {
+            try {
+                String hospitalId = SysUserUtils.getCurrentHospitalID();
+                behInfoForH5VO.setHospitalId(hospitalId);
+            } catch (Exception e) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+            }
+        }
+        IPage<BehInfoForH5DTO> page = behospitalInfoFacade.behospitalInfoForH5(behInfoForH5VO);
+        return page;
+    }
+}

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

@@ -788,7 +788,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     List<BehospitalInfoAgeDTO> getBehospitalInfoAge(Long hospitalId, List<String> behospitalCodes);
 
     /**
-     *  医生质控平均分页面统计
+     * 医生质控平均分页面统计
      *
      * @param doctorAverageStatisticsVO
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageStatisticsDTO>
@@ -796,7 +796,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     IPage<DoctorAverageStatisticsDTO> doctorAverageStatistics(@Param("doctorAverageStatisticsVO") DoctorAverageStatisticsVO doctorAverageStatisticsVO);
 
     /**
-     *  医生质控平均分-患者列表(等级)
+     * 医生质控平均分-患者列表(等级)
      *
      * @param doctorAverageLevelVO
      * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageLevelDTO>
@@ -818,6 +818,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO);
+
     /**
      * 获取缺陷数量对应的病历
      *
@@ -826,4 +827,20 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
 
+    /**
+     * 导出缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> getDetailRecordListExport(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
+
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO);
+
 }

+ 20 - 3
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
 import com.diagbot.dto.GetDetailRecordListPageDTO;
 import com.diagbot.dto.GetDoctorDetailPageDTO;
+import com.diagbot.dto.LevelPercentDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
@@ -92,7 +93,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO);
 
-    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
+    public List<Map<String, Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
 
     /**
      * 各模块缺陷占比-按科室
@@ -151,6 +152,14 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     public IPage<QcResultPercentDTO> levelPercentGroupByDeptPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    List<LevelPercentDTO> levelPercentByDept(FilterVO filterVO);
+
     /**
      * 各模块缺陷占比-科室(分页)
      *
@@ -166,6 +175,7 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public IPage<EntryNumGroupDTO> entryCountGroupByEntryAndDeptPage(@Param("filterPageByDeptVO") FilterPageByDeptVO filterPageByDeptVO);
+
     /**
      * 条目缺陷占比基础数据(内页)
      *
@@ -178,14 +188,14 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      *
      * @return
      */
-    public Integer entryGroupByEntrySum(@Param("hospitalId") String hospitalId,@Param("isPlacefile") String isPlacefile,@Param("startDate") String startDate,@Param("endDate") String endDate);
+    public Integer entryGroupByEntrySum(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
     /**
      * 条目缺陷分值统计(内页)
      *
      * @return
      */
-    public List<EntryNumDTO> entryGroupByEntryScore(@Param("hospitalId") String hospitalId,@Param("isPlacefile") String isPlacefile, @Param("ids")Set<Long> ids);
+    public List<EntryNumDTO> entryGroupByEntryScore(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("ids") Set<Long> ids);
 
     /**
      * 条目缺陷占比-科室(内页)
@@ -219,4 +229,11 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO);
 }

+ 32 - 21
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -82,13 +82,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public int operationCount(FilterVO filterVO);
+
     /**
      * 病案管理指标(内页)
      *
      * @param timeVo
      * @return
      */
-    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
+    public Map<String, Object> getBaseIndex(MedIndexFilterVO timeVo);
 
     /**
      * 病案管理规则质控参数查询
@@ -96,7 +97,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public Map<String,Object> getCountByEntry( FilterVO filterVO);
+    public Map<String, Object> getCountByEntry(FilterVO filterVO);
 
     /**
      * 病案管理规则质控病历参数查询
@@ -104,9 +105,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public List<MedManageParamsDTO> getMedManageParams( FilterVO filterVO);
-
-
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO);
 
 
     /**
@@ -191,7 +190,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public IPage<HomePageNumXYDTO> homePageLevelStatisticsXY(FilterOrderXYPageVO filterOrderXYPageVO);
 
 
-
     /**
      * 病历质控报表-扣分项
      *
@@ -225,8 +223,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<CaseScoreDTO> getQualityCaseSorceByDept(CaseScoreVO caseScoreVO);
 
 
-
-
     /**
      * 病历质控报表
      *
@@ -249,7 +245,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param filterOrderVO
      * @return
      */
-    public List<LevelStsByDeptDTO> levelStatisticsByDept( FilterOrderVO filterOrderVO);
+    public List<LevelStsByDeptDTO> levelStatisticsByDept(FilterOrderVO filterOrderVO);
 
     /**
      * 单条条目缺陷统计-首页
@@ -360,8 +356,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<EntryStasByDeptDTO> entryStatisticsByDept(EntryStatisticsVO entryStatisticsVO);
 
 
-
-
     /**
      * 非医嘱离院病人记录
      *
@@ -485,28 +479,31 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 病历稽查表
+     *
      * @return
      */
-    IPage<MedicalCheckDTO>  getMedicalCheck(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
+    IPage<MedicalCheckDTO> getMedicalCheck(FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds);
 
     /**
      * 病历稽查表
+     *
      * @return
      */
-    IPage<MedicalCheckDTO>  getMedicalChecks(FilterMedicalCheckVO filterVO,@Param("casesEntryIds")List<Long> casesEntryIds);
+    IPage<MedicalCheckDTO> getMedicalChecks(FilterMedicalCheckVO filterVO, @Param("casesEntryIds") List<Long> casesEntryIds);
 
     /**
      * 病历稽查表导出
+     *
      * @return
      */
-    List<MedicalCheckExportDTO>  getMedicalCheckExport(FilterMedicalCheckVO filterVO);
+    List<MedicalCheckExportDTO> getMedicalCheckExport(FilterMedicalCheckVO filterVO);
 
     /**
      * 病历稽查表导出-科室
+     *
      * @return
      */
-    List<MedicalDeptDTO>  medicalCheckExportByDept(FilterMedicalCheckVO filterVO);
-
+    List<MedicalDeptDTO> medicalCheckExportByDept(FilterMedicalCheckVO filterVO);
 
 
     /**
@@ -527,6 +524,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 不合格数病历号(内页)
+     *
      * @param qcResultPageVO
      * @return
      */
@@ -557,6 +555,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 病案首页不合格/合格数病历详情页导出-科室
      *
@@ -566,7 +565,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
 
-
     /**
      * 31天再入院详情页
      *
@@ -606,6 +604,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 病案首页改善率质控评分页-科室(内页)
      *
@@ -666,30 +665,42 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String, String>> selectOperationNum(@Param("filterVO")FilterVO filterVO);
+    public List<Map<String, String>> selectOperationNum(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 触发规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules(@Param("filterVO")FilterVO filterVO);
+    public Map<String, Long> triggeringRules(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO);
+
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO);
 
 }

+ 18 - 1
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -9,6 +9,7 @@ import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
 import com.diagbot.dto.GetDetailRecordListPageDTO;
 import com.diagbot.dto.GetDoctorDetailPageDTO;
+import com.diagbot.dto.LevelPercentDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
@@ -141,6 +142,14 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     public IPage<QcResultPercentDTO> levelPercentGroupByDeptPage(@Param("filterPageVO") FilterPageVO filterPageVO);
 
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    List<LevelPercentDTO> levelPercentByDept(FilterVO filterVO);
+
     /**
      * 各模块缺陷占比-科室(分页)
      *
@@ -196,4 +205,12 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 
-}
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO);
+
+}

+ 35 - 20
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -4,17 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.*;
 import com.diagbot.entity.BehospitalInfo;
-import com.diagbot.entity.FilterRecordVO;
 import com.diagbot.mapper.BehospitalInfoMapper;
 import com.diagbot.service.BehospitalInfoService;
-import com.diagbot.util.ListUtil;
 import com.diagbot.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -181,7 +178,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     public IPage<QcResultShortDTO> getOrGoodLevelByDept(QcResultPageVO qcResultPageVO) {
-        return  baseMapper.getIsGoodLevelByDept(qcResultPageVO);
+        return baseMapper.getIsGoodLevelByDept(qcResultPageVO);
     }
 
     /**
@@ -249,6 +246,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<QualityControlDTO> getQualitySorce(CaseScoreVO caseScoreVO) {
         return baseMapper.getQualitySorce(caseScoreVO);
     }
+
     /**
      * 病历质控报表-扣分数据
      *
@@ -507,6 +505,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPage(qcResultShortPageVO);
         return qcResultShortDTOIPage;
     }
+
     /**
      * 离院病人质控评分详情页-科室
      *
@@ -576,7 +575,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
 
-
     /**
      * 条目缺陷质控评分详情页导出到excel
      *
@@ -858,6 +856,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return medicalCheckExport;
 
     }
+
     /**
      * 病历稽查表导出-科室
      *
@@ -939,6 +938,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.badLevelPagePageExport((qcResultShortPageVO));
     }
+
     /**
      * 病案首页不合格/合格数病历详情页导出-科室
      *
@@ -951,7 +951,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     }
 
 
-
     /**
      * 31天再入院详情页
      *
@@ -962,6 +961,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
         return baseMapper.reHos31DaysPage(reBeHosPageVO);
     }
+
     /**
      * 31天再入院详情页-科室
      *
@@ -1047,7 +1047,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo) {
+    public Map<String, Object> getBaseIndex(MedIndexFilterVO timeVo) {
         return baseMapper.getBaseIndex(timeVo);
     }
 
@@ -1058,7 +1058,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public Map<String,Object> getCountByEntry( FilterVO filterVO) {
+    public Map<String, Object> getCountByEntry(FilterVO filterVO) {
         return baseMapper.getCountByEntry(filterVO);
     }
 
@@ -1069,7 +1069,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public  List<MedManageParamsDTO> getMedManageParams( FilterVO filterVO) {
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO) {
         return baseMapper.getMedManageParams(filterVO);
     }
 
@@ -1083,6 +1083,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> qcCheckMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.qcCheckMRPage(qcResultShortPageVO);
     }
+
     /**
      * 质控核查质控评分页-科室(内页)
      *
@@ -1120,38 +1121,52 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
      *
-     * @param  filterVO
+     * @param filterVO
      * @return
      */
-    public List<Map<String, String>> selectOperationNum(@Param("filterVO")FilterVO filterVO){
-        return  baseMapper.selectOperationNum(filterVO);
+    public List<Map<String, String>> selectOperationNum(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.selectOperationNum(filterVO);
 
     }
 
     /**
      * 触发规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules(@Param("filterVO")FilterVO filterVO){
-        return  baseMapper.triggeringRules(filterVO);
+    public Map<String, Long> triggeringRules(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.triggeringRules(filterVO);
     }
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO){
-        return  baseMapper.getMedicalRecords(filterVO);
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.getMedicalRecords(filterVO);
     }
 
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO){
-        return  baseMapper.malignancy(filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO) {
+        return baseMapper.malignancy(filterVO);
     }
+
+    /**
+     * 病历详情(H5)
+     *
+     * @param behInfoForH5VO
+     * @return
+     */
+    public IPage<BehInfoForH5DTO> behospitalInfoForH5(BehInfoForH5VO behInfoForH5VO) {
+        return baseMapper.behospitalInfoForH5(behInfoForH5VO);
+    }
+
 }

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

@@ -7,8 +7,7 @@ import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.GetDetailRecordListPageDTO;
-import com.diagbot.dto.GetDoctorDetailPageDTO;
+import com.diagbot.dto.LevelPercentDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
@@ -17,15 +16,17 @@ import com.diagbot.service.QcresultInfoService;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
-import com.diagbot.vo.GetDetailRecordListPageVO;
-import com.diagbot.vo.GetDoctorDetailPageVO;
 import com.diagbot.vo.QcresultFilterVO;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
 import java.text.DecimalFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -116,8 +117,9 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO) {
         return baseMapper.resultCountByDept(qcresultFilterVO);
     }
+
     @Override
-    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO){
+    public List<Map<String, Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO) {
         return baseMapper.resultMrCountByDept(qcresultFilterVO);
     }
 
@@ -187,6 +189,17 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         return baseMapper.levelPercentGroupByDeptPage(filterPageVO);
     }
 
+    /**
+     * 病历等级占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<LevelPercentDTO> levelPercentByDept(FilterVO filterVO) {
+        return baseMapper.levelPercentByDept(filterVO);
+    }
+
     /**
      * 各模块缺陷占比-科室(分页)
      *
@@ -243,14 +256,14 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         //缺陷分值
         String isPlacefile = filterPageVO.getIsPlacefile();
         List<EntryNumDTO> entryScore = new ArrayList<>();
-        entryScore = baseMapper.entryGroupByEntryScore(hospitalId,isPlacefile, ids);
+        entryScore = baseMapper.entryGroupByEntryScore(hospitalId, isPlacefile, ids);
         for (EntryNumDTO record : records) {
             for (EntryNumDTO entryNumDTO : entryScore) {
-                if(record.getId().equals(entryNumDTO.getId())){
-                 record.setScore(entryNumDTO.getScore());
-                    }
+                if (record.getId().equals(entryNumDTO.getId())) {
+                    record.setScore(entryNumDTO.getScore());
                 }
             }
+        }
         return entryNumDTOIPage;
     }
 
@@ -289,6 +302,7 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
 
     /**
      * 各科室甲/乙/丙级病历占比
+     *
      * @param filterVO
      * @return
      */
@@ -297,4 +311,14 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         return baseMapper.qcResultLevelPercent(filterVO);
     }
 
+    /**
+     * 病历扣分大于等于5占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<DeptNumDTO> deductGT5ByDept(FilterVO filterVO) {
+        return baseMapper.deductGT5ByDept(filterVO);
+    }
 }

+ 50 - 0
src/main/java/com/diagbot/vo/BehInfoForH5VO.java

@@ -0,0 +1,50 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 16:10
+ */
+@Data
+public class BehInfoForH5VO extends Page {
+    private String deptId;
+    private String deptName;
+    private String hospitalId;
+
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+    /**
+     * 结束时间
+     */
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+
+    /**
+     * 评分等级
+     */
+    private String level;
+
+    /**
+     * 单项否决标志
+     */
+    private Integer isReject;
+    /**
+     * 条目id
+     */
+    private Long caseEntryId;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+
+    /**
+     * 扣分
+     */
+    private Double deductScore;
+}

+ 85 - 0
src/main/java/com/diagbot/web/StatisticsForH5Controller.java

@@ -0,0 +1,85 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BehInfoForH5DTO;
+import com.diagbot.dto.DeptNumDTO;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.LevelPercentDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.StatisticsForH5Facade;
+import com.diagbot.vo.BehInfoForH5VO;
+import com.diagbot.vo.FilterVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/5/6 15:24
+ */
+@RequestMapping("/h5/statistics")
+@RestController
+@Api(value = "H5数据统计相关API", tags = { "H5数据统计相关API" })
+@SuppressWarnings("unchecked")
+public class StatisticsForH5Controller {
+    @Autowired
+    StatisticsForH5Facade statisticsForH5Facade;
+
+    @ApiOperation(value = "单项否决占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/entryRejectDistribution")
+    @SysLogger("entryRejectDistribution")
+    public RespDTO<List<EntryNumDTO>> entryRejectDistribution(@RequestBody @Valid FilterVO filterVO) {
+        List<EntryNumDTO> data = statisticsForH5Facade.entryRejectDistribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "病历等级占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/levelDistribution")
+    @SysLogger("levelDistribution")
+    public RespDTO<List<LevelPercentDTO>> levelDistribution(@RequestBody @Valid FilterVO filterVO) {
+        List<LevelPercentDTO> data = statisticsForH5Facade.levelDistribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+
+    @ApiOperation(value = "病历扣分大于等于5占比[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/deductGT5Distribution")
+    @SysLogger("deductGT5Distribution")
+    public RespDTO<List<DeptNumDTO>> deductGT5Distribution(@RequestBody @Valid FilterVO filterVO) {
+        List<DeptNumDTO> data = statisticsForH5Facade.deductGT5Distribution(filterVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "病历详情[by:zhaops]",
+            notes = "startDate: 统计时间(起始时间)<br>" +
+                    "endDate: 统计时间(截止时间)<br>" +
+                    "hospitalId: 医院id<br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/getBehInfoPage")
+    @SysLogger("getBehInfoPage")
+    public RespDTO<IPage<BehInfoForH5DTO>> getBehInfoPage(@RequestBody @Valid BehInfoForH5VO behInfoForH5VO) {
+        IPage<BehInfoForH5DTO> data = statisticsForH5Facade.getBehInfoPage(behInfoForH5VO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 671 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -20886,4 +20886,675 @@
         </if>
     </select>
 
+    <!-- 条目缺陷评分详情页导出-->
+    <select id="getDetailRecordListExport" resultMap="ExportExcelMap">
+        SELECT * from(
+        SELECT
+        f1.*,
+        f2.avgScore
+        FROM
+        (SELECT
+        t.*,
+        qi.score_res AS score,
+        qd.msg AS msg,
+        qc.NAME AS caseName
+        FROM
+        (SELECT DISTINCT
+        t1.hospital_id AS hospitalId,
+        t1.behospital_code AS behospitalCode,
+        t1.bed_code AS bedCode,
+        t1.LEVEL AS LEVEL,
+        t1.grade_type AS gradeType,
+        t1.score_res AS scoreRes,
+        t1.scoreBn AS scoreBn,
+        t1.NAME AS patName,
+        t1.sex AS sex,
+        t1.beh_dept_id AS behDeptId,
+        t1.beh_dept_name AS behDeptName,
+        t1.doctor_id AS doctorId,
+        t1.doctor_name AS doctorName,
+        t1.beh_doctor_id AS behDoctorId,
+        t1.beh_doctor_name AS behDoctorName,
+        t1.director_doctor_id AS directorDoctorId,
+        t1.director_doctor_name AS directorDoctorName,
+        t1.birthday AS birthday,
+        t1.behospital_date AS behospitalDate,
+        t1.leave_hospital_date AS leaveHospitalDate,
+        t1.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose AS diagnose,
+        t1.ward_name AS wardName,
+        t1.file_code AS fileCode,
+        t1.checkStatus AS checkStatus,
+        t1.mrStatus AS mrStatus,
+        t1.chName AS chName,
+        t1.mrName AS mrName,
+        t1.chTime AS chTime,
+        t1.mrTime AS mrTime
+        FROM
+        (
+        SELECT DISTINCT
+        tt1.*
+        FROM
+        (SELECT
+        be.*,
+        ifnull(mci.status,0) AS checkStatus,
+        ifnull(hm_mci.status,0) AS mrStatus,
+        mci.check_name as chName,
+        hm_mci.check_name as mrName,
+        mci.gmt_create as chTime,
+        e.score_res as scoreBn,
+        hm_mci.gmt_create as mrTime
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.bed_code,
+        a.file_code,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        a.NAME,
+        a.sex,
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.birthday,
+        a.behospital_date,
+        a.leave_hospital_date,
+        a.doctor_id,
+        a.doctor_name,
+        a.beh_doctor_id,
+        a.beh_doctor_name,
+        a.director_doctor_id,
+        a.director_doctor_name,
+        a.diagnose,
+        a.placefile_date,
+        a.ward_name,
+        b.gmt_create
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.qc_type_id != 0
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile != ''">
+            and a.is_placefile = #{getDetailRecordListPageVO.isPlacefile}
+        </if>
+        <if test="getDetailRecordListPageVO.hospitalId != null and getDetailRecordListPageVO.hospitalId != ''">
+            AND a.hospital_id = #{getDetailRecordListPageVO.hospitalId}
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 0">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 1">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.diagnose != null and getDetailRecordListPageVO.diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{getDetailRecordListPageVO.diagnose}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.level != null and getDetailRecordListPageVO.level != ''">
+            AND b.`level` = #{getDetailRecordListPageVO.level}
+        </if>
+        <if test="getDetailRecordListPageVO.behospitalCode != null and getDetailRecordListPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{getDetailRecordListPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.patName != null and getDetailRecordListPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{getDetailRecordListPageVO.patName}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryName != null and getDetailRecordListPageVO.casesEntryName != ''">
+            AND d.NAME = #{getDetailRecordListPageVO.casesEntryName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null ">
+            AND d.id = #{getDetailRecordListPageVO.casesEntryId}
+        </if>
+        <if test="getDetailRecordListPageVO.casesName != null and getDetailRecordListPageVO.casesName != ''">
+            AND d.cases_name = #{getDetailRecordListPageVO.casesName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesId != null">
+            AND d.cases_id = #{getDetailRecordListPageVO.casesId}
+        </if>
+        <if test="getDetailRecordListPageVO.deptName != null and getDetailRecordListPageVO.deptName != '' and getDetailRecordListPageVO.deptName != '-0'">
+            AND a.beh_dept_name = #{getDetailRecordListPageVO.deptName}
+        </if>
+        <if test="getDetailRecordListPageVO.deptName == '-0'">
+            AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.deptId != null and getDetailRecordListPageVO.deptId != '' and getDetailRecordListPageVO.deptId != '-0'">
+            AND a.beh_dept_id = #{getDetailRecordListPageVO.deptId}
+        </if>
+        <if test="getDetailRecordListPageVO.deptId == '-0'">
+            AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.doctorId != null and getDetailRecordListPageVO.doctorId != '' and getDetailRecordListPageVO.doctorId != '-0'">
+            AND a.doctor_id = #{getDetailRecordListPageVO.doctorId}
+        </if>
+        <if test="getDetailRecordListPageVO.doctorId == '-0'">
+            AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.doctorName != null and getDetailRecordListPageVO.doctorName != '' and getDetailRecordListPageVO.doctorName != '-0' ">
+            AND a.doctor_name =  #{getDetailRecordListPageVO.doctorName}
+        </if>
+        <if test="getDetailRecordListPageVO.doctorName == '-0'">
+            AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.isReject != null">
+            AND c.is_reject = #{getDetailRecordListPageVO.isReject}
+        </if>
+        <if test="getDetailRecordListPageVO.ruleType != null">
+            AND d.rule_type = #{getDetailRecordListPageVO.ruleType}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2495">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 30
+        </if>
+        <if test="getDetailRecordListPageVO.beHosGT31Days != null and getDetailRecordListPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type in(0,2)
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
+        left join med_check_info hm_mci
+        on hm_mci.is_deleted = 'N'
+        and hm_mci.check_type = 1
+        and be.hospital_id = hm_mci.hospital_id
+        and be.behospital_code = hm_mci.behospital_code
+        LEFT JOIN med_qcresult_cases e
+        on  be.behospital_code = e.behospital_code
+        and be.hospital_id = e.hospital_id
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        )tt1
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2511">
+            ,med_medical_record tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+            AND tt2.mode_id = 30
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2419">
+            ,med_crisis_info tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+        </if>
+        ) t1
+        <if test="getDetailRecordListPageVO.casesEntryId == null or (getDetailRecordListPageVO.casesEntryId!=2594  and getDetailRecordListPageVO.casesEntryId!=2973 and getDetailRecordListPageVO.casesEntryId!=2930)">
+            LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.is_deleted = 'N'
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and( getDetailRecordListPageVO.casesEntryId==2594  or getDetailRecordListPageVO.casesEntryId==2973 or getDetailRecordListPageVO.casesEntryId==2930)">
+            , med_home_page t2
+            , med_home_operation_info t3
+            WHERE t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.home_page_id = t3.home_page_id
+            AND t2.is_deleted = 'N'
+            AND t3.is_deleted = 'N'
+        </if>
+        ) t
+        LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
+        AND t.hospitalId = qi.hospital_id
+        AND t.behospitalCode = qi.behospital_code
+        LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
+        AND t.hospitalId = qd.hospital_id
+        AND t.behospitalCode = qd.behospital_code
+        LEFT JOIN qc_cases qc ON qc.is_deleted = 'N'
+        AND qd.cases_id = qc.id
+        LEFT JOIN qc_cases_entry qce ON qce.is_deleted = 'N'
+        AND qd.cases_id = qce.cases_id
+        AND qd.cases_entry_id = qce.id
+        where 1=1
+        <if test="getDetailRecordListPageVO.checkStatus != null">
+            AND t.checkStatus = #{getDetailRecordListPageVO.checkStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.mrStatus != null">
+            AND t.mrStatus = #{getDetailRecordListPageVO.mrStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.chName != null and getDetailRecordListPageVO.chName!=''">
+            AND t.chName like concat('%', #{getDetailRecordListPageVO.chName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.mrName != null and getDetailRecordListPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{getDetailRecordListPageVO.mrName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{getDetailRecordListPageVO.chTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{getDetailRecordListPageVO.chTimeEnd}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{getDetailRecordListPageVO.mrTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{getDetailRecordListPageVO.mrTimeEnd}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryName != null and getDetailRecordListPageVO.casesEntryName != ''">
+            AND qce.NAME = #{getDetailRecordListPageVO.casesEntryName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null ">
+            AND qce.id = #{getDetailRecordListPageVO.casesEntryId}
+        </if>
+        <if test="getDetailRecordListPageVO.casesName != null and getDetailRecordListPageVO.casesName != ''">
+            AND qce.cases_name = #{getDetailRecordListPageVO.casesName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesId != null">
+            AND qce.cases_id = #{getDetailRecordListPageVO.casesId}
+        </if>
+        )f1,
+        (SELECT
+        ROUND( AVG( qi.score_res ), 2 ) AS avgScore,
+        t.behDeptId,
+        t.behDeptName
+        FROM
+        (SELECT DISTINCT
+        t1.hospital_id AS hospitalId,
+        t1.behospital_code AS behospitalCode,
+        t1.bed_code AS bedCode,
+        t1.LEVEL AS LEVEL,
+        t1.grade_type AS gradeType,
+        t1.score_res AS scoreRes,
+        t1.NAME AS NAME,
+        t1.sex AS sex,
+        t1.beh_dept_id AS behDeptId,
+        t1.beh_dept_name AS behDeptName,
+        t1.doctor_id AS doctorId,
+        t1.doctor_name AS doctorName,
+        t1.beh_doctor_id AS behDoctorId,
+        t1.beh_doctor_name AS behDoctorName,
+        t1.director_doctor_id AS directorDoctorId,
+        t1.director_doctor_name AS directorDoctorName,
+        t1.birthday AS birthday,
+        t1.behospital_date AS behospitalDate,
+        t1.leave_hospital_date AS leaveHospitalDate,
+        t1.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose,
+        t1.ward_name AS wardName,
+        t2.age,
+        t1.file_code AS fileCode,
+        t1.checkStatus,
+        t1.mrStatus,
+        t1.chName,
+        t1.mrName,
+        t1.chTime,
+        t1.mrTime
+        FROM
+        (
+        SELECT DISTINCT
+        tt1.*
+        FROM
+        (SELECT
+        be.*,
+        ifnull(mci.status,0) AS checkStatus,
+        ifnull(hm_mci.status,0) AS mrStatus,
+        mci.check_name as chName,
+        hm_mci.check_name as mrName,
+        mci.gmt_create as chTime,
+        hm_mci.gmt_create as mrTime
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.bed_code,
+        a.file_code,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        a.NAME,
+        a.sex,
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.birthday,
+        a.behospital_date,
+        a.leave_hospital_date,
+        a.doctor_id,
+        a.doctor_name,
+        a.beh_doctor_id,
+        a.beh_doctor_name,
+        a.director_doctor_id,
+        a.director_doctor_name,
+        a.diagnose,
+        a.placefile_date,
+        a.ward_name,
+        b.gmt_create
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.qc_type_id != 0
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile != ''">
+            and a.is_placefile = #{getDetailRecordListPageVO.isPlacefile}
+        </if>
+        <if test="getDetailRecordListPageVO.hospitalId != null and getDetailRecordListPageVO.hospitalId != ''">
+            AND a.hospital_id = #{getDetailRecordListPageVO.hospitalId}
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 0">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 1">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.diagnose != null and getDetailRecordListPageVO.diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{getDetailRecordListPageVO.diagnose}, '%' )
+        </if>
+
+        <if test="getDetailRecordListPageVO.level != null and getDetailRecordListPageVO.level != ''">
+            AND b.`level` = #{getDetailRecordListPageVO.level}
+        </if>
+        <if test="getDetailRecordListPageVO.behospitalCode != null and getDetailRecordListPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{getDetailRecordListPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.patName != null and getDetailRecordListPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{getDetailRecordListPageVO.patName}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryName != null and getDetailRecordListPageVO.casesEntryName != ''">
+            AND d.NAME = #{getDetailRecordListPageVO.casesEntryName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null ">
+            AND d.id = #{getDetailRecordListPageVO.casesEntryId}
+        </if>
+        <if test="getDetailRecordListPageVO.casesName != null and getDetailRecordListPageVO.casesName != ''">
+            AND d.cases_name = #{getDetailRecordListPageVO.casesName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesId != null">
+            AND d.cases_id = #{getDetailRecordListPageVO.casesId}
+        </if>
+        <if test="getDetailRecordListPageVO.deptName != null and getDetailRecordListPageVO.deptName != '' and getDetailRecordListPageVO.deptName != '-0'">
+            AND a.beh_dept_name = #{getDetailRecordListPageVO.deptName}
+        </if>
+        <if test="getDetailRecordListPageVO.deptName == '-0'">
+            AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.deptId != null and getDetailRecordListPageVO.deptId != '' and getDetailRecordListPageVO.deptId != '-0'">
+            AND a.beh_dept_id = #{getDetailRecordListPageVO.deptId}
+        </if>
+        <if test="getDetailRecordListPageVO.deptId == '-0'">
+            AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.doctorId != null and getDetailRecordListPageVO.doctorId != '' and getDetailRecordListPageVO.doctorId != '-0'">
+            AND a.doctor_id = #{getDetailRecordListPageVO.doctorId}
+        </if>
+        <if test="getDetailRecordListPageVO.doctorId == '-0'">
+            AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.doctorName != null and getDetailRecordListPageVO.doctorName != '' and getDetailRecordListPageVO.doctorName != '-0' ">
+            AND a.doctor_name =  #{getDetailRecordListPageVO.doctorName}
+        </if>
+        <if test="getDetailRecordListPageVO.doctorName == '-0'">
+            AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
+        </if>
+        <if test="getDetailRecordListPageVO.isReject != null">
+            AND c.is_reject = #{getDetailRecordListPageVO.isReject}
+        </if>
+        <if test="getDetailRecordListPageVO.ruleType != null">
+            AND d.rule_type = #{getDetailRecordListPageVO.ruleType}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2495">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 30
+        </if>
+        <if test="getDetailRecordListPageVO.beHosGT31Days != null and getDetailRecordListPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type in(0,2)
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
+        left join med_check_info hm_mci
+        on hm_mci.is_deleted = 'N'
+        and hm_mci.check_type = 1
+        and be.hospital_id = hm_mci.hospital_id
+        and be.behospital_code = hm_mci.behospital_code
+        )tt1
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2511">
+            ,med_medical_record tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+            AND tt2.mode_id = 30
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2419">
+            ,med_crisis_info tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+        </if>
+        ) t1
+        <if test="getDetailRecordListPageVO.casesEntryId == null or (getDetailRecordListPageVO.casesEntryId!=2594  and getDetailRecordListPageVO.casesEntryId!=2973 and getDetailRecordListPageVO.casesEntryId!=2930)">
+            LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.is_deleted = 'N'
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and( getDetailRecordListPageVO.casesEntryId==2594  or getDetailRecordListPageVO.casesEntryId==2973 or getDetailRecordListPageVO.casesEntryId==2930)">
+            , med_home_page t2
+            , med_home_operation_info t3
+            WHERE t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.home_page_id = t3.home_page_id
+            AND t2.is_deleted = 'N'
+            AND t3.is_deleted = 'N'
+        </if>
+        ) t
+        LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
+        AND t.hospitalId = qi.hospital_id
+        AND t.behospitalCode = qi.behospital_code
+        where 1=1
+        <if test="getDetailRecordListPageVO.checkStatus != null">
+            AND t.checkStatus = #{getDetailRecordListPageVO.checkStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.mrStatus != null">
+            AND t.mrStatus = #{getDetailRecordListPageVO.mrStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.chName != null and getDetailRecordListPageVO.chName!=''">
+            AND t.chName like concat('%', #{getDetailRecordListPageVO.chName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.mrName != null and getDetailRecordListPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{getDetailRecordListPageVO.mrName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{getDetailRecordListPageVO.chTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{getDetailRecordListPageVO.chTimeEnd}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{getDetailRecordListPageVO.mrTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{getDetailRecordListPageVO.mrTimeEnd}]]>
+        </if>
+        GROUP BY
+        t.behDeptId,
+        t.behDeptName
+        )f2
+        WHERE
+        f1.behDeptId = f2.behDeptId
+        AND f1.behDeptName = f2.behDeptName
+        )m
+    </select>
+
+    <!--病历详情-->
+    <select id="behospitalInfoForH5" parameterType="com.diagbot.vo.BehInfoForH5VO" resultType="com.diagbot.dto.BehInfoForH5DTO">
+        SELECT
+        k1.name AS name,
+        k1.sex AS sex,
+        k1.file_code AS fileCode,
+        k1.doctor_id AS doctorId,
+        k1.doctor_name AS doctorName,
+        k1.beh_dept_id AS deptId,
+        k1.beh_dept_name AS deptName,
+        k1.behospital_code AS behospitalCode,
+        k1.leave_hospital_date AS leaveHospitalDate,
+        k1.behospital_date AS behospitalDate,
+        k2.`level` AS LEVEL,
+        k5.totleScore-k2.score_res AS deductScore
+        FROM
+        (
+        SELECT
+        a.*
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        <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="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </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>
+        ) k1
+        LEFT JOIN ( SELECT b.* FROM med_qcresult_info b
+        WHERE
+        b.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND b.hospital_id = #{hospitalId}
+        </if>
+        ) k2 ON k1.hospital_id = k2.hospital_id
+        AND k1.behospital_code = k2.behospital_code
+        LEFT JOIN (
+        SELECT
+        c.*
+        FROM
+        med_qcresult_detail c
+        WHERE
+        c.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND c.hospital_id = #{hospitalId}
+        </if>
+        ) k3 ON k1.hospital_id = k3.hospital_id
+        AND k1.behospital_code = k3.behospital_code
+        LEFT JOIN ( SELECT d.* FROM med_home_page d
+        WHERE
+        d.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND d.hospital_id = #{hospitalId}
+        </if>
+        ) k4 ON k1.hospital_id = k4.hospital_id
+        AND k1.behospital_code = k4.behospital_code
+        LEFT JOIN (
+        SELECT
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        is_deleted = 'N'
+        AND CODE = 'score_type'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND hospital_id = #{hospitalId}
+        </if>
+        ) k5 ON k1.hospital_id = k5.hospital_id
+        WHERE
+        1 = 1
+        <if test="isReject != null ">
+            AND k3.is_reject = #{isReject}
+        </if>
+        <if test="caseEntryId != null ">
+            AND k3.case_entry_id =#{caseEntryId}
+        </if>
+        <if test="level != null and level != ''">
+            AND  k2.`level` =#{level}
+        </if>
+        <if test="deductScore != null">
+            AND k5.totleScore-k2.score_res>=#{deductScore}
+        </if>
+        GROUP BY
+        k1.hospital_id,
+        k1.behospital_code
+    </select>
+
 </mapper>

+ 156 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -748,6 +748,12 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -796,6 +802,12 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile == 0">
             <if test="startDate != null and startDate != ''">
                 <![CDATA[ AND a.behospital_date >= #{startDate}]]>
@@ -816,6 +828,7 @@
         ORDER BY
         percent DESC
     </select>
+
     <!-- 各科室质控平均分(首页) -->
     <select id="getAverageScore" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
         select
@@ -2138,6 +2151,72 @@
         ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ) DESC) t
     </select>
 
+
+    <!-- 按科室统计质控病历数(分页) -->
+    <select id="levelPercentByDept" resultType="com.diagbot.dto.LevelPercentDTO">
+        SELECT t.*
+        FROM
+        (SELECT
+        a.beh_dept_id AS deptId,
+        a.beh_dept_name AS deptName,
+        count(*) AS totleNum,
+        sum( c.`level` = '甲' ) AS firstLevelNum,
+        sum( c.`level` = '乙' ) AS secondLevelNum,
+        sum( c.`level` = '丙' ) AS thirdLevelNum,
+        ROUND( sum( c.`level` = '甲' )/ count(*), 4 ) AS firstPercent,
+        ROUND( sum( c.`level` = '乙' )/ count(*), 4 ) AS sencondPercent,
+        ROUND( sum( c.`level` = '丙' )/ count(*), 4 ) AS thirdPercent,
+        concat( ROUND( sum( c.`level` = '甲' )/ count(*)* 100, 2 ), '%' ) AS firstPercentStr,
+        concat( ROUND( sum( c.`level` = '乙' )/ count(*)* 100, 2 ), '%' ) AS sencondPercentStr,
+        concat( ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ), '%' ) AS thirdPercentStr
+        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>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </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>
+        <if test="level != null and level != ''">
+            AND c.`level` = #{level}
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+        order by firstPercent DESC,
+        sencondPercent DESC,
+        thirdPercent DESC) t
+    </select>
+
     <!-- 按模块统计质控缺陷数-科室(分页) -->
     <select id="entryCountGroupByCaseAndDeptPage" resultType="com.diagbot.dto.NumDTO">
         SELECT
@@ -2497,5 +2576,82 @@
         )t
     </select>
 
+    <!--病历扣分大于等于5分占比(H5)-->
+    <select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
+        SELECT
+        t1.beh_dept_id AS deptId,
+        t1.beh_dept_name AS deptName,
+        sum( t2.totleScore - t1.score_res >= 5 ) AS num,
+        count(*) AS totleNum,
+        Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*), 4 ) AS percent,
+        CONCAT( Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*) * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        a.*,
+        b.score_res
+        FROM
+        med_behospital_info a,
+        med_qcresult_info 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="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>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        ) t1,
+        (
+        SELECT
+        `value`,
+        hospital_id,
+        CASE
+        `value`
+        WHEN 0 THEN
+        120
+        WHEN 1 THEN
+        100
+        END AS totleScore
+        FROM
+        `sys_hospital_set`
+        WHERE
+        CODE = 'score_type'
+        <if test="hospitalId != null and hospitalId != ''">
+            AND hospital_id = #{hospitalId}
+        </if>
+        ) t2
+        GROUP BY
+        t1.beh_dept_id,
+        t1.beh_dept_name
+        ORDER BY
+        percent DESC
+    </select>
 
 </mapper>