liu 1 год назад
Родитель
Сommit
0bd214c793
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/main/resources/mapper/template/HouseNumberMapper.xml

+ 3 - 3
src/main/resources/mapper/template/HouseNumberMapper.xml

@@ -357,9 +357,9 @@
         h.id as houseId
         FROM
         `house_number` hn
-        LEFT JOIN building b ON b.id = hn.building_id
-        LEFT JOIN house_lock hl ON hl.house_number_id = hn.id
-        LEFT JOIN house h ON h.id = hn.house_id
+        LEFT JOIN building b ON b.id = hn.building_id AND b.deleted=0
+        LEFT JOIN house_lock hl ON hl.house_number_id = hn.id  AND hl.deleted=0
+        LEFT JOIN house h ON h.id = hn.house_id AND h.deleted=0
         WHERE
         hn.deleted=0
         <if test="keyWord != null and keyWord != ''">