- ( SELECT t.sales_batch_id, t.apartment_id FROM ta_housing_resources t WHERE t.sales_batch_id = #{salesBatchId} GROUP BY t.apartment_id ) t2
65
+ ( 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
66
66
LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id