ソースを参照

医生缺陷列表查询,导出。缺陷数量跳转病历,导出

zhanghang 3 年 前
コミット
0ab2baf3c5

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

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

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

@@ -370,6 +370,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/appealInfo/getUserRole", request)
                 || matchers("/qc/mode/getModes", request)
                 || matchers("/consoleByDoctor/**", request)
+                || matchers("/qc/getDoctorDetail/**", request)
                 || matchers("/", request)) {
             return true;
         }

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

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

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

@@ -0,0 +1,55 @@
+package com.diagbot.dto;
+
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 获取医生缺陷列表出参
+ * @author: zhanghang
+ * @time: 2022/4/11 19:00
+ */
+@ApiModel(value = "获取医生缺陷列表出参-接口出参")
+@Getter
+@Setter
+public class ExportGetDoctorDetailPageDTO implements Serializable {
+
+
+    @Excel(name = "缺陷名称", width = 40, orderNum = "2")
+    private String name;
+
+    @Excel(name = "模块名称", width = 20, orderNum = "1")
+    private String casesName;
+
+    @Excel(name = "科室ID", width = 20, orderNum = "9")
+    private String deptId;
+
+    @Excel(name = "科室名称", width = 20, orderNum = "10")
+    private String deptName;
+
+    @Excel(name = "缺陷总数", width = 20, orderNum = "11")
+    private Integer totleNum = 0;
+
+    @Excel(name = "数量", orderNum = "5")
+    private Integer num = 0;
+
+    @Excel(name = "缺陷占比", orderNum = "6")
+    private String percentStr = "0.00%";
+
+    @Excel(name = "分值", orderNum = "3")
+    private Double score = 0d;
+
+    @Excel(name = "单项否决", orderNum = "4", replace = { "否_0", "是_1" })
+    private Integer isReject;
+
+    @Excel(name = "医生ID", orderNum = "7")
+    private Long doctorId;
+
+    @Excel(name = "医生ID", orderNum = "8")
+    private String doctorName;
+
+}

+ 128 - 0
src/main/java/com/diagbot/dto/GetDetailRecordListPageDTO.java

@@ -0,0 +1,128 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 获取医生缺陷数量出参
+ * @Author:zhanghang
+ * @time: 2022/4/11 19:00
+ */
+@ApiModel(value = "获取医生缺陷数量出参-接口出参")
+@Getter
+@Setter
+public class GetDetailRecordListPageDTO implements Serializable {
+
+    @ApiModelProperty(value = "医院id")
+    private String hospitalId;
+
+
+    @ApiModelProperty(value = "病历等级")
+    private String level;
+
+    @ApiModelProperty(value = "病历得分")
+    private Double scoreRes;
+
+    @ApiModelProperty(value = "病案首页得分")
+    private Double scoreBn;
+
+    @ApiModelProperty(value = "病人住院序号")
+    private String behospitalCode;
+
+    @ApiModelProperty(value = "病案号")
+    private String fileCode;
+
+    @ApiModelProperty(value = "病人姓名")
+    private String name;
+
+    @ApiModelProperty(value = "性别")
+    private String sex;
+
+    @ApiModelProperty(value = "年龄")
+    private String age;
+
+    @ApiModelProperty(value = "床号")
+    private String bedCode;
+
+    @ApiModelProperty(value = "入院日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    @ApiModelProperty(value = "出院日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+
+    @ApiModelProperty(value = "归档日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date placefileDate;
+
+    @ApiModelProperty(value = "主诊断")
+    private String diagnose;
+
+    @ApiModelProperty(value = "住院医生ID")
+    private String behDoctorId;
+
+
+    @ApiModelProperty(value = "住院医生姓名")
+    private String behDoctorName;
+
+    @ApiModelProperty(value = "主治医生id")
+    private String doctorId;
+
+    @ApiModelProperty(value = "主治医生姓名")
+    private String doctorName;
+
+    @ApiModelProperty(value = "主任医生id")
+    private String directorDoctorId;
+
+    @ApiModelProperty(value = "主任医生")
+    private String directorDoctorName;
+
+    @ApiModelProperty(value = "科室编码")
+    private String behDeptId;
+
+    @Excel(name = "科室", width = 70, orderNum = "17")
+    @ApiModelProperty(value = "科室名称")
+    private String behDeptName;
+
+    @ApiModelProperty(value = "评分时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date gradeTime;
+
+    @ApiModelProperty(value = "评分类型")
+    private Integer gradeType;
+
+    @ApiModelProperty(value = "出生日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date birthday;
+
+    @ApiModelProperty(value = "病区名称")
+    private String wardName;
+
+    @ApiModelProperty(value = "病历核查状态")
+    private Integer checkStatus;
+
+    @ApiModelProperty(value = "首页核查状态")
+    private Integer mrStatus;
+
+    @ApiModelProperty(value = "病历核查人员")
+    private String chName;
+
+    @ApiModelProperty(value = "首页核查人员")
+    private String mrName;
+
+    @ApiModelProperty(value = "病历核查时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date chTime;
+
+    @ApiModelProperty(value = "首页核查时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date mrTime;
+}

+ 65 - 0
src/main/java/com/diagbot/dto/GetDoctorDetailPageDTO.java

@@ -0,0 +1,65 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 获取医生缺陷列表
+ * @author: zhanghang
+ * @time: 2022/4/11 19:00
+ */
+@ApiModel(value = "获取医生缺陷列表-接口出参")
+@Getter
+@Setter
+public class GetDoctorDetailPageDTO implements Serializable {
+
+    @ApiModelProperty(value = "条目缺陷id")
+    private Long id;
+
+    @ApiModelProperty(value = "条目缺陷名称")
+    private String name;
+
+    @ApiModelProperty(value = "模块id")
+    private Long casesId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String casesName;
+
+    @ApiModelProperty(value = "科室id")
+    private String deptId;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "条目缺陷总数")
+    private Integer totleNum = 0;
+
+    @ApiModelProperty(value = "条目缺陷数")
+    private Integer num = 0;
+
+    @ApiModelProperty(value = "条目缺陷占比")
+    private Double percent = 0.00d;
+
+    @ApiModelProperty(value = "条目缺陷占比")
+    private String percentStr = "0.00%";
+
+    @ApiModelProperty(value = "条目缺陷分值")
+    private Double score = 0d;
+
+    @ApiModelProperty(value = "单项否决标识,0-否,1-是")
+    private Integer isReject;
+
+    @ApiModelProperty(value = "规则类型(0:无,1:空项,2:错误)")
+    private Integer ruleType;
+
+    @ApiModelProperty(value = "医生ID")
+    private Long doctorId;
+
+    @ApiModelProperty(value = "医生名称")
+    private String doctorName;
+
+}

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

@@ -19,8 +19,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.util.*;
 
 /**
- * @Description: 报表导出装饰层
- * @author: gaodm
+ * @Description: 控制台(医生)统计相关API
+ * @author: zhanghang
  * @time: 2020/6/18 10:41
  */
 @Component
@@ -36,6 +36,8 @@ public class ConsoleExportFacade {
     private FilterFacade filterFacade;
     @Autowired
     private ConsoleByDoctorFacade consoleByDoctorFacade;
+    @Autowired
+    private GetDoctorDetailFacade getDoctorDetailFacade;
 
     /**
      * 病案首页合格率占比
@@ -794,7 +796,7 @@ public class ConsoleExportFacade {
     }
 
     /**
-     *  医生质控平均分-患者列表(等级)-导出
+     * 医生质控平均分-患者列表(等级)-导出
      *
      * @param response
      * @param exportDoctorAverageLevelVO
@@ -899,4 +901,57 @@ public class ConsoleExportFacade {
             doctorAverageLevelVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAverageLevelVO.getLeaveHosDateEnd(), 1)));
         }
     }
+
+    /**
+     * 医生质控缺陷列表-导出
+     *
+     * @param response
+     * @param getDetailListPageVO
+     * @Return void
+     */
+    public void getDoctorDetailPageExport(HttpServletResponse response, GetDoctorDetailPageVO getDetailListPageVO) {
+        //1.查询
+        IPage<GetDoctorDetailPageDTO> doctorDetailPage = getDoctorDetailFacade.getDoctorDetailPage(getDetailListPageVO);
+        //2.列表拷贝
+        List<ExportGetDoctorDetailPageDTO> records = BeanUtil.listCopyTo(doctorDetailPage.getRecords(), ExportGetDoctorDetailPageDTO.class);
+        //3.导出
+        String fileName = "医生缺陷列表.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportGetDoctorDetailPageDTO.class, fileName, response);
+    }
+
+    /**
+     * 缺陷数量对应的病历-导出
+     *
+     * @param response
+     * @param getDetailRecordListPageVO
+     * @Return void
+     */
+    public void getDetailRecordListPageExport(HttpServletResponse response, GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        getDetailRecordListPageVO.setHospitalId(hospitalId);
+        if (StringUtil.isNotBlank(getDetailRecordListPageVO.getDeptName())
+                && getDetailRecordListPageVO.getDeptName().equals("全部")) {
+            getDetailRecordListPageVO.setDeptName("");
+        }
+        Date startDate = getDetailRecordListPageVO.getStartDate();
+        Date endDate = getDetailRecordListPageVO.getEndDate();
+        //时间间隔90天
+        long interval = 90 * 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天");
+        }
+        getDetailRecordListPageVO.setCurrent(1L);
+        getDetailRecordListPageVO.setSize(Long.MAX_VALUE);
+        getDetailRecordListPageVO.setSearchCount(false);
+        //1.查询
+        IPage<GetDetailRecordListPageDTO> detailRecordListPage = getDoctorDetailFacade.getDetailRecordListPage(getDetailRecordListPageVO);
+        List<ExportGetDetailRecordListPageDTO> records = BeanUtil.listCopyTo(detailRecordListPage.getRecords(), ExportGetDetailRecordListPageDTO.class);
+        String fileName = "缺陷病历信息.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportGetDetailRecordListPageDTO.class, fileName, response);
+    }
 }

+ 46 - 0
src/main/java/com/diagbot/facade/GetDoctorDetailFacade.java

@@ -0,0 +1,46 @@
+package com.diagbot.facade;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/6/18 10:41
+ */
+@Component
+public class GetDoctorDetailFacade {
+
+    @Autowired
+    QcresultInfoFacade qcresultInfoFacade;
+
+    /**
+     * 获取缺陷列表
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(GetDoctorDetailPageVO getDoctorDetailPageVO) {
+        IPage<GetDoctorDetailPageDTO> detailPageList = qcresultInfoFacade.getDoctorDetailPage(getDoctorDetailPageVO);
+        return detailPageList;
+    }
+
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        IPage<GetDetailRecordListPageDTO> detailPageList = qcresultInfoFacade.getDetailRecordListPage(getDetailRecordListPageVO);
+        return detailPageList;
+    }
+
+}

+ 19 - 1
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -7,6 +7,8 @@ import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
@@ -14,10 +16,11 @@ import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterPageXYVO;
 import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
 import com.diagbot.vo.QcresultFilterVO;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -215,4 +218,19 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
+
+    /**
+     * 缺陷详情(分页)(根据医生)
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO);
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
 }

+ 21 - 0
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -7,12 +7,16 @@ import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
 import com.diagbot.vo.QcresultFilterVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -191,4 +195,21 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @return
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
+
+    /**
+     * 条目缺陷占比-个人
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO);
+
+
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
 }

+ 27 - 1
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -7,6 +7,8 @@ import com.diagbot.dto.DeptEntryNumDTO;
 import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.EntryNumGroupDTO;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
 import com.diagbot.entity.QcresultInfo;
@@ -15,9 +17,10 @@ import com.diagbot.service.QcresultInfoService;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
 import com.diagbot.vo.FilterVO;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
 import com.diagbot.vo.QcresultFilterVO;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
@@ -293,4 +296,27 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
         return baseMapper.qcResultLevelPercent(filterVO);
     }
+
+    /**
+     * 条目缺陷占比-个人
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    @Override
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO) {
+        return baseMapper.getDoctorDetailPage(getDoctorDetailPageVO);
+    }
+
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    @Override
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        return baseMapper.getDetailRecordListPage(getDetailRecordListPageVO);
+    }
+
 }

+ 118 - 0
src/main/java/com/diagbot/vo/GetDetailRecordListPageVO.java

@@ -0,0 +1,118 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 缺陷数量对应的病历-入参
+ * @Author: zhanghang
+ * @time: 2020/6/16 17:00
+ */
+@Getter
+@Setter
+public class GetDetailRecordListPageVO extends Page implements Serializable {
+
+    @ApiModelProperty(value = "用户id" ,hidden = true)
+    private Long userId;
+    @ApiModelProperty(value = "医院id",hidden = true)
+    private String hospitalId;
+
+    @ApiModelProperty(value = "病历号")
+    private String behospitalCode;
+
+    @ApiModelProperty(value = "病人姓名")
+    private String patName;
+
+    @ApiModelProperty(value = "条目名称")
+    private String casesEntryName;
+
+    @ApiModelProperty(value = "(1-导出7天[含缺陷明细项]  2-导出90天[不含缺陷明细项] )")
+    @NotNull(message = "导出天数选择不能为空")
+    private String radioCheck = "1";
+
+    @ApiModelProperty(value = "主诊断")
+    private String diagnose;
+
+    @ApiModelProperty(value = "title名称")
+    private String titleName;
+
+    @ApiModelProperty(value = "条目id")
+    private Long casesEntryId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String casesName;
+
+    @ApiModelProperty(value = "模块id")
+    private Long casesId;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "科室id")
+    private String deptId;
+
+    @ApiModelProperty(value = "医生姓名")
+    private String doctorName;
+
+    @ApiModelProperty(value = "医生编号ID")
+    private String doctorId;
+
+    @ApiModelProperty(value = "病历等级")
+    private String level;
+
+    @ApiModelProperty(value = "起始时间")
+    @NotNull(message = "请输入起始时间")
+    private Date startDate;
+
+    @ApiModelProperty(value = "截止时间")
+    @NotNull(message = "请输入截止时间")
+    private Date endDate;
+
+    @ApiModelProperty(value = "单项否决")
+    private Integer isReject;
+
+    @ApiModelProperty(value = "规则类型(0:无,1:空项,2:错误)")
+    private Integer ruleType;
+
+    @ApiModelProperty(value = "离院人员类型(0/null:总人数,1:死亡人数,2:新生儿,3:手术病人数,4:非医嘱离院病人,5:31日再入院病人)")
+    private Integer leaveHosType;
+
+    @ApiModelProperty(value = "核查状态(1:已核查,0:未核查)")
+    private Integer checkStatus;
+
+    @ApiModelProperty(value = "首页核查状态(1:已核查,0:未核查)")
+    private Integer mrStatus;
+
+    @ApiModelProperty(value = "病历核查人员")
+    private String chName;
+
+    @ApiModelProperty(value = "首页核查人员")
+    private String mrName;
+
+    @ApiModelProperty(value = "病历核查起始时间")
+    private Date chTimeStart;
+
+    @ApiModelProperty(value = "病历核查截止时间")
+    private Date chTimeEnd;
+
+    @ApiModelProperty(value = "首页核查起始时间")
+    private Date mrTimeStart;
+
+    @ApiModelProperty(value = "首页核查截止时间")
+    private Date mrTimeEnd;
+
+    @ApiModelProperty(value = "是否归档(0:未归档,1:已归档)")
+    private String isPlacefile = "1";
+
+    @ApiModelProperty(value = "住院超过31日标志")
+    private Integer beHosGT31Days;
+
+    @ApiModelProperty(value = "改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历)")
+    private Integer improveType;
+}

+ 70 - 0
src/main/java/com/diagbot/vo/GetDoctorDetailPageVO.java

@@ -0,0 +1,70 @@
+package com.diagbot.vo;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 获取缺陷列表入参
+ *
+ * @Description:
+ * @author: zhanghang
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class GetDoctorDetailPageVO extends Page implements Serializable {
+
+
+    @ApiModelProperty(value = "统计维度 1-本月,2-本年")
+    private Integer type;
+
+    @ApiModelProperty(value = "起始时间")
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+
+    @ApiModelProperty(value = "结束时间")
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+
+    @ApiModelProperty(value = "医院id", hidden = true)
+    private String hospitalId;
+
+    @ApiModelProperty(value = "用户id", hidden = true)
+    private Long userId;
+
+    @ApiModelProperty(value = "缺陷名称")
+    private String name;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "科室id")
+    private String deptId;
+
+    @ApiModelProperty(value = "医生姓名")
+    private String doctorName;
+
+    @ApiModelProperty(value = "医生id")
+    private String doctorId;
+
+    @ApiModelProperty(value = "模块id:243=病案首页")
+    private Long casesId;
+
+    @ApiModelProperty(value = "模块名称")
+    private String casesName;
+
+    @ApiModelProperty(value = "单项否决")
+    private Integer isReject;
+
+    @ApiModelProperty(value = "规则类型(0:无,1:空项,2:错误)")
+    private Integer ruleType;
+
+    @ApiModelProperty(value = "是否归档(0:未归档,1:已归档)")
+    private String isPlacefile = "1";
+}

+ 68 - 0
src/main/java/com/diagbot/web/DoctorDetailController.java

@@ -0,0 +1,68 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.ConsoleExportFacade;
+import com.diagbot.facade.GetDoctorDetailFacade;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @Description:
+ * @author: zhanghang
+ * @time: 2022/4/8 14:03
+ */
+@RestController
+@RequestMapping("/qc/getDoctorDetail")
+@Api(value = "缺陷列表", tags = { "缺陷列表" })
+public class DoctorDetailController {
+    @Autowired
+    private GetDoctorDetailFacade getDoctorDetailFacade;
+    @Autowired
+    private ConsoleExportFacade consoleExportFacade;
+
+    @ApiOperation(value = "获取缺陷列表[by:zhanghang]",
+            notes = "获取缺陷列表接口")
+    @PostMapping("/getDoctorDetailPage")
+    @SysLogger("getDoctorDetailPage")
+    public RespDTO<IPage<GetDoctorDetailPageDTO>> getDoctorDetailPage(@RequestBody GetDoctorDetailPageVO getDetailListPageVO) {
+        return  RespDTO.onSuc(getDoctorDetailFacade.getDoctorDetailPage(getDetailListPageVO));
+    }
+
+    @ApiOperation(value = "缺陷列表导出[by:zhanghang]",
+            notes = "缺陷列表导出接口")
+    @PostMapping("/getDoctorDetailPageExport")
+    @SysLogger("getDoctorDetailPageExport")
+    public void getDoctorDetailPageExport(HttpServletResponse response, @RequestBody GetDoctorDetailPageVO getDetailListPageVO) {
+        consoleExportFacade.getDoctorDetailPageExport(response, getDetailListPageVO);
+    }
+
+    @ApiOperation(value = "获取缺陷数量对应的病历[by:zhanghang]",
+            notes = "获取缺陷数量对应的病历")
+    @PostMapping("/getDetailRecordListPage")
+    @SysLogger("getDetailRecordListPage")
+    public RespDTO<IPage<GetDetailRecordListPageDTO>> getDetailRecordListPage(@RequestBody GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        return  RespDTO.onSuc(getDoctorDetailFacade.getDetailRecordListPage(getDetailRecordListPageVO));
+    }
+
+    @ApiOperation(value = "导出缺陷数量对应的病历[by:zhanghang]",
+            notes = "导出缺陷数量对应的病历")
+    @PostMapping("/getDetailRecordListPageExport")
+    @SysLogger("getDetailRecordListPageExport")
+    public void getDetailRecordListPageExport(HttpServletResponse response,@RequestBody GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        consoleExportFacade.getDetailRecordListPageExport(response,getDetailRecordListPageVO);
+    }
+
+}

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

@@ -2496,4 +2496,427 @@
         ) t2
         )t
     </select>
+
+
+
+    <!-- 缺陷详情-个人(分页) -->
+    <select id="getDoctorDetailPage"  resultType="com.diagbot.dto.GetDoctorDetailPageDTO">
+        SELECT
+        t.*
+        FROM
+        (
+        SELECT
+        t1.deptId,
+        t1.deptName,
+        t1.id,
+        t1.NAME,
+        t1.casesId,
+        t1.casesName,
+        t1.num,
+        t2.totleNum,
+        t1.doctorId,
+        t1.ruleType,
+        t1.isReject,
+        t1.doctorName,
+        ROUND( t1.num / t2.totleNum, 4 ) AS percent,
+        CONCAT( ROUND( t1.num / t2.totleNum * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        tt1.beh_dept_id AS deptId,
+        tt1.beh_dept_name AS deptName,
+        tt2.id AS id,
+        tt2.NAME AS NAME,
+        tt2.cases_id AS casesId,
+        tt2.cases_name AS casesName,
+        tt1.num,
+        tt1.doctor_id AS doctorId,
+        tt1.doctor_name AS doctorName,
+        tt2.rule_type AS ruleType,
+        tt1.is_reject AS isReject
+        FROM
+        (
+        SELECT
+        a.beh_dept_id,
+        a.beh_dept_name,
+        d.cases_id,
+        d.cases_entry_id,
+        CASE a.doctor_id WHEN NULL THEN "-" ELSE a.doctor_id END  doctor_id,
+        CASE a.doctor_name WHEN NULL THEN "-" ELSE a.doctor_name END  doctor_name,
+        d.is_reject,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail d
+        WHERE
+        a.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = d.hospital_id
+        AND a.behospital_code = d.behospital_code
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile != ''">
+            and a.is_placefile = #{getDoctorDetailPageVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="getDoctorDetailPageVO.hospitalId != null and getDoctorDetailPageVO.hospitalId != ''">
+            AND a.hospital_id = #{getDoctorDetailPageVO.hospitalId}
+        </if>
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 0">
+            <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{getDoctorDetailPageVO.startDate}]]>
+            </if>
+            <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{getDoctorDetailPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 1">
+            <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{getDoctorDetailPageVO.startDate}]]>
+            </if>
+            <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{getDoctorDetailPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDoctorDetailPageVO.deptName != null and getDoctorDetailPageVO.deptName != ''">
+            AND a.beh_dept_name = #{getDoctorDetailPageVO.deptName}
+        </if>
+        <if test="getDoctorDetailPageVO.deptId != null and getDoctorDetailPageVO.deptId != ''">
+            AND a.beh_dept_id = #{getDoctorDetailPageVO.deptId}
+        </if>
+        <if test="getDoctorDetailPageVO.doctorId != null and getDoctorDetailPageVO.doctorId != ''">
+            AND a.doctor_id = #{getDoctorDetailPageVO.doctorId}
+        </if>
+        <if test="getDoctorDetailPageVO.doctorName != null and getDoctorDetailPageVO.doctorName != ''">
+            AND a.doctor_name =  #{getDoctorDetailPageVO.doctorName}
+        </if>
+        <if test="getDoctorDetailPageVO.casesId != null and getDoctorDetailPageVO.casesId != 0">
+            AND d.cases_id = #{getDoctorDetailPageVO.casesId}
+        </if>
+        <if test="getDoctorDetailPageVO.isReject != null">
+            AND d.is_reject = #{getDoctorDetailPageVO.isReject}
+        </if>
+        GROUP BY
+        d.cases_entry_id,
+        d.cases_id
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        AND tt1.cases_id = tt2.cases_id
+        AND tt1.cases_entry_id = tt2.id
+        <if test="getDoctorDetailPageVO.casesName != null and getDoctorDetailPageVO.casesName != ''">
+            AND tt2.cases_name like CONCAT('%', #{getDoctorDetailPageVO.casesName},'%')
+        </if>
+        <if test="getDoctorDetailPageVO.name != null and getDoctorDetailPageVO.name != ''">
+            AND tt2.name like CONCAT('%', #{getDoctorDetailPageVO.name},'%')
+        </if>
+        <if test="getDoctorDetailPageVO.ruleType != null">
+            AND tt2.rule_type = #{getDoctorDetailPageVO.ruleType}
+        </if>
+        ) t1,(
+        SELECT
+        count(*) AS totleNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail d,
+        qc_cases_entry e
+        WHERE
+        a.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = d.hospital_id
+        AND a.behospital_code = d.behospital_code
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile != ''">
+            and a.is_placefile = #{getDoctorDetailPageVO.isPlacefile}
+        </if>
+        AND e.cases_id = d.cases_id
+        AND e.id = d.cases_entry_id
+        AND a.qc_type_id != 0
+        <if test="getDoctorDetailPageVO.hospitalId != null and getDoctorDetailPageVO.hospitalId != ''">
+            AND a.hospital_id = #{getDoctorDetailPageVO.hospitalId}
+        </if>
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 0">
+            <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{getDoctorDetailPageVO.startDate}]]>
+            </if>
+            <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{getDoctorDetailPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDoctorDetailPageVO.isPlacefile != null and getDoctorDetailPageVO.isPlacefile == 1">
+            <if test="getDoctorDetailPageVO.startDate != null and getDoctorDetailPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{getDoctorDetailPageVO.startDate}]]>
+            </if>
+            <if test="getDoctorDetailPageVO.endDate != null and getDoctorDetailPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{getDoctorDetailPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDoctorDetailPageVO.deptName != null and getDoctorDetailPageVO.deptName != ''">
+            AND a.beh_dept_name  =  #{getDoctorDetailPageVO.deptName}
+        </if>
+        <if test="getDoctorDetailPageVO.doctorName != null and getDoctorDetailPageVO.doctorName != ''">
+            AND a.doctor_name = #{getDoctorDetailPageVO.doctorName}
+        </if>
+        <if test="getDoctorDetailPageVO.deptId != null and getDoctorDetailPageVO.deptId != ''">
+            AND a.beh_dept_id = #{getDoctorDetailPageVO.deptId}
+        </if>
+        <if test="getDoctorDetailPageVO.doctorId != null and getDoctorDetailPageVO.doctorId != ''">
+            AND a.doctor_id = #{getDoctorDetailPageVO.doctorId}
+        </if>
+        <if test="getDoctorDetailPageVO.isReject != null">
+            AND d.is_reject = #{getDoctorDetailPageVO.isReject}
+        </if>
+        <if test="getDoctorDetailPageVO.ruleType != null">
+            AND e.rule_type = #{getDoctorDetailPageVO.ruleType}
+        </if>
+        ) t2
+        )t
+    </select>
+
+    <!-- 获取缺陷数量对应的病历 -->
+    <select id="getDetailRecordListPage"  resultType="com.diagbot.dto.GetDetailRecordListPageDTO">
+        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.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,
+        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 DISTINCT
+        tt1.*
+        FROM
+        (SELECT
+        be.*,
+        ifnull(mci.status,0) AS checkStatus,
+        ifnull(hm_mci.status,0) AS mrStatus,
+        mci.check_name as chName,
+        e.score_res as scoreBn,
+        hm_mci.check_name as mrName,
+        mci.gmt_create as chTime,
+        hm_mci.gmt_create as mrTime
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.bed_code,
+        a.file_code,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        a.NAME,
+        a.sex,
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.birthday,
+        a.behospital_date,
+        a.leave_hospital_date,
+        a.doctor_id,
+        a.doctor_name,
+        a.beh_doctor_id,
+        a.beh_doctor_name,
+        a.director_doctor_id,
+        a.director_doctor_name,
+        a.diagnose,
+        a.placefile_date,
+        a.ward_name,
+        b.gmt_create
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.qc_type_id != 0
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile != ''">
+            and a.is_placefile = #{getDetailRecordListPageVO.isPlacefile}
+        </if>
+        <if test="getDetailRecordListPageVO.hospitalId != null and getDetailRecordListPageVO.hospitalId != ''">
+            AND a.hospital_id = #{getDetailRecordListPageVO.hospitalId}
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 0">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.behospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null ">
+                <![CDATA[ AND a.behospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.isPlacefile != null and getDetailRecordListPageVO.isPlacefile == 1">
+            <if test="getDetailRecordListPageVO.startDate != null ">
+                <![CDATA[ AND a.leave_hospital_date >= #{getDetailRecordListPageVO.startDate}]]>
+            </if>
+            <if test="getDetailRecordListPageVO.endDate != null">
+                <![CDATA[ AND a.leave_hospital_date <= #{getDetailRecordListPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="getDetailRecordListPageVO.diagnose != null and getDetailRecordListPageVO.diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{getDetailRecordListPageVO.diagnose}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.deptName != null and getDetailRecordListPageVO.deptName != ''">
+            AND a.beh_dept_name = #{getDetailRecordListPageVO.deptName}
+        </if>
+        <if test="getDetailRecordListPageVO.level != null and getDetailRecordListPageVO.level != ''">
+            AND b.`level` = #{getDetailRecordListPageVO.level}
+        </if>
+        <if test="getDetailRecordListPageVO.behospitalCode != null and getDetailRecordListPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{getDetailRecordListPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.patName != null and getDetailRecordListPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{getDetailRecordListPageVO.patName}, '%' )
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryName != null and getDetailRecordListPageVO.casesEntryName != ''">
+            AND d.NAME = #{getDetailRecordListPageVO.casesEntryName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null ">
+            AND d.id = #{getDetailRecordListPageVO.casesEntryId}
+        </if>
+        <if test="getDetailRecordListPageVO.casesName != null and getDetailRecordListPageVO.casesName != ''">
+            AND d.cases_name = #{getDetailRecordListPageVO.casesName}
+        </if>
+        <if test="getDetailRecordListPageVO.casesId != null">
+            AND d.cases_id = #{getDetailRecordListPageVO.casesId}
+        </if>
+        <if test="getDetailRecordListPageVO.doctorId != null and getDetailRecordListPageVO.doctorId != ''">
+            AND (a.doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' )
+            OR a.beh_doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' )
+            OR a.director_doctor_id LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorId}, '%' ))
+        </if>
+        <if test="getDetailRecordListPageVO.doctorName != null and getDetailRecordListPageVO.doctorName != ''">
+            AND (a.doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{getDetailRecordListPageVO.doctorName}, '%' ))
+        </if>
+        <if test="getDetailRecordListPageVO.isReject != null">
+            AND c.is_reject = #{getDetailRecordListPageVO.isReject}
+        </if>
+        <if test="getDetailRecordListPageVO.ruleType != null">
+            AND d.rule_type = #{getDetailRecordListPageVO.ruleType}
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2495">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 30
+        </if>
+        <if test="getDetailRecordListPageVO.beHosGT31Days != null and getDetailRecordListPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and mci.check_type in(0,2)
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
+        left join med_check_info hm_mci
+        on hm_mci.is_deleted = 'N'
+        and hm_mci.check_type = 1
+        and be.hospital_id = hm_mci.hospital_id
+        and be.behospital_code = hm_mci.behospital_code
+        LEFT JOIN med_qcresult_cases e
+        on  be.behospital_code = e.behospital_code
+        and be.hospital_id = e.hospital_id
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        )tt1
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2511">
+            ,med_medical_record tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+            AND tt2.mode_id = 30
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and getDetailRecordListPageVO.casesEntryId==2419">
+            ,med_crisis_info tt2
+            WHERE
+            tt2.is_deleted = 'N'
+            AND tt1.hospital_id = tt2.hospital_id
+            AND tt1.behospital_code = tt2.behospital_code
+        </if>
+        ) t1
+        <if test="getDetailRecordListPageVO.casesEntryId == null or (getDetailRecordListPageVO.casesEntryId!=2594  and getDetailRecordListPageVO.casesEntryId!=2973 and getDetailRecordListPageVO.casesEntryId!=2930)">
+            LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.is_deleted = 'N'
+        </if>
+        <if test="getDetailRecordListPageVO.casesEntryId != null and( getDetailRecordListPageVO.casesEntryId==2594  or getDetailRecordListPageVO.casesEntryId==2973 or getDetailRecordListPageVO.casesEntryId==2930)">
+            , med_home_page t2
+            , med_home_operation_info t3
+            WHERE t1.hospital_id = t2.hospital_id
+            AND t1.behospital_code = t2.behospital_code
+            AND t2.home_page_id = t3.home_page_id
+            AND t2.is_deleted = 'N'
+            AND t3.is_deleted = 'N'
+        </if>
+        ) t
+        where 1=1
+        <if test="getDetailRecordListPageVO.checkStatus != null">
+            AND t.checkStatus = #{getDetailRecordListPageVO.checkStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.mrStatus != null">
+            AND t.mrStatus = #{getDetailRecordListPageVO.mrStatus}
+        </if>
+        <if test="getDetailRecordListPageVO.chName != null and getDetailRecordListPageVO.chName!=''">
+            AND t.chName like concat('%', #{getDetailRecordListPageVO.chName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.mrName != null and getDetailRecordListPageVO.mrName!=''">
+            AND t.mrName like concat('%', #{getDetailRecordListPageVO.mrName}, '%')
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeStart != null ">
+            <![CDATA[ AND t.chTime >= #{getDetailRecordListPageVO.chTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.chTimeEnd != null ">
+            <![CDATA[ AND t.chTime <= #{getDetailRecordListPageVO.chTimeEnd}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeStart != null ">
+            <![CDATA[ AND t.mrTime >= #{getDetailRecordListPageVO.mrTimeStart}]]>
+        </if>
+        <if test="getDetailRecordListPageVO.mrTimeEnd != null ">
+            <![CDATA[ AND t.mrTime <= #{getDetailRecordListPageVO.mrTimeEnd}]]>
+        </if>
+    </select>
+
 </mapper>