Przeglądaj źródła

Merge branch 'dev/20201224_2.0.0' into test

chengyao 4 lat temu
rodzic
commit
5176a17982
1 zmienionych plików z 29 dodań i 56 usunięć
  1. 29 56
      src/main/resources/mapper/QcresultInfoMapper.xml

+ 29 - 56
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1751,12 +1751,6 @@
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
         </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">
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
@@ -2054,14 +2048,14 @@
         FROM
         (
         SELECT
+        t1.deptId,
+        t1.deptName,
         t1.id,
         t1.NAME,
         t1.casesId,
         t1.casesName,
         t1.ruleType,
         t1.isReject,
-        t1.deptId,
-        t1.deptName,
         t1.num,
         t2.totleNum,
         ROUND( t1.num / t2.totleNum, 4 ) AS percent,
@@ -2069,15 +2063,15 @@
         FROM
         (
         SELECT
-        tt2.id,
-        tt2.NAME,
+        tt1.beh_dept_id AS deptId,
+        tt1.beh_dept_name AS deptName,
+        tt2.id AS id,
+        tt2.NAME AS NAME,
         tt2.cases_id AS casesId,
         tt2.cases_name AS casesName,
-        tt2.rule_type AS ruleType,
         tt1.num,
-        tt1.is_reject AS isReject,
-        tt1.beh_dept_id AS deptId,
-        tt1.beh_dept_name AS deptName
+        tt2.rule_type AS ruleType,
+        tt1.is_reject AS isReject
         FROM
         (
         SELECT
@@ -2085,8 +2079,8 @@
         a.beh_dept_name,
         d.cases_id,
         d.cases_entry_id,
-        count(*) AS num,
-        d.is_reject
+        d.is_reject,
+        count(*) AS num
         FROM
         med_behospital_info a,
         med_qcresult_detail d,
@@ -2098,14 +2092,14 @@
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = d.behospital_code
-        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
-        </if>
         AND a.beh_dept_id = f.dept_id
-        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
@@ -2126,29 +2120,20 @@
             </if>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
-            AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}
+            AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
         </if>
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
-            <if test="filterPageByDeptVO.doctorName=='未知'">
-                AND (a.doctor_name is null OR a.doctor_name='')
-            </if>
-            <if test="filterPageByDeptVO.doctorName!='未知'">
-                AND a.doctor_name = #{filterPageByDeptVO.doctorName}
-            </if>
+            AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
         <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
             AND d.cases_id = #{filterPageByDeptVO.casesId}
         </if>
-        <if test="filterPageByDeptVO.isReject != null ">
+        <if test="filterPageByDeptVO.isReject != null">
             AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         GROUP BY
-        d.cases_id,
         d.cases_entry_id,
-        a.beh_dept_id,
-        a.beh_dept_name,
-        a.doctor_id,
-        a.doctor_name
+        d.cases_id
         ) tt1,
         qc_cases_entry tt2
         WHERE
@@ -2156,12 +2141,12 @@
         AND tt1.cases_id = tt2.cases_id
         AND tt1.cases_entry_id = tt2.id
         <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
-            AND tt2.cases_name = #{filterPageByDeptVO.casesName}
+            AND tt2.cases_name like CONCAT('%', #{filterPageByDeptVO.casesName},'%')
         </if>
         <if test="filterPageByDeptVO.name != null and filterPageByDeptVO.name != ''">
             AND tt2.name like CONCAT('%', #{filterPageByDeptVO.name},'%')
         </if>
-        <if test="filterPageByDeptVO.ruleType != null ">
+        <if test="filterPageByDeptVO.ruleType != null">
             AND tt2.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         ) t1,(
@@ -2180,16 +2165,16 @@
         AND a.hospital_id = d.hospital_id
         AND a.hospital_id = f.hospital_id
         AND a.behospital_code = d.behospital_code
-        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
-            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
-        </if>
-        AND d.cases_id = e.cases_id
-        AND d.cases_entry_id = e.id
         AND a.beh_dept_id = f.dept_id
-        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.userId!=null">
             AND f.user_id = #{filterPageByDeptVO.userId}
         </if>
+        <if test="filterPageByDeptVO.isPlacefile != null and filterPageByDeptVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageByDeptVO.isPlacefile}
+        </if>
+        AND e.cases_id = d.cases_id
+        AND e.id = d.cases_entry_id
+        AND a.qc_type_id != 0
         <if test="filterPageByDeptVO.hospitalId != null and filterPageByDeptVO.hospitalId != ''">
             AND a.hospital_id = #{filterPageByDeptVO.hospitalId}
         </if>
@@ -2210,30 +2195,18 @@
             </if>
         </if>
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
-            AND a.beh_dept_name =  #{filterPageByDeptVO.deptName}
+            AND a.beh_dept_name  =  #{filterPageByDeptVO.deptName}
         </if>
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
-            <if test="filterPageByDeptVO.doctorName=='未知'">
-                AND (a.doctor_name is null OR a.doctor_name='')
-            </if>
-            <if test="filterPageByDeptVO.doctorName!='未知'">
-                AND a.doctor_name = #{filterPageByDeptVO.doctorName}
-            </if>
-        </if>
-        <if test="filterPageByDeptVO.casesId != null and filterPageByDeptVO.casesId != 0">
-            AND d.cases_id = #{filterPageByDeptVO.casesId}
+            AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
         <if test="filterPageByDeptVO.isReject != null">
             AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
-        <if test="filterPageByDeptVO.casesName != null and filterPageByDeptVO.casesName != ''">
-            AND e.cases_name = #{filterPageByDeptVO.casesName}
-        </if>
-        <if test="filterPageByDeptVO.ruleType != null ">
+        <if test="filterPageByDeptVO.ruleType != null">
             AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         ) t2
         )t
-        order by t.id DESC
     </select>
 </mapper>