Bladeren bron

Merge remote-tracking branch 'origin/dev/20201009_1.4.6' into debug

chengyao 4 jaren geleden
bovenliggende
commit
50d428991e

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

@@ -162,9 +162,12 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/medLisInfo/getExaminePage").permitAll()
                 .antMatchers("/qc/medLisInfo/getExamineSonPage").permitAll()
                 .antMatchers("/console/medicalCheckForm").permitAll()
+                .antMatchers("/qc/behospitalInfo/analyzeCds").permitAll()
                 .antMatchers("/console/medicalCheckTitle").permitAll()
                 .antMatchers("/console/export/medicalCheckExport").permitAll()
                 .antMatchers("/console/export/medicalCheckInnerExport").permitAll()
+                .antMatchers("/console/badLevelPage").permitAll()
+                .antMatchers("/console/export/badLevelPagePageExport").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -204,11 +204,14 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/doctoradvice/getPage", request)
                 || matchers("/qc/medPacsInfo/getCheckPage", request)
                 || matchers("/qc/medLisInfo/getExaminePage", request)
+                || matchers("/qc/behospitalInfo/analyzeCds", request)
                 || matchers("/qc/medLisInfo/getExamineSonPage", request)
                 || matchers("/console/medicalCheckForm", request)
                 || matchers("/console/medicalCheckTitle", request)
                 || matchers("/console/export/medicalCheckExport", request)
                 || matchers("/console/export/medicalCheckInnerExport", request)
+                || matchers("/console/badLevelPage", request)
+                || matchers("/console/export/badLevelPagePageExport", request)
                 || matchers("/", request)) {
             return true;
         }

+ 5 - 0
src/main/java/com/diagbot/dto/BehospitalInfoDTO.java

@@ -97,6 +97,11 @@ public class BehospitalInfoDTO implements Serializable {
      */
     private String scoreRes;
 
+    /**
+     * 病案首页得分
+     */
+    private String scoreBn;
+
     /**
      * 评分类型(1:机器,2:人工)
      */

+ 2 - 0
src/main/java/com/diagbot/dto/ExportExcelBehospitalDTO.java

@@ -28,6 +28,8 @@ public class ExportExcelBehospitalDTO {
     private Date leaveHospitalDate;
     @Excel(name = "分数", needMerge = true)
     private String score;
+    @Excel(name = "病案首页分数", needMerge = true)
+    private String scoreBn;
     @ExcelCollection(name = "")
     private List<ExportExcelCaseDTO> exportExcelCaseDTOS;
 

+ 12 - 11
src/main/java/com/diagbot/dto/HomePageNumDTO.java

@@ -34,10 +34,15 @@ public class HomePageNumDTO {
      */
     @Excel(name = "缺陷总数", orderNum = "2")
     private Integer entryNum = 0;
+    /**
+     * 病案首页不合格病历数
+     */
+    @Excel(name = "不合格数", orderNum = "3")
+    private Integer secondLevelNum = 0;
     /**
      * 质控病历数
      */
-    @Excel(name = "质控病历数", orderNum = "9")
+    @Excel(name = "质控病历数", orderNum = "10")
     private Integer mrNum = 0;
     /**
      * 质控评分(总分)
@@ -46,16 +51,12 @@ public class HomePageNumDTO {
     /**
      * 质控评分(平均分)
      */
-    @Excel(name = "质控平均分", orderNum = "8")
+    @Excel(name = "质控平均分", orderNum = "9")
     private Double averageValue = 0d;
     /**
      * 病案首页合格病历数
      */
     private Integer firstLevelNum = 0;
-    /**
-     * 病案首页不合格病历数
-     */
-    private Integer secondLevelNum = 0;
     /**
      * 病案首页合格病历占比
      */
@@ -67,7 +68,7 @@ public class HomePageNumDTO {
     /**
      * 病案首页合格病历占比(百分比)
      */
-    @Excel(name = "合格率", orderNum = "3")
+    @Excel(name = "合格率", orderNum = "4")
     private String firstLevelPercentStr = "0.00%";
     /**
      * 病案首页不合格病历占比(百分比)
@@ -84,12 +85,12 @@ public class HomePageNumDTO {
     /**
      * 空项数
      */
-    @Excel(name = "空项数", orderNum = "4")
+    @Excel(name = "空项数", orderNum = "5")
     private Integer emptyNum = 0;
     /**
      * 错误数
      */
-    @Excel(name = "错误数", orderNum = "6")
+    @Excel(name = "错误数", orderNum = "7")
     private Integer errorNum = 0;
     /**
      * 完整率、完善率分母(质控病历数*病案首页条目数)
@@ -106,11 +107,11 @@ public class HomePageNumDTO {
     /**
      * 完整率(百分比)
      */
-    @Excel(name = "完整率", orderNum = "5")
+    @Excel(name = "完整率", orderNum = "6")
     private String emptyPercentStr = "0.00%";
     /**
      * 完善率(百分比)
      */
-    @Excel(name = "完善率", orderNum = "7")
+    @Excel(name = "完善率", orderNum = "8")
     private String errorPercentStr = "0.00%";
 }

+ 32 - 0
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -321,6 +321,38 @@ public class ConsoleExportFacade {
         ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
     }
 
+    /**
+     * 病案首页不合格数
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void badLevelPagePageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        qcResultShortPageVO.setHospitalId(hospitalId);
+        if (StringUtil.isNotBlank(qcResultShortPageVO.getBehDeptName())
+                && qcResultShortPageVO.getBehDeptName().equals("全部")) {
+            qcResultShortPageVO.setBehDeptName("");
+        }
+        Date startDate = qcResultShortPageVO.getStartDate();
+        Date endDate = qcResultShortPageVO.getEndDate();
+        //时间间隔7天
+        long interval = 90l * 24l * 60l * 60l * 1000l;
+        if (endDate.getTime() < startDate.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        if (endDate.getTime() - startDate.getTime() > interval) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
+        }
+
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelDTO> records = behospitalInfoFacade.badLevelPagePageExport(qcResultShortPageVO);
+        String fileName = "病案首页不合格数病历详情页.xls";
+        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
+    }
+
     /**
      * 未整改病历统计导出
      *

+ 11 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -1174,6 +1174,17 @@ public class ConsoleFacade {
         return behospitalInfoFacade.unModifyMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 不合格数病历号(内页)
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> badLevelPage(QcResultPageVO qcResultPageVO) {
+        filterFacade.badLevelPageVOSet(qcResultPageVO);
+        return behospitalInfoFacade.badLevelPage(qcResultPageVO);
+    }
+
     /**
      * 31天再入院详情页
      *

+ 18 - 0
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -5,6 +5,7 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -245,6 +246,23 @@ public class FilterFacade {
         qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));*/
     }
 
+    /**
+     * 不合格数病历号入参拼接
+     *
+     * @param qcResultPageVO
+     */
+    public void badLevelPageVOSet(QcResultPageVO qcResultPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        qcResultPageVO.setHospitalId(hospitalId);
+        qcResultPageVO.setUserId(Long.valueOf(userId));
+        if (qcResultPageVO.getBehDeptName().equals("全院")|| StringUtils.isEmpty(qcResultPageVO.getBehDeptName())) {
+            qcResultPageVO.setBehDeptName("");
+        }
+        /*long interval = qcResultShortPageVO.getEndDate().getTime() + 1000;
+        qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));*/
+    }
+
     /**
      * 关键条目缺陷占比入参拼接
      *

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

@@ -351,6 +351,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 不合格数病历号(内页)
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> badLevelPage(@Param("qcResultPageVO") QcResultPageVO qcResultPageVO);
+
+
     /**
      * 未整改病历缺陷评分详情页导出
      *
@@ -360,6 +369,17 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+
+    /**
+     * 病案首页不合格数病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+
+    public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 31天再入院详情页
      *

+ 15 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -330,6 +330,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 不合格数病历号(内页)
+     * @param qcResultPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> badLevelPage(@Param("qcResultPageVO") QcResultPageVO qcResultPageVO);
+
     /**
      * 未整改病历缺陷评分详情页导出
      *
@@ -338,6 +345,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页不合格数病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 31天再入院详情页
      *

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

@@ -584,6 +584,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 不合格数病历号(内页)
+     *
+     * @param qcResultPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> badLevelPage(@Param("qcResultPageVO") QcResultPageVO qcResultPageVO) {
+        return baseMapper.badLevelPage(qcResultPageVO);
+    }
+
     /**
      * 未整改病历缺陷评分详情页导出
      *
@@ -595,6 +606,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.unModifyMRPageExport((qcResultShortPageVO));
     }
 
+    /**
+     * 病案首页不合格数病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.badLevelPagePageExport((qcResultShortPageVO));
+    }
+
     /**
      * 31天再入院详情页
      *

+ 132 - 0
src/main/java/com/diagbot/vo/QcResultPageVO.java

@@ -0,0 +1,132 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/6/16 17:00
+ */
+@Getter
+@Setter
+public class QcResultPageVO extends Page {
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+    @ApiModelProperty(hidden = true)
+    private String hospitalId;
+    /**
+     * 病历号
+     */
+    private String behospitalCode;
+    /**
+     * 病人姓名
+     */
+    private String patName;
+    /**
+     * 条目名称
+     */
+    private String casesEntryName;
+    /**
+     * 条目id
+     */
+    private Long casesEntryId;
+    /**
+     * 模块名称
+     */
+    private String casesName;
+    /**
+     * 模块id
+     */
+    private Long casesId;
+    /**
+     * 科室名称
+     */
+    private String behDeptName;
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+    /**
+     * 医生编号
+     */
+    private String doctorId;
+    /**
+     * 病历等级
+     */
+    private String level;
+    @NotNull(message = "请输入起始时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    private String startDate;
+    @DateTimeFormat(pattern = "yyyy-MM-dd  HH:mm:ss")
+    @NotNull(message = "请输入截止时间")
+    private String endDate;
+
+    /**
+     * 单项否决
+     */
+    private Integer isReject;
+
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
+    private Integer ruleType;
+
+    /**
+     * 离院人员类型(0/null:总人数,1:死亡人数,2:新生儿,3:手术病人数,4:非医嘱离院病人,5:31日再入院病人)
+     */
+    private Integer leaveHosType;
+
+    /**
+     * 核查状态(1:已核查,0:未核查)
+     */
+    private Integer checkStatus;
+    /**
+     * 首页核查状态(1:已核查,0:未核查)
+     */
+    private Integer mrStatus;
+    /**
+     * 病历核查人员
+     */
+    private String chName;
+    /**
+     * 首页核查人员
+     */
+    private String mrName;
+    /**
+     * 病历核查起始时间
+     */
+    private Date chTimeStart;
+    /**
+     * 病历核查截止时间
+     */
+    private Date chTimeEnd;
+    /**
+     * 首页核查起始时间
+     */
+    private Date mrTimeStart;
+    /**
+     * 首页核查截止时间
+     */
+    private Date mrTimeEnd;
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+
+    /**
+     * 住院超过31日标志
+     */
+    private Integer beHosGT31Days;
+
+    /**
+     * 改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历)
+     */
+    private Integer improveType;
+}

+ 32 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -442,6 +442,38 @@ public class ConsoleController {
         return RespDTO.onSuc(consoleFacade.homePageLevelStatistics(filterOrderVO));
     }
 
+    /**
+     * 病案首页不合格数病历详情(内页)
+     * @param qcResultPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页不合格数病历详情(内页)[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "casesEntryName: 条目名称 <br>" +
+                    "casesEntryId: 条目id <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/badLevelPage")
+    @SysLogger("badLevelPage")
+    public RespDTO<IPage<QcResultShortDTO>> badLevelPage(@RequestBody @Valid QcResultPageVO qcResultPageVO) {
+        return RespDTO.onSuc(consoleFacade.badLevelPage(qcResultPageVO));
+    }
+
+
     /**
      * 病案首页合格率占比(首页)
      *

+ 30 - 0
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -335,6 +335,36 @@ public class ConsoleExportController {
         consoleExportFacade.unModifyMRPageExport(response, qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页不合格数病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页不合格数病历详情页导出[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/badLevelPagePageExport")
+    @SysLogger("badLevelPagePageExport")
+    public void badLevelPagePageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleExportFacade.badLevelPagePageExport(response, qcResultShortPageVO);
+    }
+
 
     /**
      * 稽查病历详情页导出

+ 628 - 1
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -52,11 +52,15 @@
         h.check_time AS mr_time
         from (
         select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
-        grade_time, c.age from med_behospital_info a
+        grade_time, c.age, e.score_res as score_bn from med_behospital_info a
         LEFT JOIN med_qcresult_info b
         on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
         left join med_home_page c
         on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
+        LEFT JOIN med_qcresult_cases e
+        on  a.behospital_code = e.behospital_code
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
         ) t
         LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
         ON t.behospital_code = g.behospital_code
@@ -6741,6 +6745,189 @@
         d.NAME
     </select>
 
+    <!-- 不合格数病历号(内页)-->
+    <select id="badLevelPage" resultType="com.diagbot.dto.QcResultShortDTO">
+        SELECT t.*
+        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
+        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_cases e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = e.behospital_code
+        AND a.qc_type_id != 0
+        AND e.`level`='不合格'
+        <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultPageVO.isPlacefile}
+        </if>
+        <if test="qcResultPageVO.hospitalId != null and qcResultPageVO.hospitalId != ''">
+            AND a.hospital_id = #{qcResultPageVO.hospitalId}
+        </if>
+        <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile == 0">
+            <if test="qcResultPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{qcResultPageVO.startDate}]]>
+            </if>
+            <if test="qcResultPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{qcResultPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile == 1">
+            <if test="qcResultPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{qcResultPageVO.startDate}]]>
+            </if>
+            <if test="qcResultPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{qcResultPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultPageVO.behDeptName != null and qcResultPageVO.behDeptName != ''">
+            AND a.beh_dept_name = #{qcResultPageVO.behDeptName}
+        </if>
+        <if test="qcResultPageVO.level != null and qcResultPageVO.level != ''">
+        <if test="qcResultPageVO.behospitalCode != null and qcResultPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{qcResultPageVO.behospitalCode}, '%' )
+        </if>
+        </if>
+        <if test="qcResultPageVO.patName != null and qcResultPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{qcResultPageVO.patName}, '%' )
+        </if>
+        <if test="qcResultPageVO.casesEntryName != null and qcResultPageVO.casesEntryName != ''">
+            AND d.NAME = #{qcResultPageVO.casesEntryName}
+        </if>
+        <if test="qcResultPageVO.doctorId != null and qcResultPageVO.doctorId != ''">
+            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' )
+            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' )
+            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' ))
+        </if>
+        <if test="qcResultPageVO.doctorName != null and qcResultPageVO.doctorName != ''">
+            AND (a.doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' ))
+        </if>
+        <if test="qcResultPageVO.casesEntryId != null ">
+            AND d.id = #{qcResultPageVO.casesEntryId}
+        </if>
+        <if test="qcResultPageVO.isReject != null">
+            AND c.is_reject = #{qcResultPageVO.isReject}
+        </if>
+        <if test="qcResultPageVO.ruleType != null">
+            AND d.rule_type = #{qcResultPageVO.ruleType}
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type = 0
+        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
+        ) t1
+        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'
+        ) t
+        where 1=1
+        <if test="qcResultPageVO.checkStatus != null">
+            AND t.checkStatus = #{qcResultPageVO.checkStatus}
+        </if>
+        <if test="qcResultPageVO.mrStatus != null">
+            AND t.mrStatus = #{qcResultPageVO.mrStatus}
+        </if>
+        <if test="qcResultPageVO.chName != null and qcResultPageVO.chName!=''">
+            AND t.chName like concat('%', #{qcResultPageVO.chName}, '%')
+        </if>
+        <if test="qcResultPageVO.mrName != null and qcResultPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{qcResultPageVO.mrName}, '%')
+        </if>
+        <if test="qcResultPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{qcResultPageVO.chTimeStart}]]>
+        </if>
+        <if test="qcResultPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{qcResultPageVO.chTimeEnd}]]>
+        </if>
+        <if test="qcResultPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{qcResultPageVO.mrTimeStart}]]>
+        </if>
+        <if test="qcResultPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{qcResultPageVO.mrTimeEnd}]]>
+        </if>
+    </select>
     <!-- 未整改病历质控评分页(内页)-->
     <select id="unModifyMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
         SELECT t.*
@@ -6929,6 +7116,446 @@
         </if>
     </select>
 
+    <!-- 病案首页不合格数病历详情页导出-->
+    <select id="badLevelPagePageExport" resultMap="ExportExcelMap">
+        SELECT
+        f1.behDeptId,
+        f1.behDeptName,
+        f1.behDoctorName,
+        f1.patName,
+        f1.behospitalCode,
+        f1.hospitalId,
+        f1.behospitalDate,
+        f1.leaveHospitalDate,
+        f1.score,
+        f2.avgScore,
+        f1.msg,
+        f1.caseName,
+        f1.checkStatus,
+        f1.mrStatus,
+        f1.chName,
+        f1.mrName,
+        f1.chTime,
+        f1.mrTime
+        FROM
+        (SELECT
+        t.doctorName AS behDoctorName,
+        t.`name` AS patName,
+        t.behospitalCode AS behospitalCode,
+        t.behospitalDate AS behospitalDate,
+        t.leaveHospitalDate AS leaveHospitalDate,
+        qi.score_res AS score,
+        qd.msg AS msg,
+        qc.NAME AS caseName,
+        t.behDeptId,
+        t.behDeptName,
+        t.hospitalId,
+        t.checkStatus,
+        t.mrStatus,
+        t.chName,
+        t.mrName,
+        t.chTime,
+        t.mrTime
+        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
+        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_cases 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 a.qc_type_id != 0
+        AND c.`level`='不合格'
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultShortPageVO.level}
+        </if>
+        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
+            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+        </if>
+        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
+            AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
+        </if>
+        <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
+            AND d.NAME = #{qcResultShortPageVO.casesEntryName}
+        </if>
+        <if test="qcResultShortPageVO.casesEntryId != null ">
+            AND d.id = #{qcResultShortPageVO.casesEntryId}
+        </if>
+<!--        <if test="qcResultShortPageVO.isReject != null">-->
+<!--            AND c.is_reject = #{qcResultShortPageVO.isReject}-->
+<!--        </if>-->
+        <if test="qcResultShortPageVO.ruleType != null">
+            AND d.rule_type = #{qcResultShortPageVO.ruleType}
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type = 0
+        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
+        ) t1
+        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'
+        ) 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="qcResultShortPageVO.checkStatus != null">
+            AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
+        </if>
+        <if test="qcResultShortPageVO.mrStatus != null">
+            AND t.mrStatus = #{qcResultShortPageVO.mrStatus}
+        </if>
+        <if test="qcResultShortPageVO.chName != null and qcResultShortPageVO.chName!=''">
+            AND t.chName like concat('%', #{qcResultShortPageVO.chName}, '%')
+        </if>
+        <if test="qcResultShortPageVO.mrName != null and qcResultShortPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{qcResultShortPageVO.mrName}, '%')
+        </if>
+        <if test="qcResultShortPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{qcResultShortPageVO.chTimeStart}]]>
+        </if>
+        <if test="qcResultShortPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{qcResultShortPageVO.chTimeEnd}]]>
+        </if>
+        <if test="qcResultShortPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{qcResultShortPageVO.mrTimeStart}]]>
+        </if>
+        <if test="qcResultShortPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{qcResultShortPageVO.mrTimeEnd}]]>
+        </if>
+        <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
+            AND qce.NAME = #{qcResultShortPageVO.casesEntryName}
+        </if>
+        <if test="qcResultShortPageVO.casesEntryId != null ">
+            AND qce.id = #{qcResultShortPageVO.casesEntryId}
+        </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
+        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_cases 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.`level`='不合格'
+        AND a.qc_type_id != 0
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultShortPageVO.level}
+        </if>
+        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
+            AND d.NAME = #{qcResultShortPageVO.casesEntryName}
+        </if>
+        <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
+            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
+            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+        </if>
+        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
+            AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
+        </if>
+        <if test="qcResultShortPageVO.casesEntryId != null ">
+            AND d.id = #{qcResultShortPageVO.casesEntryId}
+        </if>
+<!--        <if test="qcResultShortPageVO.isReject != null">-->
+<!--            AND c.is_reject = #{qcResultShortPageVO.isReject}-->
+<!--        </if>-->
+        <if test="qcResultShortPageVO.ruleType != null">
+            AND d.rule_type = #{qcResultShortPageVO.ruleType}
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type = 0
+        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
+        ) t1
+        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'
+        ) 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="qcResultShortPageVO.checkStatus != null">
+            AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
+        </if>
+        <if test="qcResultShortPageVO.mrStatus != null">
+            AND t.mrStatus = #{qcResultShortPageVO.mrStatus}
+        </if>
+        <if test="qcResultShortPageVO.chName != null and qcResultShortPageVO.chName!=''">
+            AND t.chName like concat('%', #{qcResultShortPageVO.chName}, '%')
+        </if>
+        <if test="qcResultShortPageVO.mrName != null and qcResultShortPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{qcResultShortPageVO.mrName}, '%')
+        </if>
+        <if test="qcResultShortPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{qcResultShortPageVO.chTimeStart}]]>
+        </if>
+        <if test="qcResultShortPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{qcResultShortPageVO.chTimeEnd}]]>
+        </if>
+        <if test="qcResultShortPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{qcResultShortPageVO.mrTimeStart}]]>
+        </if>
+        <if test="qcResultShortPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{qcResultShortPageVO.mrTimeEnd}]]>
+        </if>
+        GROUP BY
+        t.behDeptId,
+        t.behDeptName
+        )f2
+        WHERE
+        f1.behDeptId = f2.behDeptId
+        AND f1.behDeptName = f2.behDeptName
+    </select>
+
     <!-- 未整改病历缺陷评分详情页导出-->
     <select id="unModifyMRPageExport" resultMap="ExportExcelMap">
         SELECT