Browse Source

合格、不合格数病例详情导出

chengyao 4 years ago
parent
commit
e751d72cd2

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

@@ -182,6 +182,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/bas/doctor/getList").permitAll()
                 .antMatchers("/consoleByDept/homePageOrGoodLevelByDept").permitAll()
                 .antMatchers("/print/export/homePageLevelExportByDept").permitAll()
+                .antMatchers("/print/export/homePageOrLevelExportByDept").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -226,6 +226,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/bas/doctor/getList", request)
                 || matchers("/consoleByDept/homePageOrGoodLevelByDept", request)
                 || matchers("/print/export/homePageLevelExportByDept", request)
+                || matchers("/print/export/homePageOrLevelExportByDept", request)
                 || matchers("/", request)) {
             return true;
         }

+ 34 - 0
src/main/java/com/diagbot/dto/ExportExcelBehByDeptDTO.java

@@ -0,0 +1,34 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:35
+ */
+@Getter
+@Setter
+public class ExportExcelBehByDeptDTO {
+    @Excel(name = "患者姓名", needMerge = true)
+    private String patName;
+    @Excel(name = "住院号", needMerge = true)
+    private String behospitalCode;
+    @Excel(name = "入院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date behospitalDate;
+    @Excel(name = "出院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date leaveHospitalDate;
+    @Excel(name = "分数", needMerge = true)
+    private Double score;
+    @Excel(name = "病案首页分数", needMerge = true)
+    private Double scoreBn;
+    @ExcelCollection(name = "")
+    private List<ExportExcelCaseDTO> exportExcelCaseDTOS;
+
+}

+ 28 - 0
src/main/java/com/diagbot/dto/ExportExcelByDeptDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportExcelByDeptDTO {
+//    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @Excel(name = "主管医生", needMerge = true)
+    private String behDoctorName;
+    @Excel(name = "平均分数", needMerge = true)
+    private Double avgScore;
+    @ExcelCollection(name = "")
+    private List<ExportExcelBehByDeptDTO> excelBehospitalDTOS;
+
+
+}

+ 29 - 0
src/main/java/com/diagbot/dto/ExportExcelWideBehByDeptDTO.java

@@ -0,0 +1,29 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:35
+ */
+@Getter
+@Setter
+public class ExportExcelWideBehByDeptDTO {
+    @Excel(name = "患者姓名", needMerge = true)
+    private String patName;
+    @Excel(name = "住院号", needMerge = true)
+    private String behospitalCode;
+    @Excel(name = "入院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date behospitalDate;
+    @Excel(name = "出院时间", needMerge = true, exportFormat = "yyyy/MM/dd")
+    private Date leaveHospitalDate;
+    @Excel(name = "分数", needMerge = true)
+    private Double score;
+    @Excel(name = "病案首页分数", needMerge = true)
+    private Double scoreBn;
+}

+ 23 - 0
src/main/java/com/diagbot/dto/ExportNinetyByDeptDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportNinetyByDeptDTO {
+    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @ExcelCollection(name = "")
+    private List<ExportWideExcelByDeptDTO> exportExcelByDeptDTOS;
+
+}

+ 23 - 0
src/main/java/com/diagbot/dto/ExportSevenByDeptDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportSevenByDeptDTO {
+    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @ExcelCollection(name = "")
+    private List<ExportExcelByDeptDTO> exportExcelByDeptDTOS;
+
+}

+ 28 - 0
src/main/java/com/diagbot/dto/ExportWideExcelByDeptDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/2 19:00
+ */
+@Getter
+@Setter
+public class ExportWideExcelByDeptDTO {
+//    @Excel(name = "科室", needMerge = true)
+    private String behDeptName;
+    @Excel(name = "主管医生", needMerge = true)
+    private String behDoctorName;
+    @Excel(name = "平均分数", needMerge = true)
+    private Double avgScore;
+    @ExcelCollection(name = "" )
+    private List<ExportExcelWideBehByDeptDTO> excelBehospitalDTOS;
+
+
+}

+ 80 - 37
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -1,12 +1,16 @@
 package com.diagbot.facade;
 
 import com.diagbot.dto.*;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.util.*;
 import com.diagbot.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -361,43 +365,22 @@ public class ConsoleByDeptExportFacade {
      *
      * @param qcResultShortPageVO
      * @return
-     *//*
-    public void badLevelPagePageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        qcResultShortPageVO.setHospitalId(hospitalId);
-        if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
-                && qcResultShortPageVO.getDeptName().equals("全部")) {
-            qcResultShortPageVO.setDeptName("");
-        }
-        Date startDate = qcResultShortPageVO.getStartDate();
-        Date endDate = qcResultShortPageVO.getEndDate();
-        //时间间隔7天
-        long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90l * 24 * 60 * 60 * 1000;
-
-        if("1".equals(qcResultShortPageVO.getRadioCheck())){
-            //时间间隔7天
-            if (endDate.getTime() < startDate.getTime()) {
-                throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
-            }
-            if (endDate.getTime() - startDate.getTime() > interval_7) {
-                throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
-            }
-        }else{
-            //时间间隔90天
-            if (endDate.getTime() < startDate.getTime()) {
-                throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
-            }
-            if (endDate.getTime() - startDate.getTime() > interval_90) {
-                throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
-            }
-        }
-
+     */
+    public void homePageOrLevelExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
         qcResultShortPageVO.setCurrent(1L);
         qcResultShortPageVO.setSize(Long.MAX_VALUE);
         qcResultShortPageVO.setSearchCount(false);
-        List<ExportExcelDTO> records = behospitalInfoFacade.badLevelPagePageExport(qcResultShortPageVO);
-        List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.homePageOrLevelExportByDept(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);
         }
@@ -408,14 +391,74 @@ public class ConsoleByDeptExportFacade {
             fileName = "病案首页合格数病历详情页.xls";
         }
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
-            ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
         }
         if("2".equals(qcResultShortPageVO.getRadioCheck())){
-            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
         }
    }
 
-    *//**
+   public void  solveParam(QcResultShortPageVO qcResultShortPageVO){
+       String hospitalId = SysUserUtils.getCurrentHospitalID();
+       qcResultShortPageVO.setHospitalId(hospitalId);
+       Date startDate = qcResultShortPageVO.getStartDate();
+       Date endDate = qcResultShortPageVO.getEndDate();
+       //时间间隔7天
+       long interval_7 = 7 * 24 * 60 * 60 * 1000;
+       long interval_90 = 90l * 24 * 60 * 60 * 1000;
+
+       if("1".equals(qcResultShortPageVO.getRadioCheck())){
+           //时间间隔7天
+           if (endDate.getTime() < startDate.getTime()) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+           }
+           if (endDate.getTime() - startDate.getTime() > interval_7) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
+           }
+       }else{
+           //时间间隔90天
+           if (endDate.getTime() < startDate.getTime()) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+           }
+           if (endDate.getTime() - startDate.getTime() > interval_90) {
+               throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
+           }
+       }
+   }
+
+    public List<ExportNinetyByDeptDTO> transList(List<ExportExcelByDeptDTO>res, List<ExportNinetyByDeptDTO>resWide){
+        if(ListUtil.isNotEmpty(res)){
+            ExportNinetyByDeptDTO exportNinetyByDeptDTO = new ExportNinetyByDeptDTO();
+            List<ExportWideExcelByDeptDTO>exportWideExcelByDeptDTOs  =  new ArrayList<ExportWideExcelByDeptDTO>();
+            res.forEach(exportExcelByDeptDTO->{
+                ExportWideExcelByDeptDTO exportWideExcelByDeptDTO = new ExportWideExcelByDeptDTO();
+                exportWideExcelByDeptDTO.setAvgScore(exportExcelByDeptDTO.getAvgScore());
+                exportNinetyByDeptDTO.setBehDeptName( exportExcelByDeptDTO.getBehDeptName());
+                exportWideExcelByDeptDTO.setBehDoctorName(exportExcelByDeptDTO.getBehDoctorName());
+                List<ExportExcelBehByDeptDTO> exportExcelBehByDeptDTOS = exportExcelByDeptDTO.getExcelBehospitalDTOS();
+                List<ExportExcelWideBehByDeptDTO> exportExcelWideBehByDepDTOs = new ArrayList<>();
+
+                exportExcelBehByDeptDTOS.forEach(exportExcelBehByDeptDTO->{
+                    ExportExcelWideBehByDeptDTO exportExcelWideBehByDeptDTO = new ExportExcelWideBehByDeptDTO();
+                    exportExcelWideBehByDeptDTO.setBehospitalCode(exportExcelBehByDeptDTO.getBehospitalCode());
+                    exportExcelWideBehByDeptDTO.setBehospitalDate(exportExcelBehByDeptDTO.getBehospitalDate());
+                    exportExcelWideBehByDeptDTO.setLeaveHospitalDate(exportExcelBehByDeptDTO.getLeaveHospitalDate());
+                    exportExcelWideBehByDeptDTO.setPatName(exportExcelBehByDeptDTO.getPatName());
+                    exportExcelWideBehByDeptDTO.setScore(exportExcelBehByDeptDTO.getScore());
+                    exportExcelWideBehByDeptDTO.setScoreBn(exportExcelBehByDeptDTO.getScoreBn());
+                    exportExcelWideBehByDepDTOs.add(exportExcelWideBehByDeptDTO);
+                });
+                exportWideExcelByDeptDTO.setExcelBehospitalDTOS(exportExcelWideBehByDepDTOs);
+                exportWideExcelByDeptDTOs.add(exportWideExcelByDeptDTO);
+            });
+            exportNinetyByDeptDTO.setExportExcelByDeptDTOS(exportWideExcelByDeptDTOs);
+            resWide.add(exportNinetyByDeptDTO);
+        }
+        return resWide;
+    }
+
+
+    /**
      * 未整改病历统计导出
      *
      * @param response

+ 3 - 3
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -498,14 +498,14 @@ public class ConsoleByDeptFacade {
         }
         filterFacade.filterOrderByDeptVOSet(filterOrderByDeptVO);
         List<HomePageByDeptDTO> records = behospitalInfoFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
-        //没有医生过滤时增加全科室数据
-        if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())
+        //没有医生过滤时增加全科室数据 --暂时不做汇总处理
+       /* if (StringUtil.isBlank(filterOrderByDeptVO.getDeptName())
                 || filterOrderByDeptVO.getDeptName().equals(filterOrderByDeptVO.getDeptName())) {
             HomePageByDeptDTO item = getGlobleRecord(records, filterOrderByDeptVO.getDeptName());
             if (item != null) {
                 records.add(0, item);
             }
-        }
+        }*/
         return records;
     }
 

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

@@ -411,6 +411,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
 
     /**
      * 31天再入院详情页

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

@@ -378,6 +378,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
 
     /**
      * 31天再入院详情页

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

@@ -629,6 +629,18 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<ExportExcelDTO> badLevelPagePageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.badLevelPagePageExport((qcResultShortPageVO));
     }
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> homePageOrLevelExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.homePageOrLevelExportByDept((qcResultShortPageVO));
+    }
+
+
 
     /**
      * 31天再入院详情页

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

@@ -35,6 +35,7 @@ public class QcResultShortPageVO extends Page {
     /**
      * (1-导出7天[含缺陷明细项]  2-导出90天[不含缺陷明细项] )
      */
+    @NotNull(message = "导出天数选择不能为空")
     private String radioCheck = "1";
 
     /**

+ 33 - 1
src/main/java/com/diagbot/web/ConsoleByDeptExportController.java

@@ -36,7 +36,7 @@ public class ConsoleByDeptExportController {
      * @return
      */
 
-    @ApiOperation(value = "病案首页合格率占比导出[by:cy]",
+    @ApiOperation(value = "病案首页合格率占比首页导出-科室[by:cy]",
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
                     "level: 病历等级 <br>" +
                     "deptName: 科室名称 <br>" +
@@ -50,6 +50,38 @@ public class ConsoleByDeptExportController {
         consoleByDeptExportFacade.homePageLevelExportByDept(response, filterOrderByDeptVO);
     }
 
+    /**
+     * 病案首页不合格/合格数病历详情页导出-科室
+     *
+     * @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>" +
+                    "titleName: 是否合格数 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/homePageOrLevelExportByDept")
+    @SysLogger("homePageOrLevelExportByDept")
+    public void homePageOrLevelExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleByDeptExportFacade.homePageOrLevelExportByDept(response, qcResultShortPageVO);
+    }
+
+
 
 /**
      * 条目缺陷占比(内页)

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

@@ -3223,6 +3223,28 @@
         </if>
     </select>
 
+    <resultMap id="ExportExcelMapByDept" type="com.diagbot.dto.ExportExcelByDeptDTO">
+        <result column="behDeptName" property="behDeptName"/>
+        <result column="behDoctorName" property="behDoctorName"/>
+        <result column="avgScore" property="avgScore"/>
+        <collection property="excelBehospitalDTOS"
+                    ofType="com.diagbot.dto.ExportExcelBehByDeptDTO">
+            <result column="patName" property="patName"/>
+            <result column="behospitalCode" property="behospitalCode"/>
+            <result column="behospitalDate" property="behospitalDate"/>
+            <result column="leaveHospitalDate" property="leaveHospitalDate"/>
+            <result column="score" property="score"/>
+            <result column="scoreBn" property="scoreBn"/>
+            <collection property="exportExcelCaseDTOS" ofType="com.diagbot.dto.ExportExcelCaseDTO">
+                <result column="caseName" property="caseName"/>
+                <collection property="exportExcelMsgDTOS"
+                            ofType="com.diagbot.dto.ExportExcelMsgDTO">
+                    <result column="msg" property="msg"/>
+                </collection>
+            </collection>
+        </collection>
+    </resultMap>
+
     <resultMap id="ExportExcelMap" type="com.diagbot.dto.ExportExcelDTO">
         <result column="behDeptName" property="behDeptName"/>
         <result column="avgScore" property="avgScore"/>
@@ -8802,6 +8824,496 @@
         AND f1.behDeptName = f2.behDeptName
     </select>
 
+
+    <!-- 病案首页不合格/合格数病历详情页导出-科室-->
+    <select id="homePageOrLevelExportByDept" resultMap="ExportExcelMapByDept">
+        SELECT
+        f1.behDeptId,
+        f1.behDeptName,
+        f1.behDoctorName,
+        f1.patName,
+        f1.behospitalCode,
+        f1.hospitalId,
+        f1.behospitalDate,
+        f1.leaveHospitalDate,
+        f1.score,
+        f1.scoreBn,
+        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.doctorName AS behDoctorName,
+        t.doctorId,
+        t.`name` AS patName,
+        t.behospitalCode AS behospitalCode,
+        t.behospitalDate AS behospitalDate,
+        t.leaveHospitalDate AS leaveHospitalDate,
+        qi.score_res AS score,
+        t.scoreBn,
+        <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.scoreBn,
+        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.*,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        b.gmt_create,
+        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.score_res as scoreBn,
+        c.cases_id,
+        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
+        FROM
+        med_behospital_info a,
+        sys_user_dept b,
+        med_qcresult_cases c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.beh_dept_id = b.dept_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND a.qc_type_id != 0
+        AND c.cases_id = 243
+        <if test="qcResultShortPageVO.userId!=null">
+            AND b.user_id = #{qcResultShortPageVO.userId}
+        </if>
+        <if test="qcResultShortPageVO.titleName != null ">
+            <if test="qcResultShortPageVO.titleName == '不合格数'">
+                AND c.`level`='不合格'
+            </if>
+            <if test="qcResultShortPageVO.titleName == '合格数'">
+                AND c.`level`='合格'
+            </if>
+        </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.diagnose != null and qcResultShortPageVO.diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
+        </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>
+        )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
+        left join med_qcresult_info b
+        on  b.is_deleted = 'N'
+        AND be.hospital_id = b.hospital_id
+        AND be.behospital_code = b.behospital_code
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultPageVO.level}
+        </if>
+        left join qc_cases_entry d
+        on  d.is_deleted = 'N'
+        AND be.cases_id = d.cases_id
+        <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.ruleType != null">
+            AND d.rule_type = #{qcResultShortPageVO.ruleType}
+        </if>
+        ) 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
+            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
+        </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>
+        <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.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.*,
+        b.grade_type,
+        b.score_res,
+        b.gmt_create,
+        b.LEVEL,
+        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,
+        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
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail k,
+        sys_user_dept 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 = c.behospital_code
+        AND a.beh_dept_id = b.dept_id
+        AND c.cases_id = d.cases_id
+        AND a.hospital_id = k.hospital_id
+        AND a.behospital_code = k.behospital_code
+        AND c.cases_id = k.cases_id
+        AND k.cases_id = d.cases_id
+        AND k.cases_entry_id = d.id
+        <!--        <if test="qcResultShortPageVO.titleName != null ">-->
+        <!--            <if test="qcResultShortPageVO.titleName == '不合格数'">-->
+        <!--                AND c.`level`='不合格'-->
+        <!--            </if>-->
+        <!--            <if test="qcResultShortPageVO.titleName == '合格数'">-->
+        <!--                AND c.`level`='合格'-->
+        <!--            </if>-->
+        <!--        </if>-->
+        AND a.qc_type_id != 0
+        <if test="qcResultShortPageVO.userId!=null">
+            AND b.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.diagnose != null and qcResultShortPageVO.diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{qcResultShortPageVO.diagnose}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
+            AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
+        </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.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
+        left join med_qcresult_info b
+        on  b.is_deleted = 'N'
+        AND be.hospital_id = b.hospital_id
+        AND be.behospital_code = b.behospital_code
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultPageVO.level}
+        </if>
+        ) 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,
+        t.doctorId,
+        t.doctorName
+        )f2
+        WHERE
+        f1.doctorId = f2.doctorId
+        AND f1.behDoctorName = f2.doctorName
+    </select>
+
     <!-- 未整改病历缺陷评分详情页导出-->
     <select id="unModifyMRPageExport" resultMap="ExportExcelMap">
         SELECT