Selaa lähdekoodia

病案首页合格病历列表增加deptId、doctorId条件查询

chengyao 3 vuotta sitten
vanhempi
commit
ea91eaf5a7
1 muutettua tiedostoa jossa 32 lisäystä ja 33 poistoa
  1. 32 33
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 32 - 33
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -11212,6 +11212,9 @@
         <if test="deptClass != null and deptClass != ''">
             and a.beh_dept_id = #{deptClass}
         </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
         <if test="titleName != null and titleName != '' ">
             <if test="titleName == '不合格数'">
                 AND e.`level`='不合格'
@@ -11224,7 +11227,9 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         <if test="doctorName != null and doctorName != ''">
-            AND a.doctor_name like CONCAT('%', #{doctorName}, '%')
+            AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%'))
         </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -11255,9 +11260,9 @@
             AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
         </if>
         <if test="doctorId != null and doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
+            AND (a.doctor_id = #{doctorId}
+            OR a.beh_doctor_id = #{doctorId}
+            OR a.director_doctor_id = #{doctorId})
         </if>
         )be
         left join med_check_info mci
@@ -11311,14 +11316,6 @@
         AND d.cases_entry_id = e.id
         AND d.cases_id = 243
         AND a.qc_type_id != 0
-        <!--        <if test="titleName != null ">-->
-        <!--            <if test="titleName == '不合格数'">-->
-        <!--                AND c.`level`='不合格'-->
-        <!--            </if>-->
-        <!--            <if test="titleName == '合格数'">-->
-        <!--                AND c.`level`='合格'-->
-        <!--            </if>-->
-        <!--        </if>-->
         <if test="userId!=null">
             AND b.user_id = #{userId}
         </if>
@@ -11326,11 +11323,21 @@
             and a.beh_dept_name = #{deptName}
         </if>
         <if test="doctorName != null and doctorName != ''">
-            AND a.doctor_name like CONCAT('%', #{doctorName}, '%')
+            AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%'))
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            AND (a.doctor_id = #{doctorId}
+            OR a.beh_doctor_id = #{doctorId}
+            OR a.director_doctor_id = #{doctorId})
         </if>
         <if test="deptClass != null and deptClass != ''">
             and a.beh_dept_id = #{deptClass}
         </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
         </if>
@@ -12691,9 +12698,6 @@
                 AND c.`level`='合格'
             </if>
         </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            AND a.doctor_name  like CONCAT('%', #{qcResultShortPageVO.doctorName}, '%')
-        </if>
         <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
@@ -12722,6 +12726,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
         </if>
@@ -12729,9 +12736,9 @@
             AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND (a.doctor_id = #{qcResultShortPageVO.doctorId}
+            OR a.beh_doctor_id = #{qcResultShortPageVO.doctorId}
+            OR a.director_doctor_id = #{qcResultShortPageVO.doctorId})
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
@@ -12912,21 +12919,10 @@
         AND c.cases_id = k.cases_id
         AND k.cases_id = d.cases_id
         AND k.cases_entry_id = d.id
-        <!--        <if test="qcResultShortPageVO.titleName != null ">-->
-        <!--            <if test="qcResultShortPageVO.titleName == '不合格数'">-->
-        <!--                AND c.`level`='不合格'-->
-        <!--            </if>-->
-        <!--            <if test="qcResultShortPageVO.titleName == '合格数'">-->
-        <!--                AND c.`level`='合格'-->
-        <!--            </if>-->
-        <!--        </if>-->
         AND a.qc_type_id != 0
         <if test="qcResultShortPageVO.userId!=null">
             AND b.user_id = #{qcResultShortPageVO.userId}
         </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            and a.doctor_name = #{qcResultShortPageVO.doctorName}
-        </if>
         <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
@@ -12955,6 +12951,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
         </if>
@@ -12965,9 +12964,9 @@
             AND d.NAME = #{qcResultShortPageVO.casesEntryName}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND (a.doctor_id = #{qcResultShortPageVO.doctorId}
+            OR a.beh_doctor_id = #{qcResultShortPageVO.doctorId}
+            OR a.director_doctor_id = #{qcResultShortPageVO.doctorId})
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )