|
@@ -34,29 +34,30 @@
|
34
|
34
|
AND t.org_id = #{orgId}
|
35
|
35
|
AND t.house_id = t2.house_id
|
36
|
36
|
<if test="buildingId != null and buildingId != ''">
|
37
|
|
- t.building_id = #{buildingId}
|
|
37
|
+ AND t.building_id = #{buildingId}
|
38
|
38
|
</if>
|
39
|
39
|
<if test="salesBtchId != null and salesBtchId != ''">
|
40
|
|
- t2.sales_batch_id = #{salesBtchId}
|
|
40
|
+ AND t2.sales_batch_id = #{salesBtchId}
|
41
|
41
|
</if>
|
42
|
42
|
<if test="apartmentId != null and apartmentId != ''">
|
43
|
|
- t2.apartment_id = #{apartmentId}
|
|
43
|
+ AND t2.apartment_id = #{apartmentId}
|
44
|
44
|
</if>
|
45
|
|
- <if test="houseLockingStatus = 'locked'">
|
46
|
|
- t2.house_locking_status = 'locked'
|
|
45
|
+ <if test="houseLockingStatus == 'locked'">
|
|
46
|
+ AND t2.house_locking_status = 'locked'
|
47
|
47
|
</if>
|
48
|
|
- <if test="houseLockingStatus = 'unlocked'">
|
49
|
|
- t2.house_locking_status != 'locked'
|
|
48
|
+ <if test="houseLockingStatus == 'unlocked'">
|
|
49
|
+ AND t2.house_locking_status != 'locked'
|
50
|
50
|
</if>
|
51
|
51
|
) t3
|
52
|
52
|
LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
|
53
|
53
|
LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
|
54
|
54
|
left join ta_raise_house t6 on t3.house_id = t6.house_id
|
55
|
|
- <if test="customerLocked = 'mine'">
|
56
|
|
- t6.person_id = #{personId}
|
|
55
|
+ where 1=1
|
|
56
|
+ <if test="customerLocked == 'mine'">
|
|
57
|
+ AND t6.person_id = #{personId}
|
57
|
58
|
</if>
|
58
|
|
- <if test="customerLocked = 'other'">
|
59
|
|
- t6.person_id != #{personId}
|
|
59
|
+ <if test="customerLocked == 'other'">
|
|
60
|
+ AND t6.person_id != #{personId}
|
60
|
61
|
</if>
|
61
|
62
|
ORDER BY
|
62
|
63
|
t3.create_date DESC
|