Forráskód Böngészése

统计时间段兼容性优化

zhaops 4 éve
szülő
commit
51d1e41e8c

+ 10 - 32
src/main/java/com/diagbot/facade/FilterFacade.java

@@ -10,13 +10,10 @@ import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterQcCheckVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.QcResultShortPageVO;
 import org.springframework.stereotype.Component;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 
 /**
@@ -119,7 +116,6 @@ public class FilterFacade {
         if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
             filterVO.setLimitCount(10);
         }
-
         if (StringUtil.isBlank(filterVO.getStartDate())) {
             String startDate = getStartDateStr(filterVO.getType(), null);
             filterVO.setStartDate(startDate);
@@ -127,7 +123,7 @@ public class FilterFacade {
         if (StringUtil.isBlank(filterVO.getEndDate())) {
             String endDate = getEndDateStr(filterVO.getType(), null);
             filterVO.setEndDate(endDate);
-        } else {
+        } /*else {
             try {
                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                 Date date = dateFormat.parse(filterVO.getEndDate());
@@ -136,7 +132,7 @@ public class FilterFacade {
             } catch (ParseException e) {
 
             }
-        }
+        }*/
     }
 
     /**
@@ -149,16 +145,14 @@ public class FilterFacade {
         String userId = SysUserUtils.getCurrentPrincipleID();
         filterPageVO.setHospitalId(hospitalId);
         filterPageVO.setUserId(Long.valueOf(userId));
-        String startDate = "";
-        String endDate = "";
         if (StringUtil.isBlank(filterPageVO.getStartDate())) {
-            startDate = getStartDateStr(filterPageVO.getType(), null);
+            String startDate = getStartDateStr(filterPageVO.getType(), null);
             filterPageVO.setStartDate(startDate);
         }
         if (StringUtil.isBlank(filterPageVO.getEndDate())) {
-            endDate = getEndDateStr(filterPageVO.getType(), null);
+            String endDate = getEndDateStr(filterPageVO.getType(), null);
             filterPageVO.setEndDate(endDate);
-        } else {
+        }/* else {
             try {
                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                 Date date = dateFormat.parse(filterPageVO.getEndDate());
@@ -167,7 +161,7 @@ public class FilterFacade {
             } catch (ParseException e) {
 
             }
-        }
+        }*/
     }
 
 
@@ -254,8 +248,8 @@ public class FilterFacade {
         String userId = SysUserUtils.getCurrentPrincipleID();
         qcResultShortPageVO.setHospitalId(hospitalId);
         qcResultShortPageVO.setUserId(Long.valueOf(userId));
-        long interval = qcResultShortPageVO.getEndDate().getTime() + 1000;
-        qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));
+        /*long interval = qcResultShortPageVO.getEndDate().getTime() + 1000;
+        qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));*/
     }
 
     /**
@@ -268,23 +262,7 @@ public class FilterFacade {
         String userId = SysUserUtils.getCurrentPrincipleID();
         entryStatisticsVO.setHospitalId(hospitalId);
         entryStatisticsVO.setUserId(Long.valueOf(userId));
-        long interval = entryStatisticsVO.getEndDate().getTime() + 1000;
-        entryStatisticsVO.setEndDate(new Date(Long.valueOf(interval)));
-    }
-
-    /**
-     * 质控核查统计入参
-     *
-     * @param filterQcCheckVO
-     */
-    public void filterQcCheckVOSet(FilterQcCheckVO filterQcCheckVO) {
-        FilterVO filterVO = new FilterVO();
-        BeanUtil.copyProperties(filterQcCheckVO, filterVO);
-        filterVOSet(filterVO);
-        filterQcCheckVO.setHospitalId(filterVO.getHospitalId());
-        filterQcCheckVO.setUserId(filterVO.getUserId());
-        filterQcCheckVO.setStartDate(filterVO.getStartDate());
-        filterQcCheckVO.setEndDate(filterVO.getEndDate());
-        filterQcCheckVO.setLimitCount(filterVO.getLimitCount());
+        /*long interval = entryStatisticsVO.getEndDate().getTime() + 1000;
+        entryStatisticsVO.setEndDate(new Date(Long.valueOf(interval)));*/
     }
 }

+ 3 - 1
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
 /**
@@ -18,15 +19,16 @@ public class FilterPageVO extends Page {
     /**
      * 统计维度 1-本月,2-本年
      */
-    @NotNull(message = "请输入本年或本月")
     private Integer type;
     /**
      * 起始时间
      */
+    @NotBlank(message = "请输入起始时间")
     private String startDate;
     /**
      * 结束时间
      */
+    @NotBlank(message = "请输入结束时间")
     private String endDate;
     /**
      * 医院id

+ 0 - 17
src/main/java/com/diagbot/vo/FilterQcCheckVO.java

@@ -1,17 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2020/7/7 11:40
- */
-@Getter
-@Setter
-public class FilterQcCheckVO extends FilterVO {
-    private String deptName;
-    private String asc;
-    private String desc;
-}

+ 4 - 2
src/main/java/com/diagbot/vo/FilterVO.java

@@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
-import javax.validation.constraints.NotNull;
+import javax.validation.constraints.NotBlank;
 
 /**
  * @Description:
@@ -17,15 +17,17 @@ public class FilterVO {
     /**
      * 统计维度 1-本月,2-本年
      */
-    @NotNull(message = "请输入本年或本月")
+    //@NotNull(message = "请输入本年或本月")
     private Integer type;
     /**
      * 起始时间
      */
+    @NotBlank(message = "请输入起始时间")
     private String startDate;
     /**
      * 结束时间
      */
+    @NotBlank(message = "请输入结束时间")
     private String endDate;
     /**
      * 医院id

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

@@ -20,7 +20,6 @@ import com.diagbot.vo.EntryStatisticsVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageVO;
-import com.diagbot.vo.FilterQcCheckVO;
 import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.QcResultShortPageVO;
 import io.swagger.annotations.Api;

+ 132 - 134
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -166,10 +166,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -200,10 +200,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -513,10 +513,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -533,7 +533,6 @@
         AND a.hospital_id = b.hospital_id
         AND a.behospital_code = b.behospital_code
         AND a.is_placefile = '1'
-        -- AND ( b.age IS NULL OR b.age = '-' OR b.age = '' )
         AND (
         ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' )
         OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' )
@@ -543,10 +542,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -569,10 +568,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -598,10 +597,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -628,10 +627,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -657,7 +656,6 @@
         AND a.hospital_id = c.hospital_id
         AND a.behospital_code = b.behospital_code
         AND a.beh_dept_id = c.dept_id
-        -- AND ( b.age IS NULL OR b.age = '-' OR b.age = '' )
         AND (
         ( IFNULL( b.newborn_day, '' ) != '' AND b.newborn_day != '0' )
         OR ( IFNULL( b.newborn_month, '' )!= '' AND b.newborn_month != '0' )
@@ -671,10 +669,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -710,10 +708,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -752,10 +750,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -796,10 +794,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.name != null and filterPageVO.name != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.name},'%')
@@ -831,10 +829,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.name != null and filterPageVO.name != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.name},'%')
@@ -884,10 +882,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
             AND d.msg like CONCAT('%', #{filterPageByDeptVO.name},'%')
@@ -930,10 +928,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
             AND d.msg like CONCAT('%', #{filterPageByDeptVO.name},'%')
@@ -998,10 +996,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1040,10 +1038,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1179,10 +1177,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1236,10 +1234,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1377,10 +1375,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1443,10 +1441,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1570,10 +1568,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1614,10 +1612,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1673,10 +1671,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and b.level = #{level}
@@ -1807,10 +1805,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1858,10 +1856,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -1981,10 +1979,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -2039,10 +2037,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and c.level = #{level}
@@ -2113,10 +2111,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="level != null and level != ''">
             and b.level = #{level}
@@ -2846,11 +2844,11 @@
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
-        <if test="qcResultShortPageVO.startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{qcResultShortPageVO.startDate})]]>
+        <if test="qcResultShortPageVO.startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
         </if>
         <if test="qcResultShortPageVO.endDate != null ">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{qcResultShortPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
         </if>
         <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
@@ -3018,11 +3016,11 @@
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
-        <if test="qcResultShortPageVO.startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{qcResultShortPageVO.startDate})]]>
+        <if test="qcResultShortPageVO.startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
         </if>
         <if test="qcResultShortPageVO.endDate != null ">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{qcResultShortPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
         </if>
         <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
@@ -3249,10 +3247,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="deptName != null and deptName != ''">
             AND a.beh_dept_name = #{deptName}
@@ -3304,10 +3302,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="deptName != null and deptName != ''">
             AND a.beh_dept_name = #{deptName}
@@ -3355,10 +3353,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="deptName != null and deptName != ''">
             AND a.beh_dept_name = #{deptName}
@@ -3406,10 +3404,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="deptName != null and deptName != ''">
             AND a.beh_dept_name = #{deptName}
@@ -3507,11 +3505,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -3563,11 +3561,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.file_code,
@@ -3585,11 +3583,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND tt2.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND tt2.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND tt2.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND tt2.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND tt2.leave_hospital_date <= #{endDate}]]>
         </if>
         ORDER BY
         tt1.file_code,
@@ -3629,11 +3627,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.file_code,
@@ -3651,11 +3649,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND tt2.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND tt2.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND tt2.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND tt2.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND tt2.leave_hospital_date <= #{endDate}]]>
         </if>
         ORDER BY
         tt1.file_code,
@@ -3700,11 +3698,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -3748,11 +3746,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) h1,(
         SELECT
@@ -3844,10 +3842,10 @@
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
         <if test="qcResultShortPageVO.startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{qcResultShortPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
         </if>
         <if test="qcResultShortPageVO.endDate != null ">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{qcResultShortPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
         </if>
         <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
@@ -3983,11 +3981,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND m1.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND m1.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND m1.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND m1.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND m1.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         m1.behospital_code
@@ -4015,11 +4013,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) t1,
         (
@@ -4041,11 +4039,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) t2
     </select>
@@ -4091,11 +4089,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="name != null and name != ''">
             AND a.beh_dept_name like CONCAT('%', #{name}, '%')
@@ -4127,11 +4125,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="name != null and name != ''">
             AND a.beh_dept_name like CONCAT('%', #{name}, '%')
@@ -4163,11 +4161,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="name != null and name != ''">
             AND a.beh_dept_name like CONCAT('%', #{name}, '%')
@@ -4213,11 +4211,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND m1.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND m1.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND m1.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND m1.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND m1.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="name != null and name != ''">
             AND m1.beh_dept_name like CONCAT('%', #{name}, '%')
@@ -4246,11 +4244,11 @@
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
-        <if test="startDate != null">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="endDate != null">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="name != null and name != ''">
             AND a.beh_dept_name like CONCAT('%', #{name}, '%')

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

@@ -36,10 +36,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="gradeType != null and gradeType != ''">
             AND c.grade_type = #{gradeType}
@@ -67,10 +67,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="gradeType != null and gradeType != ''">
             AND c.grade_type = #{gradeType}
@@ -106,10 +106,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -141,10 +141,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -194,10 +194,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         d.cases_id
@@ -224,10 +224,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) t2,
         (
@@ -294,10 +294,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         d.cases_entry_id
@@ -324,10 +324,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) t2
         ORDER BY
@@ -387,10 +387,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
@@ -433,10 +433,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         ) t2
         ) t
@@ -492,10 +492,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         d.cases_entry_id,
@@ -528,10 +528,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         ) t2
         ORDER BY
@@ -560,10 +560,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -601,10 +601,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="deptClass != null and deptClass != ''">
             AND e.dept_name = #{deptClass}
@@ -641,10 +641,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         <if test="gradeType != null and gradeType != ''">
             AND c.grade_type = #{gradeType}
@@ -700,10 +700,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         d.cases_id,
@@ -766,10 +766,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         d.cases_entry_id,
@@ -807,10 +807,10 @@
             AND a.hospital_id = #{hospitalId}
         </if>
         <if test="startDate != null and startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
         <if test="endDate != null and endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
         GROUP BY
         a.beh_dept_id,
@@ -890,10 +890,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
@@ -950,10 +950,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
@@ -1017,10 +1017,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
@@ -1053,10 +1053,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
@@ -1135,10 +1135,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageVO.deptName}
@@ -1188,10 +1188,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name  =  #{filterPageVO.deptName}
@@ -1236,10 +1236,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.name != null and filterPageVO.name != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.name},'%')
@@ -1278,10 +1278,10 @@
             AND a.hospital_id = #{filterPageVO.hospitalId}
         </if>
         <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
         </if>
         <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
         </if>
         <if test="filterPageVO.name != null and filterPageVO.name != ''">
             AND a.beh_dept_name like CONCAT('%', #{filterPageVO.name},'%')
@@ -1358,10 +1358,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
@@ -1405,10 +1405,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ and a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
@@ -1502,10 +1502,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[ AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}
@@ -1572,10 +1572,10 @@
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
-            <![CDATA[ AND a.leave_hospital_date >= DATE(#{filterPageByDeptVO.startDate})]]>
+            <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
         </if>
         <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
-            <![CDATA[ AND a.leave_hospital_date < DATE(#{filterPageByDeptVO.endDate})]]>
+            <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}