Browse Source

科室缺陷占比排序

chengyao 4 years ago
parent
commit
0ad2029f34
1 changed files with 50 additions and 62 deletions
  1. 50 62
      src/main/resources/mapper/QcresultInfoMapper.xml

+ 50 - 62
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1751,12 +1751,6 @@
         <if test="filterPageVO.isReject != null">
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
             AND d.is_reject = #{filterPageVO.isReject}
         </if>
         </if>
-        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
-            AND d.cases_id = #{filterPageVO.casesId}
-        </if>
-        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-            AND e.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
-        </if>
         <if test="filterPageVO.ruleType != null">
         <if test="filterPageVO.ruleType != null">
             AND e.rule_type = #{filterPageVO.ruleType}
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
         </if>
@@ -2102,40 +2096,40 @@
         <if test="filterPageByDeptVO.userId!=null">
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageVO.isPlacefile}
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
         </if>
         </if>
         AND a.qc_type_id != 0
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
+        <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 0">
+            <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageByDeptVO.startDate}]]>
             </if>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageByDeptVO.endDate}]]>
             </if>
             </if>
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 1">
+            <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
             </if>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
             </if>
             </if>
         </if>
         </if>
-        <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
-            AND a.beh_dept_name = #{filterPageVO.deptName}
+        <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
+            AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
         </if>
         </if>
-        <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
-            AND a.doctor_name  like CONCAT('%', #{filterPageVO.doctorName}, '%')
+        <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
+            AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
         </if>
-        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
-            AND d.cases_id = #{filterPageVO.casesId}
+        <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
+            AND d.cases_id = #{filterPageByDeptVO.casesId}
         </if>
         </if>
-        <if test="filterPageVO.isReject != null">
-            AND d.is_reject = #{filterPageVO.isReject}
+        <if test="filterPageByDeptVO.isReject != null">
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         </if>
         GROUP BY
         GROUP BY
         d.cases_entry_id,
         d.cases_entry_id,
@@ -2146,14 +2140,14 @@
         tt2.is_deleted = 'N'
         tt2.is_deleted = 'N'
         AND tt1.cases_id = tt2.cases_id
         AND tt1.cases_id = tt2.cases_id
         AND tt1.cases_entry_id = tt2.id
         AND tt1.cases_entry_id = tt2.id
-        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-            AND tt2.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
+        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
+            AND tt2.cases_name like CONCAT('%', #{filterPageByDeptVO.casesName},'%')
         </if>
         </if>
-        <if test="filterPageVO.name != null and filterPageVO.name != ''">
-            AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
+        <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
+            AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
         </if>
         </if>
-        <if test="filterPageVO.ruleType != null">
-            AND tt2.rule_type = #{filterPageVO.ruleType}
+        <if test="filterPageByDeptVO.ruleType != null">
+            AND tt2.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         </if>
         ) t1,(
         ) t1,(
         SELECT
         SELECT
@@ -2175,48 +2169,42 @@
         <if test="filterPageByDeptVO.userId!=null">
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageVO.isPlacefile}
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
         </if>
         </if>
         AND e.cases_id = d.cases_id
         AND e.cases_id = d.cases_id
         AND e.id = d.cases_entry_id
         AND e.id = d.cases_entry_id
         AND a.qc_type_id != 0
         AND a.qc_type_id != 0
-        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
-            AND a.hospital_id = #{filterPageVO.hospitalId}
+        <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 0">
+            <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageByDeptVO.startDate}]]>
             </if>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageByDeptVO.endDate}]]>
             </if>
             </if>
         </if>
         </if>
-        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
-            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
-                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile == 1">
+            <if test="filterPageByDeptVO.startDate != null and filterPageByDeptVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageByDeptVO.startDate}]]>
             </if>
             </if>
-            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
-                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            <if test="filterPageByDeptVO.endDate != null and filterPageByDeptVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageByDeptVO.endDate}]]>
             </if>
             </if>
         </if>
         </if>
-        <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
-            AND a.beh_dept_name  =  #{filterPageVO.deptName}
-        </if>
-        <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
-            AND a.doctor_name  like CONCAT('%', #{filterPageVO.doctorName}, '%')
-        </if>
-        <if test="filterPageVO.isReject != null">
-            AND d.is_reject = #{filterPageVO.isReject}
+        <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
+            AND a.beh_dept_name  =  #{filterPageByDeptVO.deptName}
         </if>
         </if>
-        <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
-            AND d.cases_id = #{filterPageVO.casesId}
+        <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
+            AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
         </if>
-        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
-            AND e.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
+        <if test="filterPageByDeptVO.isReject != null">
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         </if>
-        <if test="filterPageVO.ruleType != null">
-            AND e.rule_type = #{filterPageVO.ruleType}
+        <if test="filterPageByDeptVO.ruleType != null">
+            AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         </if>
         ) t2
         ) t2
         )t
         )t