Pārlūkot izejas kodu

增加病历列表接口

chengyao 3 gadi atpakaļ
vecāks
revīzija
18315e4148

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

@@ -128,6 +128,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/levelStatisticsByDept").permitAll()
                 .antMatchers("/consoleByDept/mrCountByDept").permitAll()
                 .antMatchers("/consoleByDept/qcResultShortByDeptPage").permitAll()
+                .antMatchers("/consoleByDept/levelStatisticsByDeptPage").permitAll()
                 .antMatchers("/consoleByDept/resultStatisticsByDeptAndDoctorPage").permitAll()
                 .antMatchers("/console/export/homePageLevelExport").permitAll()
                 .antMatchers("/console/export/entryGroupByEntryExport").permitAll()
@@ -214,6 +215,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/homePageOrGoodLevelByDept").permitAll()
                 .antMatchers("/print/export/homePageLevelExportByDept").permitAll()
                 .antMatchers("/print/export/homePageOrLevelExportByDept").permitAll()
+                .antMatchers("/print/export/levelStatisticsExportByDept").permitAll()
                 .antMatchers("/print/export/entryGroupExportByDeptPage").permitAll()
                 .antMatchers("/print/export/entryGroupExportByDeptCase").permitAll()
                 .antMatchers("/print/export/entryGroupExportByDeptEntry").permitAll()

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

@@ -172,6 +172,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/levelStatisticsByDept", request)
                 || matchers("/consoleByDept/mrCountByDept", request)
                 || matchers("/consoleByDept/qcResultShortByDeptPage", request)
+                || matchers("/consoleByDept/levelStatisticsByDeptPage", request)
                 || matchers("/consoleByDept/resultStatisticsByDeptAndDoctorPage", request)
                 || matchers("/console/export/homePageLevelExport", request)
                 || matchers("/console/export/entryGroupByEntryExport", request)
@@ -258,6 +259,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/homePageOrGoodLevelByDept", request)
                 || matchers("/print/export/homePageLevelExportByDept", request)
                 || matchers("/print/export/homePageOrLevelExportByDept", request)
+                || matchers("/print/export/levelStatisticsExportByDept", request)
                 || matchers("/print/export/entryGroupExportByDeptPage", request)
                 || matchers("/print/export/entryGroupExportByDeptCase", request)
                 || matchers("/print/export/entryGroupExportByDeptEntry", request)

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

@@ -2163,7 +2163,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
     }
 
-    private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
+    public static void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
         //入参验证
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
         long interval_90 = 90 * 24 * 60 * 60 * 1000l;

+ 35 - 0
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -52,6 +52,41 @@ public class ConsoleByDeptExportFacade {
         ExcelUtils.exportExcel(res, null, "sheet1", HomePageByDeptDTO.class, fileName, response, 12.8f);
     }
 
+    /**
+     * 各科室缺陷占比科室导出
+     *
+     * @param response
+     * @param exportQcresultVO
+     */
+    public void levelStatisticsExportByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        exportQcresultVO.setHospitalId(hospitalId);
+        exportQcresultVO.setUserId(Long.valueOf(userId));
+        //时间设置
+       BehospitalInfoFacade.exportQcresultVOSet(exportQcresultVO);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.getBaseMapper().levelStatisticsExportByDept(exportQcresultVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(exportQcresultVO.getRadioCheck())){
+            resWide = ConsoleByDeptExportFacade.transList(records, resWide);
+        }
+        String fileName = "抽查住院病历质量情况.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        if ("1".equals(exportQcresultVO.getRadioCheck())) {
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if ("2".equals(exportQcresultVO.getRadioCheck())) {
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
+
     /**
      * 病案首页不合格/合格数
      *

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

@@ -833,6 +833,14 @@ public class ConsoleByDeptFacade {
     }
 
 
+    public IPage<BehospitalInfoDeptDTO> levelStatisticsByDeptPage(BehospitalPageVO behospitalPageVO) {
+        behospitalPageSet(behospitalPageVO);
+        behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
+        IPage<BehospitalInfoDeptDTO> res = behospitalInfoFacade.getBaseMapper().levelStatisticsByDeptPage(behospitalPageVO);
+        return res;
+    }
+
+
     /**
      * 关键条目缺陷占比统计-科室
      *

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

@@ -230,6 +230,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
+
+    /**
+     * 各科室缺陷占比科室导出
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> levelStatisticsExportByDept(ExportQcresultVO exportQcresultVO);
+
     /**
      * 单条条目缺陷统计-首页
      *
@@ -321,6 +330,8 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDeptDTO> qcResultShortByDeptPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    IPage<BehospitalInfoDeptDTO> levelStatisticsByDeptPage(BehospitalPageVO behospitalPageVO);
+
     /**
      * 根据两个主键-批量修改
      *

+ 16 - 0
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -282,6 +282,22 @@ public class ConsoleByDeptController {
         return RespDTO.onSuc(consoleByDeptFacade.qcResultShortByDeptPage(qcResultShortPageVO));
     }
 
+    @ApiOperation(value = "各科室缺陷占比病历列表[by:zhoutg]",
+            notes = "name:姓名<br>" +
+                    "fileCode:档案号<br>" +
+                    "statisticsType: 统计维度 1-本月,2-本年<br>" +
+                    "behosDateStart:入院时间开始时间<br>" +
+                    "behosDateEnd:入院时间结束时间<br>" +
+                    "leaveHosDateStart:出院时间开始时间<br>" +
+                    "leaveHosDateEnd:出院时间结束时间<br>")
+    @PostMapping("/levelStatisticsByDeptPage")
+    @SysLogger("levelStatisticsByDeptPage")
+    public RespDTO<IPage<BehospitalInfoDeptDTO>> levelStatisticsByDeptPage(@RequestBody BehospitalPageVO behospitalPageVO) {
+        IPage<BehospitalInfoDeptDTO> data = consoleByDeptFacade.levelStatisticsByDeptPage(behospitalPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+
     /**
      * 关键条目缺陷占比统计-科室
      *

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

@@ -86,6 +86,13 @@ public class ConsoleByDeptExportController {
         consoleByDeptExportFacade.homePageOrLevelExportByDept(response, qcResultShortPageVO);
     }
 
+    @ApiOperation(value = "各科室缺陷占比科室导出[by:zhaops]",
+            notes = "")
+    @PostMapping("/levelStatisticsExportByDept")
+    @SysLogger("levelStatisticsExportByDept")
+    public void levelStatisticsExportByDept(HttpServletResponse response, @RequestBody ExportQcresultVO exportQcresultVO) {
+        consoleByDeptExportFacade.levelStatisticsExportByDept(response, exportQcresultVO);
+    }
 
 
     @ApiOperation(value = "缺陷详情内页-科室[by:cy]",

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

@@ -1135,6 +1135,141 @@
         </if>
     </select>
 
+    <!--各科室缺陷占比病历列表-->
+    <select id="levelStatisticsByDeptPage" resultType="com.diagbot.dto.BehospitalInfoDeptDTO">
+        SELECT * from (
+        SELECT
+        t.*,
+        t3.name as medoup_name,
+        CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
+        CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
+        g.check_type as ch_type,
+        h.check_type AS mr_type,
+        g.check_name as ch_name,
+        h.check_name as mr_name,
+        g.check_time as ch_time,
+        h.check_time AS mr_time
+        FROM
+        ( SELECT
+        a.*,
+        IFNULL(b.level, '未评分') AS `level`,
+        b.grade_type,
+        b.score_res,
+        e.score_res as score_bn,
+        b.gmt_create AS grade_time,
+        CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') )as age
+        FROM
+        med_behospital_info a
+        JOIN sys_user_dept d
+        ON a.hospital_id = d.hospital_id
+        AND a.beh_dept_id = d.dept_id
+        LEFT JOIN med_qcresult_info b
+        ON a.behospital_code = b.behospital_code
+        AND b.is_deleted = 'N'
+        LEFT JOIN med_qcresult_cases e
+        on  a.behospital_code = e.behospital_code
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        LEFT JOIN med_home_page c
+        ON a.behospital_code = c.behospital_code
+        AND c.is_deleted = 'N'
+        WHERE d.is_deleted = 'N'
+        AND d.user_id = #{userId}
+        ) t
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type in(0,2) ) g
+        ON t.behospital_code = g.behospital_code
+        AND t.hospital_id = g.hospital_id
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
+        ON t.behospital_code = h.behospital_code
+        AND t.hospital_id = h.hospital_id
+        LEFT JOIN bas_doctor_info t2 ON t.doctor_id = t2.doctor_id
+        AND t.hospital_id = t2.hospital_id
+        AND t2.is_deleted = 'N'
+        LEFT JOIN sys_medoup t3 ON t2.group_id = t3.`code`
+        AND t3.is_deleted = 'N'
+        where t.is_deleted = 'N'
+        <if test="medoupName != null and medoupName != ''">
+            AND t3.name = #{medoupName}
+        </if>
+        <if test="wardName != null and wardName != ''">
+            AND t.ward_name = #{wardName}
+        </if>
+        <if test="diagnose != null and diagnose != ''">
+            AND t.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and t.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            and t.beh_dept_Id = #{deptId}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            and t.doctor_name = #{doctorName}
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and t.doctor_id = #{doctorCode}
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            and t.doctor_id = #{doctorId}
+        </if>
+        <if test="name != null and name != ''">
+            and t.name like CONCAT('%',#{name},'%')
+        </if>
+        <if test="fileCode != null and fileCode != ''">
+            and t.file_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null">
+            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null">
+            <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
+        </if>
+        <if test="level != null and level != ''">
+            and t.level = #{level}
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and t.is_placefile = #{isPlacefile}
+        </if>
+        and t.qc_type_id != 0) p
+        where p.is_deleted="N"
+        <if test="checkStatus != null ">
+            and p.check_status = #{checkStatus}
+        </if>
+        <if test="mrStatus != null ">
+            AND p.mr_status = #{mrStatus}
+        </if>
+        <if test="chName != null and chName !=''">
+            AND p.ch_name like CONCAT('%',#{chName},'%')
+        </if>
+        <if test="mrName != null and mrName !=''">
+            AND p.mr_name like CONCAT('%',#{mrName},'%')
+        </if>
+        <if test="chTimeStart != null">
+            <![CDATA[ and p.ch_time >= #{chTimeStart}]]>
+        </if>
+        <if test="chTimeEnd != null">
+            <![CDATA[ and p.ch_time < #{chTimeEnd}]]>
+        </if>
+        <if test="mrTimeStart != null">
+            <![CDATA[ and p.mr_time >= #{mrTimeStart}]]>
+        </if>
+        <if test="mrTimeEnd != null">
+            <![CDATA[ and p.mr_time < #{mrTimeEnd}]]>
+        </if>
+    </select>
+
     <!--质控评分(个人)分页-->
     <select id="getPageByPerson" resultType="com.diagbot.dto.BehospitalInfoDTO">
         Select * from (
@@ -4694,6 +4829,263 @@
             <![CDATA[ and tu.mr_time < #{mrTimeEnd}]]>
         </if>
     </select>
+
+    <!-- 各科室缺陷占比科室导出-->
+    <select  id="levelStatisticsExportByDept" resultMap="ExportExcelMapByDept" parameterType="com.diagbot.vo.ExportQcresultVO">
+        SELECT * FROM (
+        SELECT tp.*,t3.name as medoup_name,CASE WHEN ISNULL(g.status) THEN 0 ELSE g.status END check_status,
+        CASE WHEN ISNULL(h.status) THEN 0 ELSE h.status END mr_status,
+        g.check_type AS ch_type,
+        h.check_type AS mr_type,
+        g.check_name AS ch_name,
+        h.check_name AS mr_name,
+        g.check_time AS ch_time,
+        h.check_time AS mr_time
+        FROM (
+        SELECT
+        t1.behDeptId,
+        t1.behDeptName,
+        t1.doctorName,
+        t1.doctor_id as doctorId,
+        t1.patName,
+        t1.wardName,
+        t1.behospitalCode,
+        t1.fileCode,
+        t1.hospitalId,
+        t1.behospitalDate,
+        t1.leaveHospitalDate,
+        t1.score,
+        t2.avgScore,
+        <if test="radioCheck !=null and radioCheck == 1">
+            c.msg AS msg,
+            t1.caseName,
+        </if>
+        e.score_res as scoreBn
+        FROM
+        (
+        SELECT
+        a.doctor_name AS doctorName,
+        a.doctor_id,
+        a.`name` AS patName,
+        a.ward_name as wardName,
+        a.file_code as fileCode,
+        a.behospital_code AS behospitalCode,
+        a.hospital_id AS hospital_id,
+        d.id,
+        a.behospital_date AS behospitalDate,
+        a.leave_hospital_date AS leaveHospitalDate,
+        b.score_res AS score,
+        <if test="radioCheck !=null and radioCheck == 1">
+            d.NAME AS caseName,
+        </if>
+        a.beh_dept_id AS behDeptId,
+        a.beh_dept_name AS behDeptName,
+        a.hospital_id AS hospitalId
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        qc_cases d,
+        sys_user_dept e
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.beh_dept_id = e.dept_id
+        <if test="diagnose != null and diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <if test="wardName != null and wardName != ''">
+            AND a.ward_name = #{wardName}
+        </if>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="userId != null ">
+            AND e.user_id = #{userId}
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null ">
+            <![CDATA[ and a.leave_hospital_date >= DATE(#{leaveHosDateStart})]]>
+        </if>
+        <if test="leaveHosDateEnd != null ">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND a.doctor_name = #{doctorName}
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND a.doctor_id = #{doctorCode}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
+        ) t1
+        LEFT JOIN med_qcresult_cases e
+        on  t1.behospitalCode = e.behospital_code
+        and t1.hospital_id = e.hospital_id
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243
+        LEFT JOIN med_qcresult_detail c
+        on  t1.behospitalCode = c.behospital_code
+        and t1.hospital_id = c.hospital_id
+        AND c.cases_id = t1.id
+        AND c.is_deleted = 'N',
+        (
+        SELECT
+        ROUND( AVG( b.score_res ), 2 ) AS avgScore,
+        a.beh_dept_id AS behDeptId,
+        a.beh_dept_name AS behDeptName,
+        a.doctor_id AS doctorId,
+        a.doctor_name AS doctorName
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        sys_user_dept c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.beh_dept_id = c.dept_id
+        <if test="diagnose != null and diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </if>
+        <if test="wardName != null and wardName != ''">
+            AND a.ward_name = #{wardName}
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="userId != null ">
+            AND c.user_id = #{userId}
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and a.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and a.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null ">
+            <![CDATA[ and a.leave_hospital_date >= DATE(#{leaveHosDateStart})]]>
+        </if>
+        <if test="leaveHosDateEnd != null ">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{leaveHosDateEnd})]]>
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            AND a.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="level != null and level != ''">
+            AND b.level = #{level}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND a.doctor_name = #{doctorName}
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and a.doctor_id = #{doctorCode}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and a.beh_dept_name = #{deptName}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
+        <if test="name != null and name != ''">
+            AND a.name like CONCAT('%',#{name},'%')
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.doctor_id,
+        a.doctor_name
+        ) t2
+        WHERE
+        t1.behDeptId = t2.behDeptId
+        AND t1.behDeptName = t2.behDeptName
+        AND t1.doctor_id = t2.doctorId
+        AND t1.doctorName = t2.doctorName
+        ORDER BY
+        t1.behDeptName,
+        t1.doctorName,
+        t1.patName,
+        <if test="radioCheck !=null and radioCheck == 1">
+            t1.caseName,
+        </if>
+        t1.behospitalCode
+        )tp
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
+        ON tp.behospitalCode = g.behospital_code
+        AND tp.hospitalId = g.hospital_id
+        LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N'AND check_type = 1 ) h
+        ON tp.behospitalCode = h.behospital_code
+        AND tp.hospitalId = h.hospital_id
+        LEFT JOIN bas_doctor_info t2 ON tp.doctorId = t2.doctor_id
+        AND tp.hospitalId = t2.hospital_id
+        AND t2.is_deleted = 'N'
+        LEFT JOIN sys_medoup t3 ON t2.group_id = t3.`code`
+        AND t3.is_deleted = 'N'
+        where 1=1
+        <if test="medoupName != null and medoupName != ''">
+            AND t3.name = #{medoupName}
+        </if>
+        ) tu
+        WHERE tu.behospitalCode IS NOT NULL
+        <if test="checkStatus != null ">
+            and tu.check_status = #{checkStatus}
+        </if>
+        <if test="mrStatus != null ">
+            AND tu.mr_status = #{mrStatus}
+        </if>
+        <if test="chName != null and chName !=''">
+            AND tu.ch_name like CONCAT('%',#{chName},'%')
+        </if>
+        <if test="mrName != null and mrName !=''">
+            AND tu.mr_name like CONCAT('%',#{mrName},'%')
+        </if>
+        <if test="chTimeStart != null">
+            <![CDATA[ and tu.ch_time >= #{chTimeStart}]]>
+        </if>
+        <if test="chTimeEnd != null">
+            <![CDATA[ and tu.ch_time < #{chTimeEnd}]]>
+        </if>
+        <if test="mrTimeStart != null">
+            <![CDATA[ and tu.mr_time >= #{mrTimeStart}]]>
+        </if>
+        <if test="mrTimeEnd != null">
+            <![CDATA[ and tu.mr_time < #{mrTimeEnd}]]>
+        </if>
+    </select>
+
     <!-- 个人质控评分导出到excel-->
     <select  id="exportQcresultByPerson" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
         SELECT * FROM (