Quellcode durchsuchen

科室-控制台出院人数 全院-个人质控评分导出

chengyao vor 4 Jahren
Ursprung
Commit
006a854b82

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

@@ -176,6 +176,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/badLevelPage").permitAll()
                 .antMatchers("/console/export/badLevelPagePageExport").permitAll()
                 .antMatchers("/qc/medNurse/getMedNursePage").permitAll()
+                .antMatchers("/qc/behospitalInfo/exportQcresultByPerson").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -220,6 +220,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/badLevelPage", request)
                 || matchers("/console/export/badLevelPagePageExport", request)
                 || matchers("/qc/medNurse/getMedNursePage", request)
+                || matchers("/qc/behospitalInfo/exportQcresultByPerson", request)
                 || matchers("/", request)) {
             return true;
         }

+ 28 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1792,6 +1792,34 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return resWide;
     }
 
+    /**
+     * 个人质控结果导出
+     *
+     * @param response
+     * @param exportQcresultVO
+     */
+    public void exportQcresultByPerson(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        exportQcresultVO.setHospitalId(hospitalId);
+        exportQcresultVO.setUserId(Long.valueOf(userId));
+        //时间设置
+        exportQcresultVOSet(exportQcresultVO);
+        List<ExportExcelDTO> res = this.exportQcresultByPerson(exportQcresultVO);
+        List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
+        if("2".equals(exportQcresultVO.getRadioCheck())){
+            resWide = transList(res, resWide);
+        }
+        String fileName = "抽查住院病历质量情况.xls";
+        response.setContentType("text/html;charset=UTF-8");
+        if("1".equals(exportQcresultVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
+        }
+        if("2".equals(exportQcresultVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
+        }
+    }
+
     /**
      * 科室质控结果导出
      *

+ 59 - 29
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -25,12 +25,7 @@ import org.springframework.stereotype.Component;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 
@@ -71,35 +66,44 @@ public class ConsoleByDeptFacade {
         Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
                 ? new HashMap<>()
                 : EntityUtil.makeEntityMap(totleNumList, "name");
-        //新生儿人数
-        List<NumDTO> newBornNumList = behospitalInfoFacade.newBornCountByDept(filterVO);
-        Map<String, NumDTO> newBornMap = ListUtil.isEmpty(newBornNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(newBornNumList, "name");
-        //死亡人数
-        List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
-        Map<String, NumDTO> deathMap = ListUtil.isEmpty(deathNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(deathNumList, "name");
-        //手术人数
-        List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
-        Map<String, NumDTO> operationMap = ListUtil.isEmpty(operationNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(operationNumList, "name");
+        Map<String, NumDTO> deathMap = new HashMap<>();
+        Map<String, NumDTO> operationMap = new HashMap<>();
+        //终末--死亡人数/手术病人数
+        if("1".equals(filterVO.getIsPlacefile())){
+            //死亡人数
+            List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
+             deathMap = ListUtil.isEmpty(deathNumList)
+                    ? new HashMap<>()
+                    : EntityUtil.makeEntityMap(deathNumList, "name");
+            //手术人数
+            List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
+             operationMap = ListUtil.isEmpty(operationNumList)
+                    ? new HashMap<>()
+                    : EntityUtil.makeEntityMap(operationNumList, "name");
+        }
+
+//        //新生儿人数
+//        List<NumDTO> newBornNumList = behospitalInfoFacade.newBornCountByDept(filterVO);
+//        Map<String, NumDTO> newBornMap = ListUtil.isEmpty(newBornNumList)
+//                ? new HashMap<>()
+//                : EntityUtil.makeEntityMap(newBornNumList, "name");
+
         for (String deptName : deptMap.keySet()) {
             Map<String, Object> map = new LinkedHashMap<>();
             map.put("总人数", 0);
-            map.put("死亡人数", 0);
-            map.put("手术病人数", 0);
-
             if (totleMap.containsKey(deptName)) {
                 map.put("总人数", totleMap.get(deptName).getNum());
             }
-            if (deathMap.containsKey(deptName)) {
-                map.put("死亡人数", deathMap.get(deptName).getNum());
-            }
-            if (operationMap.containsKey(deptName)) {
-                map.put("手术病人数", operationMap.get(deptName).getNum());
+
+            if("1".equals(filterVO.getIsPlacefile())){
+                map.put("死亡人数", 0);
+                map.put("手术病人数", 0);
+                if(deathMap.containsKey(deptName)) {
+                    map.put("死亡人数", deathMap.get(deptName).getNum());
+                }
+                if(operationMap.containsKey(deptName)) {
+                    map.put("手术病人数", operationMap.get(deptName).getNum());
+                }
             }
             retMap.put(deptName, map);
         }
@@ -511,6 +515,32 @@ public class ConsoleByDeptFacade {
         return records;
     }
 
+    /**
+     * 单条条目缺陷统计(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsByDept(FilterVO filterVO) {
+        filterFacade.filterVOSet(filterVO);
+        List<NumDTO> records = behospitalInfoFacade.casesEntryStatisticsByDept(filterVO);
+
+        if (ListUtil.isNotEmpty(records)) {
+            NumDTO globleRecord = new NumDTO();
+            globleRecord.setName("全院");
+            Integer num = records.stream()
+                    .map(NumDTO::getNum)
+                    .reduce(0, Integer::sum);
+            globleRecord.setNum(num);
+            records.add(0, globleRecord);
+        }
+
+        if (ListUtil.isNotEmpty(records) && records.size() > filterVO.getLimitCount()) {
+            records = records.subList(0, 10);
+        }
+        return records;
+    }
+
     /**
      * 病案首页合格率占比(首页)
      *

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

@@ -155,6 +155,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<HomePageNumDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsByDept(FilterVO filterVO);
+
     /**
      * 科室缺陷占比-科室(分页)
      *
@@ -189,6 +197,14 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO);
+
     /**
      * 科室质控评分导出到excel
      *

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

@@ -147,6 +147,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<LevelStatisticsDTO> levelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsByDept(FilterVO filterVO);
+
+
     /**
      * 病案首页合格率占比(主任医生)
      *
@@ -189,6 +198,15 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> exportQcresult(ExportQcresultVO exportQcresultVO);
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO);
+
+
     /**
      * 科室质控评分导出到excel
      *

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

@@ -219,6 +219,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.homePageLevelStatisticsByDept(filterOrderByDeptVO);
     }
 
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<NumDTO> casesEntryStatisticsByDept(FilterVO filterVO) {
+        return baseMapper.casesEntryStatisticsByDept(filterVO);
+    }
+
     /**
      * 缺陷明细-科室(分页)
      *
@@ -267,6 +278,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.exportQcresult(exportQcresultVO);
     }
 
+    /**
+     * 个人质控评分导出到excel
+     *
+     * @param exportQcresultVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelDTO> exportQcresultByPerson(ExportQcresultVO exportQcresultVO) {
+        return baseMapper.exportQcresultByPerson(exportQcresultVO);
+    }
+
     /**
      * 科室质控评分导出到excel
      *
@@ -376,7 +398,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         IPage<QcResultShortDTO> qcResultShortDTOIPage = baseMapper.leaveHosMRPage(qcResultShortPageVO);
         return qcResultShortDTOIPage;
-
     }
 
     /**

+ 2 - 0
src/main/java/com/diagbot/vo/FilterOrderByDeptVO.java

@@ -12,4 +12,6 @@ import lombok.Setter;
 @Setter
 public class FilterOrderByDeptVO extends FilterOrderVO {
     private String deptName;
+    //医生姓名
+    private String name;
 }

+ 8 - 0
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -249,6 +249,14 @@ public class BehospitalInfoController {
         behospitalInfoFacade.exportQcresultByDept(response, exportQcresultVO);
     }
 
+    @ApiOperation(value = "【个人】质控结果导出[by:cy]",
+            notes = "")
+    @PostMapping("/exportQcresultByPerson")
+    @SysLogger("exportQcresultByPerson")
+    public void exportQcresultByPerson(HttpServletResponse response, @RequestBody ExportQcresultVO exportQcresultVO) {
+        behospitalInfoFacade.exportQcresultByPerson(response, exportQcresultVO);
+    }
+
     @ApiOperation(value = "【医疗组】质控结果导出[by:zhoutg]",
             notes = "")
     @PostMapping("/exportQcresultByGroup")

+ 19 - 8
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -2,13 +2,7 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.DeptBaseDTO;
-import com.diagbot.dto.DeptEntryNumDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.HomePageNumDTO;
-import com.diagbot.dto.LevelStatisticsDTO;
-import com.diagbot.dto.QcResultShortDTO;
-import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.*;
 import com.diagbot.facade.ConsoleByDeptFacade;
 import com.diagbot.vo.FilterOrderByDeptVO;
 import com.diagbot.vo.FilterPageByDeptVO;
@@ -100,6 +94,23 @@ public class ConsoleByDeptController {
     public RespDTO<List<HomePageNumDTO>> homePageLevelByDeptLimit(@RequestBody @Valid FilterOrderByDeptVO filterOrderByDeptVO) {
         return RespDTO.onSuc(consoleByDeptFacade.homePageLevelByDeptLimit(filterOrderByDeptVO));
     }
+
+    /**
+     * 单条条目缺陷统计(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "单条条目缺陷统计(科室)(首页)[by:cy]",
+            notes = "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/casesEntryStatisticsByDept")
+    @SysLogger("casesEntryStatisticsByDept")
+    public RespDTO<List<NumDTO>> casesEntryStatisticsByDept(@RequestBody @Valid FilterVO filterVO) {
+        return RespDTO.onSuc(consoleByDeptFacade.casesEntryStatisticsByDept(filterVO));
+    }
+
     //endregion -----------------------首页接口结束------------------------------
 
     @ApiOperation(value = "用户关联科室[by:zhaops]",
@@ -239,4 +250,4 @@ public class ConsoleByDeptController {
         return RespDTO.onSuc(consoleByDeptFacade.qcResultShortByDeptPage(qcResultShortPageVO));
     }
     //endregion -----------------------内页接口结束------------------------------
-}
+}

+ 293 - 7
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -988,17 +988,21 @@
         COUNT(*) AS num
         FROM
         med_behospital_info a,
-        med_home_page b,
-        sys_user_dept c
+        sys_user_dept c,
+        med_medical_record d,
+        med_medical_record_content e
         WHERE
         a.is_deleted = 'N'
-        AND b.is_deleted = 'N'
         AND c.is_deleted = 'N'
-        AND a.hospital_id = b.hospital_id
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
-        AND a.behospital_code = b.behospital_code
+        AND a.hospital_id = d.hospital_id
+        AND a.hospital_id = e.hospital_id
+        AND a.behospital_code = d.behospital_code
         AND a.beh_dept_id = c.dept_id
-        AND b.return_to_type = '死亡'
+        AND d.rec_id = e.rec_id
+        AND d.mode_id = '24'
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
         </if>
@@ -3686,7 +3690,239 @@
             <![CDATA[ and tu.mr_time < #{mrTimeEnd}]]>
         </if>
     </select>
-
+    <!-- 个人质控评分导出到excel-->
+    <select  id="exportQcresultByPerson" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
+        SELECT * FROM (
+        SELECT tp.*,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.behDoctorName,
+        t1.patName,
+        t1.behospitalCode,
+        t1.hospitalId,
+        t1.behospitalDate,
+        t1.leaveHospitalDate,
+        t1.score,
+        t2.avgScore,
+        <if test="radioCheck !=null and radioCheck == 1">
+            t1.msg,
+            t1.caseName,
+        </if>
+        e.score_res as scoreBn
+        FROM
+        (
+        SELECT
+        a.doctor_name AS behDoctorName,
+        a.beh_doctor_name,
+        a.director_doctor_name,
+        a.`name` AS patName,
+        a.behospital_code AS behospitalCode,
+        a.behospital_date AS behospitalDate,
+        a.leave_hospital_date AS leaveHospitalDate,
+        b.score_res AS score,
+        <if test="radioCheck !=null and radioCheck == 1">
+            c.msg AS msg,
+            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,
+        med_qcresult_detail c,
+        qc_cases d,
+        sys_user u,
+        sys_user_hospital uh
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND u.is_deleted = 'N'
+        AND uh.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 u.id = uh.user_id
+        AND a.hospital_id = uh.hospital_id
+        <if test="userId != null and userId != ''">
+            AND u.id = #{userId}
+        </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="diagnose != null and diagnose != ''">
+            AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
+        </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 >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null ">
+            <![CDATA[AND a.leave_hospital_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 like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </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.hospitalId = e.hospital_id
+        AND e.is_deleted = 'N'
+        and e.cases_id = 243,
+        (
+        SELECT
+        ROUND( AVG( b.score_res ), 2 ) AS avgScore,
+        a.beh_dept_id AS behDeptId,
+        a.beh_dept_name AS behDeptName
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        sys_user u,
+        sys_user_hospital uh
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND u.is_deleted = 'N'
+        AND uh.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND u.id = uh.user_id
+        AND a.hospital_id = uh.hospital_id
+        and (a.doctor_name = u.linkman
+        or  a.beh_doctor_name = u.linkman
+        or  a.director_doctor_name = u.linkman)
+        <if test="userId != null and userId != ''">
+            AND u.id = #{userId}
+        </if>
+        <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>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </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 >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null ">
+            <![CDATA[AND a.leave_hospital_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 like CONCAT('%',#{doctorName},'%')
+            OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
+            OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
+        </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>
+        ) t2
+        WHERE
+        t1.behDeptId = t2.behDeptId
+        AND t1.behDeptName = t2.behDeptName
+        ORDER BY
+        t1.behDeptName,
+        t1.behDoctorName,
+        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
+        ) 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="exportQcresultByGroup" resultMap="ExportExcelMap" parameterType="com.diagbot.vo.ExportQcresultVO">
         SELECT * FROM (
@@ -9038,6 +9274,56 @@
         a.beh_dept_name
     </select>
 
+    <!-- 单条条目缺陷统计-->
+    <select id="casesEntryStatisticsByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.NumDTO">
+        SELECT
+        a.beh_dept_id AS id,
+        a.beh_dept_name AS NAME,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail 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
+        AND a.qc_type_id != 0
+        and b.cases_entry_id=2658
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="userId!=null">
+            AND c.user_id = #{userId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+    </select>
+
     <!-- 病案首页改善率质控评分页(内页)-->
     <select id="hmImproveMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
         SELECT

+ 1 - 1
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1407,7 +1407,7 @@
             AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
         </if>
         <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
-            AND tt2.cases_name = #{filterPageByDeptVO.casesName}
+            AND tt2.cases_name like CONCAT('%', #{filterPageByDeptVO.casesName},'%')
         </if>
         ) t1,
         (