浏览代码

H5数据统计

zhaops 3 年之前
父节点
当前提交
f03bebfa7c

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

@@ -294,6 +294,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/mode/getModes").permitAll()
                 .antMatchers("/consoleByDoctor/**").permitAll()
                 .antMatchers("/qc/getDoctorDetail/**").permitAll()
+                .antMatchers("/h5/statistics/**").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -371,6 +371,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/mode/getModes", request)
                 || matchers("/consoleByDoctor/**", request)
                 || matchers("/qc/getDoctorDetail/**", 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;
+}

+ 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;
+}

+ 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;
+    }
+}

+ 11 - 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);
+
     /**
      * 获取缺陷数量对应的病历
      *
@@ -834,4 +835,12 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     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);
+    }
+}

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: mrqc-sys
   profiles:
-    active: pre
+    active: local
   main:
     allow-bean-definition-overriding: true
 

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

@@ -21359,4 +21359,123 @@
         )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>