Переглянути джерело

解决数据进行软删之后还能查询到问题

wangzl 5 місяців тому
батько
коміт
8828e0ed13

+ 6 - 1
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizPatientMapper.xml

@@ -33,6 +33,7 @@
         FROM
         ( SELECT patient_id, COUNT ( 1 ) AS result_count FROM biz_clinic_room
         <where>
+            and deleted = 0
             <if test="query.queryTime != null and query.queryTime.size() > 0">
                 AND clinic_start_time &gt;= #{query.queryTime[0]}
             </if>
@@ -44,6 +45,8 @@
         JOIN biz_patient AS bp ON query_result.patient_id = bp.ID
         LEFT JOIN biz_clinic_room bcr ON bp.current_clinic_id = bcr.ID
         <where>
+            and bcr.deleted = 0
+            and bp.deleted = 0
             <if test="query.queryCondition != null and query.queryCondition != ''">
                 bp.patient_code LIKE concat('%',#{query.queryCondition,jdbcType=VARCHAR},'%')
                 or bp.name like concat('%',#{query.queryCondition,jdbcType=VARCHAR},'%')
@@ -80,7 +83,9 @@
             biz_patient bp
                 LEFT JOIN biz_clinic_room bcr ON bp.current_clinic_id = bcr.ID
         <where>
-            bp.current_clinic_id is not null
+            and bp.deleted = 0
+            and bcr.deleted = 0
+            and bp.current_clinic_id is not null
             <if test="query.condition != null and query.condition != ''">
                and bcr.patient_name like concat('%',#{query.condition,jdbcType=VARCHAR},'%')
             </if>