Browse Source

义乌妇幼保健院新生儿患者统计变更

“wangdsYun 8 tháng trước cách đây
mục cha
commit
ce6e7efe79
1 tập tin đã thay đổi với 25 bổ sung14 xóa
  1. 25 14
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 25 - 14
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -1512,6 +1512,7 @@
         med_behospital_info a
         WHERE
         a.is_deleted = 'N'
+        AND a.qc_type_id != 0
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
         </if>
@@ -7827,13 +7828,13 @@
         <if test="qcResultShortPageVO.isDaytime != null and qcResultShortPageVO.isDaytime != ''">
             and a.is_daytime = #{qcResultShortPageVO.isDaytime}
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != '' and qcResultShortPageVO.leaveHosType !=2">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0 and qcResultShortPageVO.leaveHosType !=2">
             <if test="qcResultShortPageVO.startDate != null ">
                 <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
             </if>
@@ -7841,7 +7842,15 @@
                 <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
             </if>
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1 and qcResultShortPageVO.leaveHosType !=2">
+            <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 <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.leaveHosType ==2">
             <if test="qcResultShortPageVO.startDate != null ">
                 <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
             </if>
@@ -7910,10 +7919,7 @@
             t2.is_deleted = 'N'
             AND t1.hospital_id = t2.hospital_id
             AND t1.behospital_code = t2.behospital_code
-            AND (
-            ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-'AND t2.newborn_day != '—' )
-            OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-'AND t2.newborn_month != '—' )
-            )
+            AND ( IFNULL( t2.newborn_behospital_weight, '' ) != '' AND t2.newborn_behospital_weight != '0' AND t2.newborn_behospital_weight != '-' AND t2.newborn_behospital_weight != '—')
         </if>
         <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
             , med_medical_record b,
@@ -8070,13 +8076,13 @@
         <if test="qcResultShortPageVO.userId!=null">
             AND b.user_id = #{qcResultShortPageVO.userId}
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != '' and qcResultShortPageVO.leaveHosType !=2">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
         <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
             AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 0 and qcResultShortPageVO.leaveHosType !=2">
             <if test="qcResultShortPageVO.startDate != null ">
                 <![CDATA[ AND a.behospital_date >= #{qcResultShortPageVO.startDate}]]>
             </if>
@@ -8084,7 +8090,15 @@
                 <![CDATA[ AND a.behospital_date <= #{qcResultShortPageVO.endDate}]]>
             </if>
         </if>
-        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1">
+        <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile == 1 and qcResultShortPageVO.leaveHosType !=2">
+            <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 <= #{qcResultShortPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="qcResultShortPageVO.leaveHosType ==2">
             <if test="qcResultShortPageVO.startDate != null ">
                 <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
             </if>
@@ -8153,10 +8167,7 @@
             t2.is_deleted = 'N'
             AND t1.hospital_id = t2.hospital_id
             AND t1.behospital_code = t2.behospital_code
-            AND (
-            ( IFNULL( t2.newborn_day, '' ) != '' AND t2.newborn_day != '0' AND t2.newborn_day != '-'AND t2.newborn_day != '—' )
-            OR ( IFNULL( t2.newborn_month, '' )!= '' AND t2.newborn_month != '0' AND t2.newborn_month != '-'AND t2.newborn_month != '—' )
-            )
+            AND ( IFNULL( t2.newborn_behospital_weight, '' ) != '' AND t2.newborn_behospital_weight != '0' AND t2.newborn_behospital_weight != '-' AND t2.newborn_behospital_weight != '—')
         </if>
         <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
             , med_medical_record b,