瀏覽代碼

bug修改

chengyao 4 年之前
父節點
當前提交
9ac58debe9

文件差異過大導致無法顯示
+ 41 - 1
doc/031.20210326v2.0.3/qc_initv2.0.3.sql


+ 1 - 1
src/main/java/com/diagbot/entity/MedManagementInfo.java

@@ -30,7 +30,7 @@ public class MedManagementInfo implements Serializable {
     private Long hospitalId;
     private Long hospitalId;
 
 
     /**
     /**
-     * 0:门诊病案管理人员  1:住院病案管理人员 2:病案编码人员
+     *   1:住院病案管理人员 2:病案编码人员 3:门诊病案管理人员
      */
      */
     private String positionId;
     private String positionId;
 
 

+ 59 - 61
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -430,6 +430,14 @@ public class ConsoleFacade {
         Double bacterialCultureNum = medicalRecordIndicator.get("bacterialCultureNum");
         Double bacterialCultureNum = medicalRecordIndicator.get("bacterialCultureNum");
         Double antibiosisFeeNum = medicalRecordIndicator.get("antibiosisFeeNum");
         Double antibiosisFeeNum = medicalRecordIndicator.get("antibiosisFeeNum");
         Double chemotherapyMalignantTumorsNum = medicalRecordIndicator.get("chemotherapyMalignantTumorsNum");
         Double chemotherapyMalignantTumorsNum = medicalRecordIndicator.get("chemotherapyMalignantTumorsNum");
+        MedIndexFilterVO timeVo = new MedIndexFilterVO();
+        BeanUtils.copyProperties(filterVO,timeVo);
+        timeTrans(timeVo);
+        Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(timeVo);
+        //指标一、二、三
+        if (QualityContent.FOURSTR.contains(indexName)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = ManageIndexMethod(indexName, hashMapArrayList, baseIndex, timeVo);
+        }
         //入院记录24小时完成率
         //入院记录24小时完成率
         if(indexName.equals(QualityContent.RYJL_24H_WCL)||indexName.equals(QualityContent.QB)) {
         if(indexName.equals(QualityContent.RYJL_24H_WCL)||indexName.equals(QualityContent.QB)) {
             if (InHospitalRecords != null && startCount != null) {
             if (InHospitalRecords != null && startCount != null) {
@@ -520,48 +528,37 @@ public class ConsoleFacade {
                 hashMapArrayList.add(stringStringHashMap);
                 hashMapArrayList.add(stringStringHashMap);
             }
             }
         }
         }
-        /**
-         * =================================返回前台-标示线========================================
-         */
 
 
-        Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(filterVO);
-        //指标一、二、三
-        if (QualityContent.FOURSTR.contains(indexName)||indexName.equals(QualityContent.QB)) {
-            hashMapArrayList = ManageIndexMethod(indexName, hashMapArrayList, baseIndex, filterVO);
+        //指标十五 手术记录
+        if (indexName.equals(QualityContent.SS_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = operationMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
         }
         }
 
 
-        //指标二十七
-        if (indexName.equals(QualityContent.JJBLL)||indexName.equals(QualityContent.QB)) {
-            hashMapArrayList = firMethod(indexName,hashMapArrayList,baseIndex);
-        }
 
 
+        //指标十七  临床用血相关记录符合率
+        if (indexName.equals(QualityContent.LCYX_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
+            filterVO.setFlagStr("1");
+            hashMapArrayList = bloodMethod(hashMapArrayList,medicalRecordIndicator,triggeringRulesMap);
+        }
 
 
-        //指标十七 医师查房记录
+        //指标十 医师查房记录
         if (indexName.equals(QualityContent.YSCF_JL_WCL)||indexName.equals(QualityContent.QB)) {
         if (indexName.equals(QualityContent.YSCF_JL_WCL)||indexName.equals(QualityContent.QB)) {
             hashMapArrayList = WardRoundMethod(hashMapArrayList, baseIndex, triggeringRulesMap);
             hashMapArrayList = WardRoundMethod(hashMapArrayList, baseIndex, triggeringRulesMap);
         }
         }
 
 
-        //指标十 抢救记录
+        //指标十 抢救记录
         if (indexName.equals(QualityContent.HZQJ_JLJS_WCL)||indexName.equals(QualityContent.QB)) {
         if (indexName.equals(QualityContent.HZQJ_JLJS_WCL)||indexName.equals(QualityContent.QB)) {
             hashMapArrayList = rescueMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
             hashMapArrayList = rescueMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
         }
         }
 
 
-        //指标十 出院患者病历2日归档
+        //指标十 出院患者病历2日归档
         if (indexName.equals(QualityContent.CCHZ_2DAY_GDL)||indexName.equals(QualityContent.QB)) {
         if (indexName.equals(QualityContent.CCHZ_2DAY_GDL)||indexName.equals(QualityContent.QB)) {
             hashMapArrayList = getfileSecAmount(medicalRecordIndicator,hashMapArrayList, baseIndex);
             hashMapArrayList = getfileSecAmount(medicalRecordIndicator,hashMapArrayList, baseIndex);
         }
         }
 
 
-
-        //指标十四 手术记录
-        if (indexName.equals(QualityContent.SS_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
-            hashMapArrayList = operationMethod(medicalRecordIndicator,hashMapArrayList,triggeringRulesMap);
-        }
-
-
-        //指标十六  临床用血相关记录符合率
-        if (indexName.equals(QualityContent.LCYX_XGJL_WCL)||indexName.equals(QualityContent.QB)) {
-            filterVO.setFlagStr("1");
-            hashMapArrayList = bloodMethod(hashMapArrayList,medicalRecordIndicator,triggeringRulesMap);
+        //指标二十七
+        if (indexName.equals(QualityContent.JJBLL)||indexName.equals(QualityContent.QB)) {
+            hashMapArrayList = firMethod(indexName,hashMapArrayList,baseIndex);
         }
         }
         return hashMapArrayList;
         return hashMapArrayList;
     }
     }
@@ -651,7 +648,9 @@ public class ConsoleFacade {
         /**
         /**
          * ================================保存数据-标示线========================================
          * ================================保存数据-标示线========================================
          */
          */
-        Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(filterVO);
+        MedIndexFilterVO timeVo = new MedIndexFilterVO();
+        timeTrans(timeVo);
+        Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(timeVo);
         //指标二十七
         //指标二十七
 
 
         //指标十七 医师查房记录
         //指标十七 医师查房记录
@@ -2776,7 +2775,7 @@ public class ConsoleFacade {
         };
         };
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","患者抢救记录及时完成率");
         firMap.put("name","患者抢救记录及时完成率");
-        firMap.put("notCopiedStr",StringUtils.isEmpty(num)? null:(num+"%"));
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
         retList.add(firMap);
         return retList;
         return retList;
     };
     };
@@ -2790,7 +2789,7 @@ public class ConsoleFacade {
         };
         };
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","医师查房记录完成率");
         firMap.put("name","医师查房记录完成率");
-        firMap.put("notCopiedStr",StringUtils.isEmpty(num)? null:(num+"%"));
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
         retList.add(firMap);
         return retList;
         return retList;
     }
     }
@@ -2805,7 +2804,7 @@ public class ConsoleFacade {
         };
         };
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","手术相关记录完成率");
         firMap.put("name","手术相关记录完成率");
-        firMap.put("notCopiedStr",StringUtils.isEmpty(num)? null:(num+"%"));
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
         retList.add(firMap);
         return retList;
         return retList;
     }
     }
@@ -2822,7 +2821,7 @@ public class ConsoleFacade {
         }
         }
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","临床用血相关记录符合率");
         firMap.put("name","临床用血相关记录符合率");
-        firMap.put("notCopiedStr",StringUtils.isEmpty(num)? null:(num+"%"));
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
         retList.add(firMap);
         return retList;
         return retList;
     }
     }
@@ -2850,42 +2849,23 @@ public class ConsoleFacade {
         }
         }
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
         firMap.put("name","出院患者病历2日归档率");
         firMap.put("name","出院患者病历2日归档率");
-        firMap.put("notCopiedStr",StringUtils.isEmpty(num)? null:(num+"%"));
+        firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
         retList.add(firMap);
         retList.add(firMap);
         return retList;
         return retList;
     };
     };
 
 
 
 
-    private List<Map<String, String>> ManageIndexMethod(String indexName,List<Map<String, String>> retList, Map<String, Object> baseIndex,FilterVO filterVO){
-        FilterVO timeVo = new FilterVO();
-        BeanUtils.copyProperties(filterVO,timeVo);
+    private List<Map<String, String>> ManageIndexMethod(String indexName,List<Map<String, String>> retList, Map<String, Object> baseIndex, MedIndexFilterVO timeVo){
         QueryWrapper<MedManagementInfo> query = new QueryWrapper<>();
         QueryWrapper<MedManagementInfo> query = new QueryWrapper<>();
-        timeTrans(timeVo);
-        query.eq("hospital_id", filterVO.getHospitalId())
+        query.eq("hospital_id", timeVo.getHospitalId())
                 .eq("is_deleted", IsDeleteEnum.N)
                 .eq("is_deleted", IsDeleteEnum.N)
                 .isNotNull("start_date")
                 .isNotNull("start_date")
                 .isNotNull("end_date")
                 .isNotNull("end_date")
-                .ge("start_date",timeVo.getStartDate())
-                .le("end_date",timeVo.getEndDate())
+                .ge("start_date",timeVo.getLastStartDate())
+                .le("end_date",timeVo.getLastEndDate())
                 .select("position_id","work_person");
                 .select("position_id","work_person");
         List<MedManagementInfo> list = medManagementInfoService.list(query);
         List<MedManagementInfo> list = medManagementInfoService.list(query);
-        //单位时间同期门诊病案管理人员实际工作总月数
-        if(indexName.equals(QualityContent.MZBA_CYHZ)||indexName.equals(QualityContent.QB)) {
-            Optional<Double> firOp = list.stream().filter(obj -> obj.getPositionId().equals("3")).map(MedManagementInfo::getWorkPerson).reduce(Double::sum);
-            Double firMouth = 0d;
-            if(firOp.isPresent()){
-                firMouth = firOp.get();
-            }
-            String num3= null;
-            if(firMouth != 0d && firMouth != null  && StringUtils.isNotEmpty( baseIndex.get("secWorkNum").toString())){
-                //指标二
-                num3 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("secWorkNum").toString())/firMouth));
-            }
-            LinkedHashMap<String, String> thrMap = new LinkedHashMap<>();
-            thrMap.put("name","门诊病案管理人员月均负担门诊患者病历数");
-            thrMap.put("num",num3);
-            retList.add(thrMap);
-        }
+
 
 
         //单位时间同期住院病案管理人员实际工作总月数
         //单位时间同期住院病案管理人员实际工作总月数
         if(indexName.equals(QualityContent.ZYBA_CYHZ)||indexName.equals(QualityContent.QB)) {
         if(indexName.equals(QualityContent.ZYBA_CYHZ)||indexName.equals(QualityContent.QB)) {
@@ -2895,7 +2875,7 @@ public class ConsoleFacade {
                 secMouth = secOp.get();
                 secMouth = secOp.get();
             }
             }
             //指标一
             //指标一
-            String num1 = null;
+            String num1 = "0";
             if(secMouth != 0d && secMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
             if(secMouth != 0d && secMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
                 num1 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString()) / secMouth));
                 num1 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString()) / secMouth));
             }
             }
@@ -2905,6 +2885,24 @@ public class ConsoleFacade {
             retList.add(firMap);
             retList.add(firMap);
         }
         }
 
 
+        //单位时间同期门诊病案管理人员实际工作总月数
+        if(indexName.equals(QualityContent.MZBA_CYHZ)||indexName.equals(QualityContent.QB)) {
+            Optional<Double> firOp = list.stream().filter(obj -> obj.getPositionId().equals("3")).map(MedManagementInfo::getWorkPerson).reduce(Double::sum);
+            Double firMouth = 0d;
+            if(firOp.isPresent()){
+                firMouth = firOp.get();
+            }
+            String num3 = "0";
+            if(firMouth != 0d && firMouth != null  && StringUtils.isNotEmpty( baseIndex.get("secWorkNum").toString())){
+                //指标二
+                num3 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("secWorkNum").toString())/firMouth));
+            }
+            LinkedHashMap<String, String> thrMap = new LinkedHashMap<>();
+            thrMap.put("name","门诊病案管理人员月均负担门诊患者病历数");
+            thrMap.put("num",num3);
+            retList.add(thrMap);
+        }
+
         //单位时间同期病案编码管理人员实际工作总月数
         //单位时间同期病案编码管理人员实际工作总月数
         if(indexName.equals(QualityContent.BABM_CYHZ)||indexName.equals(QualityContent.QB)) {
         if(indexName.equals(QualityContent.BABM_CYHZ)||indexName.equals(QualityContent.QB)) {
             Optional<Double> thrOp = list.stream().filter(obj->obj.getPositionId().equals("2")).map(MedManagementInfo::getWorkPerson).reduce(Double::sum);
             Optional<Double> thrOp = list.stream().filter(obj->obj.getPositionId().equals("2")).map(MedManagementInfo::getWorkPerson).reduce(Double::sum);
@@ -2914,7 +2912,7 @@ public class ConsoleFacade {
             }
             }
 
 
             //指标三
             //指标三
-            String num2 = null;
+            String num2 = "0";
             if(thrMouth != 0d && thrMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
             if(thrMouth != 0d && thrMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
                 num2 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString())/thrMouth));
                 num2 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString())/thrMouth));
 
 
@@ -2944,7 +2942,7 @@ public class ConsoleFacade {
             }
             }
             LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
             LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
             fouMap.put("name","甲级病历率");
             fouMap.put("name","甲级病历率");
-            fouMap.put("notCopiedStr",StringUtils.isEmpty(num4)? null:(num4+"%"));
+            fouMap.put("notCopiedStr",StringUtils.isEmpty(num4) ? "0.00%":(num4+"%"));
             retList.add(fouMap);
             retList.add(fouMap);
         }
         }
         return retList;
         return retList;
@@ -3087,7 +3085,7 @@ public class ConsoleFacade {
         }
         }
     };
     };
 
 
-    private void timeTrans(FilterVO filterVO){
+    private void timeTrans( MedIndexFilterVO  filterVO){
         SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
         Calendar cal1 = Calendar.getInstance();
         Calendar cal1 = Calendar.getInstance();
         Calendar cal2 = Calendar.getInstance();
         Calendar cal2 = Calendar.getInstance();
@@ -3104,8 +3102,8 @@ public class ConsoleFacade {
         cal2.roll(Calendar.DATE, -1);
         cal2.roll(Calendar.DATE, -1);
         String startTime = myFormatter.format(cal1.getTime())+" 00:00:00";
         String startTime = myFormatter.format(cal1.getTime())+" 00:00:00";
         String endTime = myFormatter.format(cal2.getTime())+" 23:59:59";
         String endTime = myFormatter.format(cal2.getTime())+" 23:59:59";
-        filterVO.setStartDate(startTime);
-        filterVO.setEndDate(endTime);
+        filterVO.setLastStartDate(startTime);
+        filterVO.setLastEndDate(endTime);
     };
     };
 
 
 
 

+ 2 - 2
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -631,10 +631,10 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     /**
     /**
      * 病案管理指标获取基础数据
      * 病案管理指标获取基础数据
      *
      *
-     * @param filterVO
+     * @param timeVo
      * @return
      * @return
      */
      */
-    public Map<String,Object> getBaseIndex( FilterVO filterVO);
+    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
 
 
     /**
     /**
      * 病案管理规则质控参数查询
      * 病案管理规则质控参数查询

+ 2 - 2
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -87,10 +87,10 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     /**
     /**
      * 病案管理指标(内页)
      * 病案管理指标(内页)
      *
      *
-     * @param filterVO
+     * @param timeVo
      * @return
      * @return
      */
      */
-    public Map<String,Object> getBaseIndex( FilterVO filterVO);
+    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
 
 
     /**
     /**
      * 病案管理规则质控参数查询
      * 病案管理规则质控参数查询

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

@@ -1021,12 +1021,12 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     /**
     /**
      * 病案管理指标获取基础数据
      * 病案管理指标获取基础数据
      *
      *
-     * @param filterVO
+     * @param timeVo
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public Map<String,Object> getBaseIndex( FilterVO filterVO) {
-        return baseMapper.getBaseIndex(filterVO);
+    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo) {
+        return baseMapper.getBaseIndex(timeVo);
     }
     }
 
 
     /**
     /**

+ 80 - 0
src/main/java/com/diagbot/vo/MedIndexFilterVO.java

@@ -0,0 +1,80 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/15 16:04
+ */
+@Getter
+@Setter
+public class MedIndexFilterVO {
+    /**
+     * 统计维度 1-本月,2-本年
+     */
+    //@NotNull(message = "请输入本年或本月")
+    private Integer type;
+    /**
+     * 起始时间
+     */
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+    /**
+     * 结束时间
+     */
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+
+    /**
+     * 开始时间转化当月的第一天
+     */
+    @ApiModelProperty(hidden = true)
+    private String lastStartDate;
+    /**
+     * 结束时间转化当月的最后天
+     */
+    @ApiModelProperty(hidden = true)
+    private String lastEndDate;
+
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private String hospitalId;
+    /**
+     * 限制条数
+     */
+    @ApiModelProperty(hidden = true)
+    private Integer limitCount = 10;
+
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+
+    /**
+     * 科室分类
+     */
+    private String deptClass;
+    //科室名称
+    private String deptName;
+
+    private String level;
+    /**
+     * 是否归档(0:未归档,1:已归档)
+     */
+    private String isPlacefile = "1";
+
+    /**
+     * 辅助标识
+     */
+    private String flagStr = "0";
+
+    /**
+     * 指标名称
+     */
+    private String indexName = "";
+}

+ 2 - 2
src/main/java/com/diagbot/web/ConsoleController.java

@@ -183,8 +183,8 @@ public class ConsoleController {
      * @return
      * @return
      */
      */
     @ApiOperation(value = "病案指标数据存储[by:cy]",
     @ApiOperation(value = "病案指标数据存储[by:cy]",
-            notes = "startDate: 起始时间 <br>" +
-                    "endDate: 结束时间 <br>")
+            notes = "startDate: 起始时间-样例[2021-01-01] <br>" +
+                    "endDate: 结束时间-样例[2021-01-01]<br>")
     @PostMapping("/saveMedicaIndicator")
     @PostMapping("/saveMedicaIndicator")
     @SysLogger("saveMedicaIndicator")
     @SysLogger("saveMedicaIndicator")
     public RespDTO<Boolean> saveMedicaIndicator(@RequestBody @Valid FilterVO filterVO) {
     public RespDTO<Boolean> saveMedicaIndicator(@RequestBody @Valid FilterVO filterVO) {

+ 5 - 5
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -715,7 +715,7 @@
     </select>
     </select>
 
 
     <!--病案管理指标基础sql明细-->
     <!--病案管理指标基础sql明细-->
-    <select id="getBaseIndex"  parameterType="com.diagbot.vo.FilterVO" resultType="java.util.Map">
+    <select id="getBaseIndex"  parameterType="com.diagbot.vo.MedIndexFilterVO" resultType="java.util.Map">
         select
         select
         f1.firWorkNum,
         f1.firWorkNum,
         f2.secWorkNum,
         f2.secWorkNum,
@@ -734,10 +734,10 @@
         </if>
         </if>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="startDate != null and startDate != ''">
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{lastStartDate}]]>
         </if>
         </if>
         <if test="endDate != null and endDate != ''">
         <if test="endDate != null and endDate != ''">
-            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{lastEndDate}]]>
         </if>)f1,
         </if>)f1,
             ( SELECT count(*) AS secWorkNum
             ( SELECT count(*) AS secWorkNum
         FROM
         FROM
@@ -745,10 +745,10 @@
         WHERE
         WHERE
         a.is_deleted = 'N'
         a.is_deleted = 'N'
         <if test="startDate != null and startDate != ''">
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ AND a.visit_date >= #{startDate}]]>
+            <![CDATA[ AND a.visit_date >= #{lastStartDate}]]>
         </if>
         </if>
         <if test="endDate != null and endDate != ''">
         <if test="endDate != null and endDate != ''">
-            <![CDATA[ AND a.visit_date <= #{endDate}]]>
+            <![CDATA[ AND a.visit_date <= #{lastEndDate}]]>
         </if>
         </if>
         <if test="hospitalId != null and hospitalId != ''">
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
             AND a.hospital_id = #{hospitalId}