浏览代码

时间格式/时间筛选条件调整

chengyao 4 年之前
父节点
当前提交
8d69c4a174
共有 2 个文件被更改,包括 21 次插入20 次删除
  1. 15 14
      src/main/resources/mapper/MedLisInfoMapper.xml
  2. 6 6
      src/main/resources/mapper/MedPacsInfoMapper.xml

+ 15 - 14
src/main/resources/mapper/MedLisInfoMapper.xml

@@ -84,12 +84,6 @@
         <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
             and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
         </if>
-        <if test="examineInfoVO.jyDateStart != null">
-            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.jyDateStart}]]>
-        </if>
-        <if test="examineInfoVO.jyDateEnd != null">
-            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.jyDateEnd}]]>
-        </if>
         <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
             <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
                 <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
@@ -103,6 +97,12 @@
         </if>
         ) b
         where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
             <if test="infos != null and infos.size() > 0">
                 and b.info  in
                 <foreach collection="infos" open="(" separator="," close=")" item="item">
@@ -171,12 +171,7 @@
         <if test="examineInfoVO.examineItemName != null and examineInfoVO.examineItemName != ''">
             and t1.rep_name like CONCAT('%',#{examineInfoVO.examineItemName},'%')
         </if>
-        <if test="examineInfoVO.jyDateStart != null">
-            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') >= #{examineInfoVO.jyDateStart}]]>
-        </if>
-        <if test="examineInfoVO.jyDateEnd != null">
-            <![CDATA[ AND date_format(t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.jyDateEnd}]]>
-        </if>
+
         <if test="examineInfoVO.isPlacefile != null and examineInfoVO.isPlacefile == 1">
             <if test="examineInfoVO.leaveHospitalDate != null and examineInfoVO.behospitalDate != null">
                 <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{examineInfoVO.leaveHospitalDate}]]>
@@ -190,6 +185,12 @@
         </if>
         ) b
         where 1=1
+        <if test="examineInfoVO.jyDateStart != null">
+            <![CDATA[ AND b.cTime >= #{examineInfoVO.jyDateStart}]]>
+        </if>
+        <if test="examineInfoVO.jyDateEnd != null">
+            <![CDATA[ AND b.cTime <= #{examineInfoVO.jyDateEnd}]]>
+        </if>
         <if test="examineInfoVO.examineType != null and examineInfoVO.examineType == 1">
             <if test="infos != null and infos.size() > 0">
                 and b.info in
@@ -239,8 +240,8 @@
         SELECT
         t2.item_name AS examineItemName,
         CONCAT( t2.result, t2.unit ) AS examineItemResult,
-        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %h:%i:%s' ) as reptTime,
-        DATE_FORMAT( t1.check_date, '%Y-%m-%d %h:%i:%s' ) as checkTime,
+        DATE_FORMAT( t1.rep_date, '%Y-%m-%d %H:%i:%s' ) as reptTime,
+        DATE_FORMAT( t1.check_date, '%Y-%m-%d %H:%i:%s' ) as checkTime,
         CONCAT( t2.item_name, '(',DATE_FORMAT( t1.check_date,'%Y-%m-%d %H:%i:%s'),')')as info,
         t1.apply_doctor AS doctorName
         FROM

+ 6 - 6
src/main/resources/mapper/MedPacsInfoMapper.xml

@@ -87,12 +87,6 @@
         <if test="checkInfoVO.checkItemName != null and checkInfoVO.checkItemName != ''">
             and t1.rep_name like CONCAT('%',#{checkInfoVO.checkItemName},'%')
         </if>
-        <if test="checkInfoVO.jxDateStart != null">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s')  >= #{checkInfoVO.jxDateStart}]]>
-        </if>
-        <if test="checkInfoVO.jxDateEnd != null">
-            <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s')  <= #{checkInfoVO.jxDateEnd}]]>
-        </if>
         <if test="checkInfoVO.isPlacefile != null and checkInfoVO.isPlacefile == 1">
             <if test="checkInfoVO.leaveHospitalDate != null and checkInfoVO.behospitalDate != null">
                 <![CDATA[ AND date_format (t1.check_date,'%Y-%m-%d %H:%i:%s') <= #{checkInfoVO.leaveHospitalDate}]]>
@@ -106,6 +100,12 @@
         </if>
         ) b
         where 1=1
+        <if test="checkInfoVO.jxDateStart != null">
+            <![CDATA[ AND b.checkTime >= #{checkInfoVO.jxDateStart}]]>
+        </if>
+        <if test="checkInfoVO.jxDateEnd != null">
+            <![CDATA[ AND b.checkTime <= #{checkInfoVO.jxDateEnd}]]>
+        </if>
         <if test="checkInfoVO.checkType != null and checkInfoVO.checkType == 1">
             <if test="infos != null and infos.size() > 0">
                 and b.info in