顾绍勇 пре 5 година
родитељ
комит
455480ec5a
1 измењених фајлова са 17 додато и 4 уклоњено
  1. 17
    4
      src/main/resources/mapper/TaHousingResourcesMapper.xml

+ 17
- 4
src/main/resources/mapper/TaHousingResourcesMapper.xml Прегледај датотеку

@@ -65,17 +65,30 @@
65 65
     </select>
66 66
 
67 67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
68
-        SELECT
68
+	    SELECT
69 69
             t3.apartment_id,
70 70
             t3.apartment_name,
71 71
             t3.apartment_type,
72 72
             t3.inside_area,
73
-            t3.building_area
73
+            t3.building_area,
74
+            t2.apartment_id
75
+        FROM
76
+            (
77
+        SELECT
78
+            t.sales_batch_id,
79
+            t.apartment_id
74 80
         FROM
75
-            ( SELECT t.sales_batch_id, t.apartment_id FROM ta_housing_resources t WHERE t.sales_batch_id = #{salesBatchId} and t.apartment_id is not null GROUP BY t.apartment_id ) t2
81
+            ta_housing_resources t
82
+        WHERE
83
+            t.sales_batch_id = #{salesBatchId}
84
+            AND t.`status` > 0
85
+            AND t.apartment_id IS NOT NULL
86
+        GROUP BY
87
+            t.apartment_id
88
+            ) t2
76 89
             LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id
77 90
         ORDER BY
78
-	      t3.apartment_name
91
+            t3.apartment_name
79 92
     </select>
80 93
 
81 94
     <update id="updateForAddHeat" parameterType="java.lang.String">