Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev/20200716_1.3.9' into test

zhaops 4 anni fa
parent
commit
06697dd605

+ 7 - 2
src/main/java/com/diagbot/dto/EntryStatisticsDTO.java

@@ -143,6 +143,11 @@ public class EntryStatisticsDTO {
      * 危急值记录病历数
      */
     private Integer crisisMRNum = 0;
+    /**
+     * 住院超过31日病人数
+     */
+    @Excel(name = "住院超过31日病人数", width = 15, orderNum = "12")
+    private Integer beHosGT31DaysMRNum;
     /**
      * 阶段小节未书写条目id
      */
@@ -154,7 +159,7 @@ public class EntryStatisticsDTO {
     /**
      * 阶段小节未书写数
      */
-    @Excel(name = "阶段小节未书写数", width = 15, orderNum = "12")
+    @Excel(name = "阶段小节未书写数", width = 15, orderNum = "13")
     private Integer stageSummaryNum = 0;
     /**
      * 阶段小节未书写率
@@ -163,7 +168,7 @@ public class EntryStatisticsDTO {
     /**
      * 阶段小节未书写率(百分比)
      */
-    @Excel(name = "阶段小节未书写率", width = 15, orderNum = "13")
+    @Excel(name = "阶段小节未书写率", width = 15, orderNum = "14")
     private String stageSummaryPercentStr = "0.00%";
     /**
      * 病人住院超过30天的病历数

+ 113 - 94
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -455,73 +455,17 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             }
         }
         OutputInfo outputInfo = response.getData();
-        //根据质控结果获取质控条目
-        QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
+        // 质控编码列表
         List<String> codeList = new ArrayList<>();
         // code和info的映射map
         Map<String, String> codeToInfoMap = new LinkedHashMap<>();
-        Map<String, Map<String, String>> codeMap = outputInfo.getResult();
-        for (String key : codeMap.keySet()) {
-            codeList.add(key);
-            Map<String, String> mapInfo = codeMap.get(key);
-            if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
-                codeToInfoMap.put(key, mapInfo.get("info"));
-            }
-        }
-        // 判断code是否为空
-        List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
-        if (ListUtil.isNotEmpty(codeList)) {
-            qcResultAlgQueryVO.setCodeList(codeList);
-            qcResultAlgQueryVO.setHospitalId(hospitalId);
-            qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
-        }
+        // 对codeList 和 codeToInfoMap进行赋值
+        setCodeData(outputInfo, codeList, codeToInfoMap);
 
-        // 对info赋值
-        for (QcResultAlgVO bean : qcResultAlgVOList) {
-            String info = codeToInfoMap.get(bean.getCode());
-            if (StringUtil.isNotBlank(info)) {
-                bean.setInfo(info);
-            }
-        }
-
-        // 评分
-        AlgorithmVO algorithmVO = new AlgorithmVO();
-        algorithmVO.setType(0);
-        algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
-        algorithmVO.setHospitalId(hospitalId);
-        algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
-        AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
-        //保存
-        Map<String, Object> pageMap = outputInfo.getPageData();
-        // 手动拼接数据【知情同意书】【谈话告知书】
-        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("behospital_code", analyzeVO.getBehospitalCode())
-                .eq("hospital_id", hospitalId)
-                .in("mode_id", Arrays.asList(53, 54, 16))
-                .orderByAsc("rec_date")
-        );
-        List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
-        Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
-        List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
-        if (recordMap.get(53L) != null) {
-            recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
-        }
-        if (recordMap.get(16L) != null) {
-            recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
-        }
-        // 医嘱信息
-        pageMap.put("医嘱信息", null);
-        // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
-        pageMap.put("知情同意书", recordDTOList);
-        pageMap.put("谈话告知书", recordMap.get(54L));
-
-        String pageData = JSON.toJSONString(pageMap);
-        // 获取菜单信息
-        List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
-        String menuData = JSON.toJSONString(qcModeDTOList);
-
-        Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
+        // 计算分值并保存结果至数据库
+        Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO);
+        AlgorithmDTO algorithmDTO = (AlgorithmDTO)resMap.get("algorithmDTO");
+        Date date = (Date)resMap.get("date");
 
         // 返回提示信息
         //        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
@@ -963,41 +907,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             }
         }
         OutputInfo outputInfo = response.getData();
-        //根据质控结果获取质控条目
-        // QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
+        // 质控编码列表
         List<String> codeList = new ArrayList<>();
         // code和info的映射map
         Map<String, String> codeToInfoMap = new LinkedHashMap<>();
-        Map<String, Map<String, String>> codeMap = outputInfo.getResult();
-        for (String key : codeMap.keySet()) {
-            codeList.add(key);
-            Map<String, String> mapInfo = codeMap.get(key);
-            if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
-                codeToInfoMap.put(key, mapInfo.get("info"));
-            }
-        }
-        // List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
-        // if (ListUtil.isNotEmpty(codeList)) {
-        //     qcResultAlgQueryVO.setCodeList(codeList);
-        //     qcResultAlgQueryVO.setHospitalId(hospitalId);
-        //     qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
-        // }
-        //
-        // // 评分
-        // AlgorithmVO algorithmVO = new AlgorithmVO();
-        // algorithmVO.setType(0);
-        // algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
-        // AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
-
-        //保存
-        // Map<String, Object> pageMap = outputInfo.getPageData();
-        // String pageData = JSON.toJSONString(pageMap);
-        // 获取菜单信息
-        // List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
-        // String menuData = JSON.toJSONString(qcModeDTOList);
+        // 对codeList 和 codeToInfoMap进行赋值
+        setCodeData(outputInfo, codeList, codeToInfoMap);
 
-        // 运行质控不保存评分结果信息
-        // Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
+        // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
+        if ("0".equals(analyzeRunVO.getIsPlacefile())) {
+            // 计算分值并保存结果至数据库
+            Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO);
+        }
 
         // 返回缺陷提示信息
         List<MsgDTO> msgDTOList = new ArrayList<>();
@@ -1157,4 +1078,102 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         response.setContentType("text/html;charset=UTF-8");
         ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
     }
+
+
+    /**
+     * 设置共用code数据
+     *
+     * @param outputInfo 质控出参数据
+     * @param codeList 质控编码列表
+     * @param codeToInfoMap 质控编码对应的info信息
+     */
+    public void setCodeData(OutputInfo outputInfo, List<String> codeList, Map<String, String> codeToInfoMap) {
+        Map<String, Map<String, String>> codeMap = outputInfo.getResult();
+        for (String key : codeMap.keySet()) {
+            codeList.add(key);
+            Map<String, String> mapInfo = codeMap.get(key);
+            if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
+                codeToInfoMap.put(key, mapInfo.get("info"));
+            }
+        }
+    }
+
+
+    /**
+     * 计算分值并保存结果至数据库
+     *
+     * @param outputInfo 质控出参数据
+     * @param codeList 质控编码列表
+     * @param codeToInfoMap 质控编码对应的info信息
+     * @param analyzeVO 入参
+     * @return
+     */
+    public Map<String, Object> calScoreAndSave(OutputInfo outputInfo, List<String> codeList,
+                                               Map<String, String> codeToInfoMap, AnalyzeVO analyzeVO) {
+        Long hospitalId = analyzeVO.getHospitalId();
+        List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
+        if (ListUtil.isNotEmpty(codeList)) {
+            // 根据质控结果获取质控条目
+            QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
+            qcResultAlgQueryVO.setCodeList(codeList);
+            qcResultAlgQueryVO.setHospitalId(hospitalId);
+            qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
+        }
+
+        // 对info赋值
+        for (QcResultAlgVO bean : qcResultAlgVOList) {
+            String info = codeToInfoMap.get(bean.getCode());
+            if (StringUtil.isNotBlank(info)) {
+                bean.setInfo(info);
+            }
+        }
+
+        // 评分
+        AlgorithmVO algorithmVO = new AlgorithmVO();
+        algorithmVO.setType(0);
+        algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
+        algorithmVO.setHospitalId(hospitalId);
+        algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
+        algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
+        AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
+
+        //保存
+        Map<String, Object> pageMap = outputInfo.getPageData();
+        // 手动拼接数据【知情同意书】【谈话告知书】
+        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .eq("hospital_id", hospitalId)
+                .in("mode_id", Arrays.asList(53, 54, 16))
+                .orderByAsc("rec_date")
+        );
+        List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
+        Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
+        List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
+        if (recordMap.get(53L) != null) {
+            recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
+        }
+        if (recordMap.get(16L) != null) {
+            recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
+        }
+        // 医嘱信息
+        pageMap.put("医嘱信息", null);
+        // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
+        pageMap.put("知情同意书", recordDTOList);
+        pageMap.put("谈话告知书", recordMap.get(54L));
+
+        String pageData = JSON.toJSONString(pageMap);
+        // 获取菜单信息
+        List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
+        String menuData = JSON.toJSONString(qcModeDTOList);
+
+        // 保存评分结果信息
+        Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
+
+        // 返回结果信息
+        Map<String, Object> map = new HashMap<>();
+        map.put("algorithmDTO", algorithmDTO);
+        map.put("date", date);
+        return map;
+    }
 }

+ 7 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -807,6 +807,13 @@ public class ConsoleFacade {
             record.setStageSummaryPercent(stageSummaryPercent);
             record.setStageSummaryPercentStr(stageSummaryPercentStr);
         }
+        //住院超过31日病人数
+        Integer beHosGT31DaysMRNum = records
+                .stream()
+                .map(EntryStatisticsDTO::getBeHosGT31DaysMRNum)
+                .reduce(0, Integer::sum);
+        record.setBeHosGT31DaysMRNum(beHosGT31DaysMRNum);
+
         return record;
     }
 

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

@@ -21,4 +21,6 @@ public class AnalyzeRunVO {
     // 模块id
     @NotNull(message = "modeId不能为空")
     private Long modeId;
+    // 归档字段
+    private String isPlacefile = "1";
 }

+ 2 - 2
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -92,8 +92,8 @@ public class BehospitalPageVO extends Page implements Serializable {
     /**
      * 是否归档(0:未归档,1:已归档)
      */
-    @ApiModelProperty(hidden = true)
-    private String isPlacefile;
+//    @ApiModelProperty(hidden = true)
+    private String isPlacefile = "1";
 
     private Integer checkStatus;
     private Integer mrStatus;

+ 4 - 0
src/main/java/com/diagbot/vo/EntryStatisticsVO.java

@@ -48,4 +48,8 @@ public class EntryStatisticsVO {
      * 科室名称
      */
     private String deptName;
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 5 - 0
src/main/java/com/diagbot/vo/ExportQcresultVO.java

@@ -35,4 +35,9 @@ public class ExportQcresultVO {
     private Date chTimeEnd;
     private Date mrTimeStart;
     private Date mrTimeEnd;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 5 - 0
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -66,4 +66,9 @@ public class FilterPageVO extends Page {
      * 规则类型(0:无,1:空项,2:错误)
      */
     private Integer ruleType;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 5 - 0
src/main/java/com/diagbot/vo/FilterUnModifyMRVO.java

@@ -57,4 +57,9 @@ public class FilterUnModifyMRVO {
      * 排序(降序)
      */
     private String desc;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 5 - 0
src/main/java/com/diagbot/vo/FilterVO.java

@@ -49,4 +49,9 @@ public class FilterVO {
     private String deptClass;
 
     private String level;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

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

@@ -112,4 +112,14 @@ public class QcResultShortPageVO extends Page {
      * 首页核查截止时间
      */
     private Date mrTimeEnd;
+
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+
+    /**
+     * 住院超过31日标志
+     */
+    private Integer beHosGT31Days;
 }

+ 4 - 0
src/main/java/com/diagbot/vo/ReBeHosPageVO.java

@@ -32,4 +32,8 @@ public class ReBeHosPageVO extends Page {
      * 病人姓名
      */
     private String name;
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 4 - 0
src/main/java/com/diagbot/vo/TaskVO.java

@@ -35,4 +35,8 @@ public class TaskVO {
     private boolean useCrfCache;
     // 指定编码列表
     private List<String> behospitalCodeList = new ArrayList<>();
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
 }

+ 6 - 4
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -89,11 +89,13 @@ public class BehospitalInfoController {
 
     @ApiOperation(value = "评分-运行质控[by:zhoutg]",
             notes = "    // 病历id\n" +
-                    "     String behospitalCode;\n" +
+                    "    String behospitalCode;\n" +
                     "    // 医院ID\n" +
-                    "     Long hospitalId;\n" +
+                    "    Long hospitalId;\n" +
                     "    // 模块id\n" +
-                    "     Long modeId;")
+                    "    Long modeId;\n" +
+                    "    // 归档字段\n" +
+                    "    String isPlacefile;")
     @PostMapping("/analyze_run")
     @SysLogger("analyze_run")
     @Transactional
@@ -221,7 +223,7 @@ public class BehospitalInfoController {
         return RespDTO.onSuc(data);
     }
 
-    @ApiOperation(value = "导出病历[by:gaodm]",
+    @ApiOperation(value = "导出病历例子[by:gaodm]",
             notes = "")
     @PostMapping("/exportExcel")
     @SysLogger("exportExcel")

+ 1 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -472,6 +472,7 @@ public class ConsoleController {
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
+                    "beHosGT31Days: 住院超过31日标志 <br>" +
                     "isReject: 单项否决 1-否决,0-非<br>" +
                     "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
                     "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +

+ 1 - 0
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -215,6 +215,7 @@ public class ConsoleExportController {
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
+                    "beHosGT31Days: 住院超过31日标志 <br>" +
                     "isReject: 单项否决 1-否决,0-非<br>" +
                     "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
                     "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +

+ 294 - 85
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -108,8 +108,7 @@
         <if test="isPlacefile != null and isPlacefile != ''">
             and t.is_placefile = #{isPlacefile}
         </if>
-        and t.qc_type_id != 0
-        and t.is_placefile = 1) p
+        and t.qc_type_id != 0) p
         where p.is_deleted="N"
         <if test="checkStatus != null ">
         and p.check_status = #{checkStatus}
@@ -192,7 +191,9 @@
         AND a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <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}
@@ -226,7 +227,9 @@
         AND a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <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}
@@ -244,7 +247,9 @@
         select * from med_behospital_info a
         where a.is_deleted = 'N'
         and a.qc_type_id != 0
-        and a.is_placefile = 1
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="filterFlag != null and filterFlag == 0">
             and
             not EXISTS (
@@ -278,7 +283,9 @@
             select * from med_behospital_info b
             where b.is_deleted = 'N'
             and b.qc_type_id != 0
-            and b.is_placefile = 1
+            <if test="isPlacefile != null and isPlacefile != ''">
+                and b.is_placefile = #{isPlacefile}
+            </if>
             <if test="startLeaveDate != null">
                 <![CDATA[ and b.leave_hospital_date >= #{startLeaveDate}]]>
             </if>
@@ -379,8 +386,7 @@
         <if test="isPlacefile != null and isPlacefile != ''">
             and t.is_placefile = #{isPlacefile}
         </if>
-        and t.qc_type_id != 0
-        and t.is_placefile = 1) p
+        and t.qc_type_id != 0) p
         where p.is_deleted="N"
         <if test="checkStatus != null ">
             and p.check_status = #{checkStatus}
@@ -491,8 +497,7 @@
         <if test="isPlacefile != null and isPlacefile != ''">
             and t.is_placefile = #{isPlacefile}
         </if>
-        and t.qc_type_id != 0
-        and t.is_placefile = 1) p
+        and t.qc_type_id != 0) p
         where p.is_deleted="N"
         <if test="checkStatus != null ">
             and p.check_status = #{checkStatus}
@@ -602,8 +607,7 @@
         <if test="isPlacefile != null and isPlacefile != ''">
             and t.is_placefile = #{isPlacefile}
         </if>
-        and t.qc_type_id != 0
-        and t.is_placefile = 1) p
+        and t.qc_type_id != 0) p
         where p.is_deleted="N"
         <if test="checkStatus != null ">
             and p.check_status = #{checkStatus}
@@ -639,7 +643,9 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -663,7 +669,9 @@
         AND b.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND (
         ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' AND b.newborn_day != '-' )
         OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' AND b.newborn_month != '-' )
@@ -693,7 +701,9 @@
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
         AND b.return_to_type = '死亡'
-        AND a.is_placefile = '1'
+        <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}
@@ -721,7 +731,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
         AND c.mode_id = d.id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND d.`name` = '手术记录'
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
@@ -750,7 +762,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.beh_dept_id = c.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="userId!=null">
             AND c.user_id = #{userId}
         </if>
@@ -791,7 +805,9 @@
         ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' AND b.newborn_day != '-' )
         OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' AND b.newborn_month != '-' )
         )
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="userId!=null">
             AND c.user_id = #{userId}
@@ -830,7 +846,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.beh_dept_id = c.dept_id
         AND b.return_to_type = '死亡'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="userId!=null">
             AND c.user_id = #{userId}
@@ -872,7 +890,9 @@
         AND a.beh_dept_id = c.dept_id
         AND d.mode_id = e.id
         AND e.`name` = '手术记录'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="userId!=null">
             AND c.user_id = #{userId}
@@ -919,7 +939,9 @@
         AND a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -954,7 +976,9 @@
         AND a.is_deleted = 'N'
         AND c.is_deleted = 'N'
         AND d.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1004,7 +1028,9 @@
         AND d.is_deleted = 'N'
         AND e.is_deleted = 'N'
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByDeptVO.userId!=null">
             AND e.user_id = #{filterPageByDeptVO.userId}
@@ -1050,7 +1076,9 @@
         AND d.is_deleted = 'N'
         AND e.is_deleted = 'N'
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByDeptVO.userId!=null">
             AND e.user_id = #{filterPageByDeptVO.userId}
@@ -1121,7 +1149,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1163,7 +1193,9 @@
         AND a.behospital_code = d.behospital_code
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1302,7 +1334,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = d.dept_id
         AND d.parent_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -1359,7 +1393,9 @@
         AND d.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
         AND f.parent_dept_id = g.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -1499,8 +1535,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = d.dept_id
-        AND a.is_placefile = '1'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1565,8 +1602,9 @@
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1693,7 +1731,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = 243
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1737,7 +1777,9 @@
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
         AND d.cases_id = 243
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -1795,7 +1837,9 @@
         AND b.cases_id = c.cases_id
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND d.cases_id = 243
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
@@ -1930,7 +1974,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -1981,7 +2027,9 @@
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -2104,7 +2152,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = f.dept_id
         AND c.cases_id = 243
-        AND a.is_placefile = '1'
+        <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}
@@ -2162,7 +2212,9 @@
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
         AND c.cases_id = 243
-        AND a.is_placefile = '1'
+        <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}
@@ -2235,7 +2287,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND d.cases_id = 243
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
@@ -2449,7 +2503,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = d.id
-        AND a.is_placefile = '1'
+        <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}
@@ -2496,7 +2552,9 @@
         AND b.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -2637,7 +2695,9 @@
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = d.id
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -2691,7 +2751,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = b.behospital_code
         AND a.beh_dept_id = c.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -2831,7 +2893,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = d.id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.doctor_id in
             (SELECT doctor_id FROM `bas_doctor_info`
             where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
@@ -2898,7 +2962,9 @@
         AND b.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -3071,7 +3137,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -3127,6 +3195,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.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'
@@ -3273,7 +3347,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.userId != null and qcResultShortPageVO.userId != ''">
             AND e.user_id = #{qcResultShortPageVO.userId}
         </if>
@@ -3457,7 +3533,8 @@
         stageSummaryMRNum,
         stageSummaryNum,
         ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ), 4 ) AS stageSummaryPercent,
-        CONCAT( ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ) * 100, 2 ), '%' ) AS stageSummaryPercentStr
+        CONCAT( ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ) * 100, 2 ), '%' ) AS stageSummaryPercentStr,
+        beHosGT31DaysMRNum
         FROM
         (
         SELECT
@@ -3472,7 +3549,8 @@
         sum( tt.crisisNum ) AS crisisNum,
         sum( tt.crisisMRNum ) AS crisisMRNum,
         sum( tt.stageSummaryNum ) AS stageSummaryNum,
-        sum( tt.stageSummaryMRNum ) AS stageSummaryMRNum
+        sum( tt.stageSummaryMRNum ) AS stageSummaryMRNum,
+        sum( tt.beHosGT31DaysMRNum ) AS beHosGT31DaysMRNum
         FROM
         (
         (
@@ -3488,7 +3566,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3505,7 +3584,9 @@
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
         AND b.mode_id = 30
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3540,7 +3621,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3560,7 +3642,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = b.behospital_code
         AND b.home_page_id = c.home_page_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3595,7 +3679,8 @@
         sum( d.cases_entry_id = 2419 ) AS crisisNum,
         count( DISTINCT c.behospital_code ) AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3611,7 +3696,9 @@
         AND b.is_deleted = 'N'
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3646,7 +3733,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         sum( c.cases_entry_id = 2495 ) AS stageSummaryNum,
-        count( DISTINCT b.behospital_code ) AS stageSummaryMRNum
+        count( DISTINCT b.behospital_code ) AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3662,7 +3750,9 @@
         DAY,
         DATE( behospital_date ),
         DATE( leave_hospital_date ))> 30
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3683,6 +3773,57 @@
         GROUP BY
         b.beh_dept_id,
         b.beh_dept_name
+        ) UNION
+        (
+        SELECT
+        b.beh_dept_id AS deptId,
+        b.beh_dept_name AS deptName,
+        0 AS consultationNum,
+        0 AS consultationMRNum,
+        0 AS operationNameNum,
+        0 AS operationTimeNum,
+        0 AS operation15MinuteNum,
+        0 AS operationMRNum,
+        0 AS crisisNum,
+        0 AS crisisMRNum,
+        0 AS stageSummaryNum,
+        0 AS stageSummaryMRNum,
+        count(*) AS beHosGT31DaysMRNum
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.beh_dept_name,
+        a.beh_dept_id
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        AND TIMESTAMPDIFF(
+        DAY,
+        DATE( behospital_date ),
+        DATE( leave_hospital_date ))> 31
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+        </if>
+        <if test="endDate != null">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        ) b
+        GROUP BY
+        b.beh_dept_id,
+        b.beh_dept_name
         )
         ) tt
         GROUP BY
@@ -3716,6 +3857,7 @@
                 <when test='asc=="stageSummaryPercent"'>stageSummaryPercent asc</when>
                 <when test='asc=="stageSummaryPercentStr"'>stageSummaryPercent asc</when>
                 <when test='asc=="stageSummaryMRNum"'>stageSummaryMRNum asc</when>
+                <when test='asc=="beHosGT31DaysMRNum"'>beHosGT31DaysMRNum asc</when>
                 <otherwise>deptName asc</otherwise>
             </choose>
         </if>
@@ -3746,6 +3888,7 @@
                 <when test='desc=="stageSummaryPercent"'>stageSummaryPercent desc</when>
                 <when test='desc=="stageSummaryPercentStr"'>stageSummaryPercent desc</when>
                 <when test='desc=="stageSummaryMRNum"'>stageSummaryMRNum desc</when>
+                <when test='desc=="beHosGT31DaysMRNum"'>beHosGT31DaysMRNum desc</when>
                 <otherwise>deptName desc</otherwise>
             </choose>
         </if>
@@ -3764,7 +3907,9 @@
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
         AND b.leave_hospital_type = '非医嘱离院'
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -3819,7 +3964,9 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        AND a.is_placefile = 1
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         AND IFNULL( a.diagnose, '' )!= ''
         AND IFNULL( a.file_code, '' )!= ''
@@ -3841,7 +3988,9 @@
         med_behospital_info tt2
         WHERE
         tt2.is_deleted = 'N'
-        AND tt2.is_placefile = 1
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and tt2.is_placefile = #{isPlacefile}
+        </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
         AND tt1.diagnose = tt2.diagnose
@@ -3886,7 +4035,9 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        AND a.is_placefile = 1
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         AND IFNULL( a.diagnose, '' )!= ''
         AND IFNULL( a.file_code, '' )!= ''
@@ -3908,7 +4059,9 @@
         med_behospital_info tt2
         WHERE
         tt2.is_deleted = 'N'
-        AND tt2.is_placefile = 1
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and tt2.is_placefile = #{isPlacefile}
+        </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
         AND tt1.diagnose = tt2.diagnose
@@ -3959,7 +4112,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = 243
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -4006,7 +4161,9 @@
         AND b.cases_id = c.cases_id
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND d.cases_id = 243
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
@@ -4115,7 +4272,9 @@
         WHERE
         a.is_deleted = 'N'
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -4281,7 +4440,9 @@
         AND m3.gmt_create = m4.gmt_create
         AND m3.have_home_page = 1
         AND m4.cases_id = 243
-        AND m1.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and m1.is_placefile = #{isPlacefile}
+        </if>
         AND m1.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND m1.hospital_id = #{hospitalId}
@@ -4313,7 +4474,9 @@
         AND a.behospital_code = e.behospital_code
         AND d.cases_id = 243
         AND d.score_res > e.score_res
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -4340,7 +4503,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
         AND a.qc_type_id != 0
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -4390,7 +4555,9 @@
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
         AND a.qc_type_id != 0
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -4425,7 +4592,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
         AND a.qc_type_id != 0
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND ifnull(c.`status`,0) = 1
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -4461,7 +4630,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
         AND a.qc_type_id != 0
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -4513,7 +4684,9 @@
         AND m3.gmt_create = m4.gmt_create
         AND m3.have_home_page = 1
         AND m4.cases_id = 243
-        AND m1.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and m1.is_placefile = #{isPlacefile}
+        </if>
         AND m1.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND m1.hospital_id = #{hospitalId}
@@ -4738,7 +4911,9 @@
         WHERE
         a.is_deleted = 'N'
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -4949,7 +5124,9 @@
         WHERE
         a.is_deleted = 'N'
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -5209,7 +5386,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -5265,6 +5444,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.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'
@@ -5436,7 +5621,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -5492,6 +5679,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.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'
@@ -5596,7 +5789,9 @@
         AND a.behospital_code = c.behospital_code
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -5711,7 +5906,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -5924,7 +6121,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -6108,7 +6307,9 @@
         AND c.cases_id = d.cases_id
         AND c.cases_entry_id = d.id
         AND a.qc_type_id != 0
-        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+            and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
+        </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
@@ -6302,7 +6503,9 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        AND a.is_placefile = 1
+        <if test="reBeHosPageVO.isPlacefile != null and reBeHosPageVO.isPlacefile != ''">
+            and a.is_placefile = #{reBeHosPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         AND IFNULL( a.diagnose, '' )!= ''
         AND IFNULL( a.file_code, '' )!= ''
@@ -6330,7 +6533,9 @@
         med_behospital_info tt2
         WHERE
         tt2.is_deleted = 'N'
-        AND tt2.is_placefile = 1
+        <if test="reBeHosPageVO.isPlacefile != null and reBeHosPageVO.isPlacefile != ''">
+            and tt2.is_placefile = #{reBeHosPageVO.isPlacefile}
+        </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
         AND tt1.diagnose = tt2.diagnose
@@ -6391,7 +6596,9 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
-        AND a.is_placefile = 1
+        <if test="reBeHosPageVO.isPlacefile != null and reBeHosPageVO.isPlacefile != ''">
+            and a.is_placefile = #{reBeHosPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         AND IFNULL( a.diagnose, '' )!= ''
         AND IFNULL( a.file_code, '' )!= ''
@@ -6419,7 +6626,9 @@
         med_behospital_info tt2
         WHERE
         tt2.is_deleted = 'N'
-        AND tt2.is_placefile = 1
+        <if test="reBeHosPageVO.isPlacefile != null and reBeHosPageVO.isPlacefile != ''">
+            and tt2.is_placefile = #{reBeHosPageVO.isPlacefile}
+        </if>
         AND tt2.qc_type_id != 0
         AND tt1.file_code = tt2.file_code
         AND tt1.diagnose = tt2.diagnose

+ 24 - 8
src/main/resources/mapper/HomePageMapper.xml

@@ -168,7 +168,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <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}
@@ -200,7 +202,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <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}
@@ -244,7 +248,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
@@ -278,7 +284,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
@@ -312,7 +320,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
@@ -369,7 +379,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
@@ -403,7 +415,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}
@@ -437,7 +451,9 @@
         AND a.behospital_code = b.behospital_code
         AND a.is_deleted = 'N'
         AND b.is_deleted = 'N'
-        AND a.is_placefile = '1'
+        <if test="filterPageByAverageVO.isPlacefile != null and filterPageByAverageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByAverageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageByAverageVO.hospitalId != null and filterPageByAverageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByAverageVO.hospitalId}

+ 87 - 29
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -61,7 +61,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -100,7 +102,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -135,7 +139,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -188,7 +194,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -218,7 +226,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -288,7 +298,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -318,7 +330,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -381,7 +395,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -427,7 +443,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -485,7 +503,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND d.is_reject = 1
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
@@ -522,7 +542,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -554,7 +576,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <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}
@@ -595,7 +619,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = d.dept_id
         AND d.parent_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <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}
@@ -632,7 +658,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = d.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="userId!=null">
             AND d.user_id = #{userId}
@@ -691,7 +719,9 @@
         AND a.behospital_code = c.behospital_code
         AND c.cases_entry_id = d.id
         AND a.beh_dept_id = e.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="userId!=null">
             AND e.user_id = #{userId}
@@ -757,7 +787,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="userId!=null">
             AND f.user_id = #{userId}
@@ -798,7 +830,9 @@
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="userId!=null">
             AND f.user_id = #{userId}
@@ -881,7 +915,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
@@ -941,7 +977,9 @@
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = f.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
@@ -1011,7 +1049,9 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = b.behospital_code
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1047,7 +1087,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1129,7 +1171,9 @@
         AND d.is_deleted = 'N'
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1180,7 +1224,9 @@
         AND e.is_deleted = 'N'
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         AND e.cases_id = d.cases_id
         AND e.id = d.cases_entry_id
         AND a.qc_type_id != 0
@@ -1230,7 +1276,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1272,7 +1320,9 @@
         AND c.is_deleted = 'N'
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = c.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageVO.hospitalId}
@@ -1349,7 +1399,9 @@
         AND a.behospital_code = c.behospital_code
         AND a.behospital_code = d.behospital_code
         AND a.beh_dept_id = g.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND g.user_id = #{filterPageByDeptVO.userId}
@@ -1396,7 +1448,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.behospital_code = c.behospital_code
         AND a.beh_dept_id = d.dept_id
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND d.user_id = #{filterPageByDeptVO.userId}
@@ -1492,7 +1546,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND a.beh_dept_id = f.dept_id
         AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
@@ -1560,7 +1616,9 @@
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = d.behospital_code
-        AND a.is_placefile = '1'
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
         AND d.cases_id = e.cases_id
         AND d.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id