Переглянути джерело

病案首页改善率查询、导出

chengyao 4 роки тому
батько
коміт
d06a3a7c93

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

@@ -196,6 +196,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/print/export/qcCheckStaExportByDept").permitAll()
                 .antMatchers("/consoleByDept/qcCheckMRPageByDept").permitAll()
                 .antMatchers("/print/export/qcCheckMRPageExportByDept").permitAll()
+                .antMatchers("/consoleByDept/hmImproveMRPageByDept").permitAll()
+                .antMatchers("/print/export/improveMRExportByDept").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -240,6 +240,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/print/export/qcCheckStaExportByDept", request)
                 || matchers("/consoleByDept/qcCheckMRPageByDept", request)
                 || matchers("/print/export/qcCheckMRPageExportByDept", request)
+                || matchers("/consoleByDept/hmImproveMRPageByDept", request)
+                || matchers("/print/export/improveMRExportByDept", request)
                 || matchers("/", request)) {
             return true;
         }

+ 1 - 1
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1878,7 +1878,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
         //入参验证
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
         //入院时间
         if (null != exportQcresultVO && null != exportQcresultVO.getBehosDateStart() && null != exportQcresultVO.getBehosDateEnd()) {
             Date startDate = exportQcresultVO.getBehosDateStart();

+ 33 - 1
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -288,6 +288,38 @@ public class ConsoleByDeptExportFacade {
     }
 
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void improveMRExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.improveMRExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = "病案首页改善率质控评分详情.xls";
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
 
 
     public void solveParam(QcResultShortPageVO qcResultShortPageVO){
@@ -297,7 +329,7 @@ public class ConsoleByDeptExportFacade {
        Date endDate = qcResultShortPageVO.getEndDate();
        //时间间隔7天
        long interval_7 = 7 * 24 * 60 * 60 * 1000;
-       long interval_90 = 90 * 24 * 60 * 60 * 1000;
+       long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
        if("1".equals(qcResultShortPageVO.getRadioCheck())){
            //时间间隔7天

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

@@ -763,5 +763,16 @@ public class ConsoleByDeptFacade {
         filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
         return behospitalInfoFacade.qcCheckMRPageByDept(qcResultShortPageVO);
     }
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        return behospitalInfoFacade.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
 
 }

+ 4 - 4
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -263,7 +263,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -387,7 +387,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -506,7 +506,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -561,7 +561,7 @@ public class ConsoleExportFacade {
 
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天

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

@@ -499,6 +499,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -531,6 +540,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 质控核查质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 质控核查质控评分页-科室 导出
      *

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

@@ -462,6 +462,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 病案首页改善率质控评分页导出
@@ -471,6 +478,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> hmImproveMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 质控核查质控评分页(内页)
      *

+ 21 - 1
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -744,6 +744,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -755,6 +766,16 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPageExport(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.improveMRExportByDept(qcResultShortPageVO);
+    }
     /**
      * 质控核查质控评分页(内页)
      *
@@ -788,7 +809,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.qcCheckMRPageExport(qcResultShortPageVO);
     }
 
-
     /**
      * 质控核查质控评分页-科室 导出
      *

+ 35 - 4
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -242,7 +242,7 @@ public class ConsoleByDeptController {
                     "casesEntryName: 条目名称 <br>" +
                     "titleName: 标题名称 <br>" +
                     "casesEntryId: 条目id <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -267,7 +267,7 @@ public class ConsoleByDeptController {
                     "patName: 病人姓名 <br>" +
                     "casesEntryName: 条目名称 <br>" +
                     "casesEntryId: 条目id <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorName:主治医生名称 <br>" +
                     "level: 病历等级 <br>" +
                     "diagnose: 主诊断 <br>" +
@@ -310,7 +310,7 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "出院人数统计-科室[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -360,7 +360,7 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "质控核查质控评分页-科室(内页)[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -380,5 +380,36 @@ public class ConsoleByDeptController {
     public RespDTO<IPage<QcResultShortDTO>> qcCheckMRPageByDept(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         return RespDTO.onSuc(consoleByDeptFacade.qcCheckMRPageByDept(qcResultShortPageVO));
     }
+
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页改善率质控评分页(内页)[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "deptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "improveType: 改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历) <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("/hmImproveMRPageByDept")
+    @SysLogger("hmImproveMRPageByDept")
+    public RespDTO<IPage<QcResultShortDTO>> hmImproveMRPageByDept(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        return RespDTO.onSuc(consoleByDeptFacade.hmImproveMRPageByDept(qcResultShortPageVO));
+    }
     //endregion -----------------------内页接口结束------------------------------
 }

+ 31 - 0
src/main/java/com/diagbot/web/ConsoleByDeptExportController.java

@@ -281,6 +281,37 @@ public class ConsoleByDeptExportController {
         consoleByDeptExportFacade.qcCheckMRPageExportByDept(response, qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页改善率质控评分页导出[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "deptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "improveType: 改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历) <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("/improveMRExportByDept")
+    @SysLogger("improveMRExportByDept")
+    public void improveMRExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleByDeptExportFacade.improveMRExportByDept(response, qcResultShortPageVO);
+    }
+
 /**
      * 病历稽查统计(首页)
      * @param filterVO

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

@@ -12813,6 +12813,256 @@
         </if>
     </select>
 
+    <!-- 病案首页改善率质控评分页(内页)-科室-->
+    <select id="hmImproveMRPageByDept" 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,
+        CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as 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,
+        c.LEVEL,
+        c.grade_type,
+        c.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,
+        c.gmt_create
+        FROM
+        med_behospital_info a,
+        med_home_page b,
+        med_qcresult_info c,
+        med_qcresult_cases d,
+        sys_user_dept f,
+        (
+        SELECT
+        m4.*
+        FROM
+        med_behospital_info m1,
+        med_home_page m2,
+        med_qcresult_info m3,
+        med_qcresult_cases m4
+        WHERE
+        m1.is_deleted = 'N'
+        AND m2.is_deleted = 'N'
+        AND m3.is_deleted = 'Y'
+        AND m4.is_deleted = 'Y'
+        AND m1.hospital_id = m2.hospital_id
+        AND m1.hospital_id = m3.hospital_id
+        AND m1.hospital_id = m4.hospital_id
+        AND m1.behospital_code = m2.behospital_code
+        AND m1.behospital_code = m3.behospital_code
+        AND m1.behospital_code = m4.behospital_code
+        AND m3.gmt_create = m4.gmt_create
+        AND m3.have_home_page = 1
+        AND m4.cases_id = 243
+        AND m1.qc_type_id != 0
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and m1.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND m1.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND m1.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+            <if test="qcResultShortPageVO.startDate != null">
+                <![CDATA[ AND m1.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND m1.beh_dept_name like CONCAT('%', #{qcResultShortPageVO.deptName}, '%')
+        </if>
+        GROUP BY
+        m1.behospital_code
+        ORDER BY
+        m1.behospital_code,
+        m4.gmt_create
+        ) e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = d.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND a.behospital_code = d.behospital_code
+        AND a.beh_dept_id = f.dept_id
+        AND a.behospital_code = e.behospital_code
+        AND d.cases_id = 243
+        AND d.score_res > e.score_res
+        AND a.qc_type_id != 0
+        <if test="qcResultShortPageVO.userId!=null">
+            AND f.user_id = #{qcResultShortPageVO.userId}
+        </if>
+        <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.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND c.`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.improveType != null and qcResultShortPageVO.improveType == 2">
+            <![CDATA[AND ( e.`level` = '不合格' AND d.`level` = '合格' AND d.score_res < 20 )]]>
+        </if>
+        <if test="qcResultShortPageVO.improveType != null and qcResultShortPageVO.improveType == 3">
+            AND d.score_res = 20
+        </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="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>
+    </select>
+
+
     <!-- 质控核查质控评分页(内页)-->
     <select id="qcCheckMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
         SELECT
@@ -13721,6 +13971,565 @@
         AND f1.behDeptName = f2.behDeptName
     </select>
 
+    <!-- 病案首页改善率质控评分页导出-->
+    <select id="improveMRExportByDept" resultMap="ExportExcelMapByDept">
+        SELECT
+        f1.behDeptId,
+        f1.behDeptName,
+        f1.doctorId,
+        f1.doctorName,
+        f1.patName,
+        f1.behospitalCode,
+        f1.hospitalId,
+        f1.behospitalDate,
+        f1.leaveHospitalDate,
+        f1.score,
+        f2.avgScore,
+        <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
+            f1.msg,
+            f1.caseName,
+        </if>
+        f1.checkStatus,
+        f1.mrStatus,
+        f1.chName,
+        f1.mrName,
+        f1.chTime,
+        f1.mrTime
+        FROM
+        (SELECT
+        t.doctorId,
+        t.doctorName,
+        t.`name` AS patName,
+        t.behospitalCode AS behospitalCode,
+        t.behospitalDate AS behospitalDate,
+        t.leaveHospitalDate AS leaveHospitalDate,
+        qi.score_res AS score,
+        <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
+            qd.msg AS msg,
+            qc.NAME AS caseName,
+        </if>
+        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,
+        c.LEVEL,
+        c.grade_type,
+        c.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,
+        c.gmt_create
+        FROM
+        med_behospital_info a,
+        med_home_page b,
+        med_qcresult_info c,
+        med_qcresult_cases d,
+        sys_user_dept f,
+        (
+        SELECT
+        m4.*
+        FROM
+        med_behospital_info m1,
+        med_home_page m2,
+        med_qcresult_info m3,
+        med_qcresult_cases m4
+        WHERE
+        m1.is_deleted = 'N'
+        AND m2.is_deleted = 'N'
+        AND m3.is_deleted = 'Y'
+        AND m4.is_deleted = 'Y'
+        AND m1.hospital_id = m2.hospital_id
+        AND m1.hospital_id = m3.hospital_id
+        AND m1.hospital_id = m4.hospital_id
+        AND m1.behospital_code = m2.behospital_code
+        AND m1.behospital_code = m3.behospital_code
+        AND m1.behospital_code = m4.behospital_code
+        AND m3.gmt_create = m4.gmt_create
+        AND m3.have_home_page = 1
+        AND m4.cases_id = 243
+        AND m1.qc_type_id != 0
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and m1.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND m1.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND m1.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+            <if test="qcResultShortPageVO.startDate != null">
+                <![CDATA[ AND m1.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND m1.beh_dept_name like CONCAT('%', #{qcResultShortPageVO.deptName}, '%')
+        </if>
+        GROUP BY
+        m1.behospital_code
+        ORDER BY
+        m1.behospital_code,
+        m4.gmt_create
+        ) e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = d.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND a.behospital_code = d.behospital_code
+        AND a.behospital_code = e.behospital_code
+        AND a.beh_dept_id = f.dept_id
+        AND d.cases_id = 243
+        AND d.score_res > e.score_res
+        AND a.qc_type_id != 0
+        <if test="qcResultShortPageVO.userId!=null">
+            AND f.user_id = #{qcResultShortPageVO.userId}
+        </if>
+        <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.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND c.`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.improveType != null and qcResultShortPageVO.improveType == 2">
+            <![CDATA[AND ( e.`level` = '不合格' AND d.`level` = '合格' AND d.score_res < 20 )]]>
+        </if>
+        <if test="qcResultShortPageVO.improveType != null and qcResultShortPageVO.improveType == 3">
+            AND d.score_res = 20
+        </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
+        <if test="qcResultShortPageVO.radioCheck !=null and qcResultShortPageVO.radioCheck == 1">
+            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
+        </if>
+        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>
+        )f1,
+        (SELECT
+        ROUND( AVG( qi.score_res ), 2 ) AS avgScore,
+        t.behDeptId,
+        t.behDeptName,
+        t.doctorId,
+        t.doctorName
+        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,
+        c.LEVEL,
+        c.grade_type,
+        c.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,
+        c.gmt_create
+        FROM
+        med_behospital_info a,
+        med_home_page b,
+        med_qcresult_info c,
+        med_qcresult_cases d,
+        sys_user_dept f,
+        (
+        SELECT
+        m4.*
+        FROM
+        med_behospital_info m1,
+        med_home_page m2,
+        med_qcresult_info m3,
+        med_qcresult_cases m4
+        WHERE
+        m1.is_deleted = 'N'
+        AND m2.is_deleted = 'N'
+        AND m3.is_deleted = 'Y'
+        AND m4.is_deleted = 'Y'
+        AND m1.hospital_id = m2.hospital_id
+        AND m1.hospital_id = m3.hospital_id
+        AND m1.hospital_id = m4.hospital_id
+        AND m1.behospital_code = m2.behospital_code
+        AND m1.behospital_code = m3.behospital_code
+        AND m1.behospital_code = m4.behospital_code
+        AND m3.gmt_create = m4.gmt_create
+        AND m3.have_home_page = 1
+        AND m4.cases_id = 243
+        AND m1.qc_type_id != 0
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and m1.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND m1.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+            <if test="qcResultShortPageVO.startDate != null ">
+                <![CDATA[ AND m1.behospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.behospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+            <if test="qcResultShortPageVO.startDate != null">
+                <![CDATA[ AND m1.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+            </if>
+            <if test="qcResultShortPageVO.endDate != null ">
+                <![CDATA[ AND m1.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND m1.beh_dept_name like CONCAT('%', #{qcResultShortPageVO.deptName}, '%')
+        </if>
+        GROUP BY
+        m1.behospital_code
+        ORDER BY
+        m1.behospital_code,
+        m4.gmt_create
+        ) e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = d.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND a.behospital_code = d.behospital_code
+        AND a.behospital_code = e.behospital_code
+        AND a.beh_dept_id = f.dept_id
+        AND d.cases_id = 243
+        AND d.score_res > e.score_res
+        AND a.qc_type_id != 0
+        <if test="qcResultShortPageVO.userId!=null">
+            AND f.user_id = #{qcResultShortPageVO.userId}
+        </if>
+        <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.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND c.`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.improveType != null and qcResultShortPageVO.improveType == 2">
+            <![CDATA[AND ( e.`level` = '不合格' AND d.`level` = '合格' AND d.score_res < 20 )]]>
+        </if>
+        <if test="qcResultShortPageVO.improveType != null and qcResultShortPageVO.improveType == 3">
+            AND d.score_res = 20
+        </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.doctorId,
+        t.doctorName
+        )f2
+        WHERE
+        f1.doctorId = f2.doctorId
+        AND f1.doctorName = f2.doctorName
+    </select>
+
     <!-- 质控核查质控评分页导出-->
     <select id="qcCheckMRPageExport" resultMap="ExportExcelMap">
         SELECT