傅行帆 5 years ago
parent
commit
6b0f3e7a0d
1 changed files with 12 additions and 11 deletions
  1. 12
    11
      src/main/resources/mapper/TaPreselectionRecordMapper.xml

+ 12
- 11
src/main/resources/mapper/TaPreselectionRecordMapper.xml View File

34
             AND t.org_id = #{orgId}
34
             AND t.org_id = #{orgId}
35
             AND t.house_id = t2.house_id
35
             AND t.house_id = t2.house_id
36
             <if test="buildingId != null and buildingId != ''">
36
             <if test="buildingId != null and buildingId != ''">
37
-                t.building_id = #{buildingId}
37
+                AND t.building_id = #{buildingId}
38
             </if>
38
             </if>
39
             <if test="salesBtchId != null and salesBtchId != ''">
39
             <if test="salesBtchId != null and salesBtchId != ''">
40
-                t2.sales_batch_id = #{salesBtchId}
40
+                AND t2.sales_batch_id = #{salesBtchId}
41
             </if>
41
             </if>
42
             <if test="apartmentId != null and apartmentId != ''">
42
             <if test="apartmentId != null and apartmentId != ''">
43
-                t2.apartment_id = #{apartmentId}
43
+                AND t2.apartment_id = #{apartmentId}
44
             </if>
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
             </if>
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
             </if>
50
             </if>
51
             ) t3
51
             ) t3
52
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
52
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
53
             LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
53
             LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
54
             left join ta_raise_house t6 on t3.house_id = t6.house_id
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
             </if>
58
             </if>
58
-            <if test="customerLocked = 'other'">
59
-                t6.person_id != #{personId}
59
+            <if test="customerLocked == 'other'">
60
+                AND t6.person_id != #{personId}
60
             </if>
61
             </if>
61
          ORDER BY
62
          ORDER BY
62
             t3.create_date DESC
63
             t3.create_date DESC