Quellcode durchsuchen

代码整合合并

zhanghang vor 3 Jahren
Ursprung
Commit
fe22a2b0f0

+ 31 - 0
src/main/java/com/diagbot/facade/ConsoleByDoctorFacade.java

@@ -3,12 +3,16 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.DoctorAverageLevelDTO;
 import com.diagbot.dto.DoctorAverageStatisticsDTO;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.DoctorAverageLevelVO;
 import com.diagbot.vo.DoctorAverageStatisticsVO;
+import com.diagbot.vo.GetDetailRecordListPageVO;
+import com.diagbot.vo.GetDoctorDetailPageVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -22,6 +26,10 @@ public class ConsoleByDoctorFacade {
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
 
+    @Autowired
+    QcresultInfoFacade qcresultInfoFacade;
+
+
     /**
      * 医生质控平均分页面统计
      *
@@ -72,4 +80,27 @@ public class ConsoleByDoctorFacade {
         }
         doctorAverageLevelVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
     }
+
+    /**
+     * 获取缺陷列表
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(GetDoctorDetailPageVO getDoctorDetailPageVO) {
+        IPage<GetDoctorDetailPageDTO> detailPageList = behospitalInfoFacade.getBaseMapper().getDoctorDetailPage(getDoctorDetailPageVO);
+        return detailPageList;
+    }
+
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        IPage<GetDetailRecordListPageDTO> detailPageList = behospitalInfoFacade.getBaseMapper().getDetailRecordListPage(getDetailRecordListPageVO);
+        return detailPageList;
+    }
+
 }

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

@@ -1,46 +0,0 @@
-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;
-    }
-
-}

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

@@ -810,4 +810,20 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @Return java.util.List<com.diagbot.dto.ExportDoctorAverageLevel_7DTO>
      */
     List<ExportDoctorAverageLevel_7DTO> doctorAverageLevelExport(ExportDoctorAverageLevelVO doctorAverageLevelVO);
+
+    /**
+     * 缺陷详情(分页)(根据医生)
+     *
+     * @param getDoctorDetailPageVO
+     * @return
+     */
+    public IPage<GetDoctorDetailPageDTO> getDoctorDetailPage(@Param("getDoctorDetailPageVO") GetDoctorDetailPageVO getDoctorDetailPageVO);
+    /**
+     * 获取缺陷数量对应的病历
+     *
+     * @param getDetailRecordListPageVO
+     * @return
+     */
+    public IPage<GetDetailRecordListPageDTO> getDetailRecordListPage(@Param("getDetailRecordListPageVO") GetDetailRecordListPageVO getDetailRecordListPageVO);
+
 }

+ 0 - 14
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -219,18 +219,4 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     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);
 }

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

@@ -196,20 +196,4 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     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);
 }

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

@@ -297,26 +297,4 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
         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);
-    }
-
 }

+ 37 - 0
src/main/java/com/diagbot/web/ConsoleByDoctorController.java

@@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.DoctorAverageLevelDTO;
 import com.diagbot.dto.DoctorAverageStatisticsDTO;
+import com.diagbot.dto.GetDetailRecordListPageDTO;
+import com.diagbot.dto.GetDoctorDetailPageDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ConsoleByDoctorFacade;
 import com.diagbot.facade.ConsoleExportFacade;
 import com.diagbot.vo.DoctorAverageLevelVO;
 import com.diagbot.vo.DoctorAverageStatisticsVO;
 import com.diagbot.vo.ExportDoctorAverageLevelVO;
+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;
@@ -88,4 +92,37 @@ public class ConsoleByDoctorController {
     public void doctorAverageLevelExport(HttpServletResponse response, @RequestBody @Valid ExportDoctorAverageLevelVO exportDoctorAverageLevelVO) {
         consoleExportFacade.doctorAverageLevelExport(response, exportDoctorAverageLevelVO);
     }
+
+
+    @ApiOperation(value = "获取缺陷列表[by:zhanghang]",
+            notes = "获取缺陷列表接口")
+    @PostMapping("/getDoctorDetailPage")
+    @SysLogger("getDoctorDetailPage")
+    public RespDTO<IPage<GetDoctorDetailPageDTO>> getDoctorDetailPage(@RequestBody GetDoctorDetailPageVO getDetailListPageVO) {
+        return  RespDTO.onSuc(consoleByDoctorFacade.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(consoleByDoctorFacade.getDetailRecordListPage(getDetailRecordListPageVO));
+    }
+
+    @ApiOperation(value = "导出缺陷数量对应的病历[by:zhanghang]",
+            notes = "导出缺陷数量对应的病历")
+    @PostMapping("/getDetailRecordListPageExport")
+    @SysLogger("getDetailRecordListPageExport")
+    public void getDetailRecordListPageExport(HttpServletResponse response,@RequestBody GetDetailRecordListPageVO getDetailRecordListPageVO) {
+        consoleExportFacade.getDetailRecordListPageExport(response,getDetailRecordListPageVO);
+    }
 }

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

@@ -1,68 +0,0 @@
-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);
-    }
-
-}

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

@@ -20266,4 +20266,432 @@
             <![CDATA[ and tu.mr_time < #{mrTimeEnd}]]>
         </if>
     </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.deptId ,
+        tt1.deptName ,
+        tt2.id AS id,
+        tt2.NAME AS NAME,
+        tt2.cases_id AS casesId,
+        tt2.cases_name AS casesName,
+        tt1.num,
+        tt1.doctorId ,
+        tt1.doctorName ,
+        tt2.rule_type AS ruleType,
+        tt1.is_reject AS isReject
+        FROM
+        (
+        SELECT
+        d.cases_id,
+        d.cases_entry_id,
+        CASE WHEN (a.doctor_id is null OR a.doctor_id = '' OR a.doctor_id = '-') THEN '-' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN (a.doctor_name is null OR a.doctor_name = '' OR a.doctor_name = '-') THEN '-' ELSE a.doctor_name END AS doctorName,
+        CASE WHEN (a.beh_dept_id is null OR a.beh_dept_id = '' OR a.beh_dept_id = '-') THEN '-' ELSE a.beh_dept_id END AS deptId,
+        CASE WHEN (a.beh_dept_name is null OR a.beh_dept_name = '' OR a.beh_dept_name = '-') THEN '-' ELSE a.beh_dept_name END AS deptName,
+        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
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.doctor_id,
+        a.doctor_name,
+        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.deptId != null and getDetailRecordListPageVO.deptId != ''">
+            AND a.beh_dept_id = #{getDetailRecordListPageVO.deptId}
+        </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>

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

@@ -2498,425 +2498,4 @@
     </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>