|
@@ -9,6 +9,24 @@
|
9
|
9
|
(
|
10
|
10
|
SELECT
|
11
|
11
|
t.house_id,
|
|
12
|
+ (
|
|
13
|
+ CASE
|
|
14
|
+ WHEN ( SELECT num_char_extract ( t.term_name, 2 ) + 0 ) = 0 THEN
|
|
15
|
+ ( SELECT num_char_extract ( t.term_name, 2 ) ) ELSE ( SELECT num_char_extract ( t.term_name, 2 ) + 0 )
|
|
16
|
+ END
|
|
17
|
+ ) termNamePre,
|
|
18
|
+ (
|
|
19
|
+ CASE
|
|
20
|
+ WHEN ( SELECT num_char_extract ( t.block_name, 2 ) + 0 ) = 0 THEN
|
|
21
|
+ ( SELECT num_char_extract ( t.block_name, 2 ) ) ELSE ( SELECT num_char_extract ( t.block_name, 2 ) + 0 )
|
|
22
|
+ END
|
|
23
|
+ ) blockNamePre,
|
|
24
|
+ (
|
|
25
|
+ CASE
|
|
26
|
+ WHEN ( SELECT num_char_extract ( t.unit_name, 2 ) + 0 ) = 0 THEN
|
|
27
|
+ ( SELECT num_char_extract ( t.unit_name, 2 ) ) ELSE ( SELECT num_char_extract ( t.unit_name, 2 ) + 0 )
|
|
28
|
+ END
|
|
29
|
+ ) unitNamePre,
|
12
|
30
|
t.building_id,
|
13
|
31
|
t.block_id,
|
14
|
32
|
t.block_name,
|
|
@@ -29,12 +47,11 @@
|
29
|
47
|
t2.building_area,
|
30
|
48
|
t2.apartment_name,
|
31
|
49
|
t3.term_id,
|
32
|
|
- t4.term_name termName
|
|
50
|
+ t.term_name
|
33
|
51
|
FROM
|
34
|
52
|
ta_housing_resources t
|
35
|
53
|
LEFT JOIN ta_building_apartment t2 ON t.apartment_id = t2.apartment_id
|
36
|
54
|
LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
|
37
|
|
- LEFT JOIN ta_building_term t4 ON t3.term_id = t4.term_id
|
38
|
55
|
WHERE
|
39
|
56
|
t.sales_batch_id = #{salesBatchId}
|
40
|
57
|
<choose>
|
|
@@ -57,11 +74,11 @@
|
57
|
74
|
AND t.`status` > 0
|
58
|
75
|
) t5
|
59
|
76
|
ORDER BY
|
60
|
|
- ( SELECT num_char_extract ( t5.termName, 2 ) ),
|
61
|
|
- ( SELECT num_char_extract ( t5.block_name, 2 ) ),
|
62
|
|
- ( SELECT num_char_extract ( t5.unit_name, 2 ) ),
|
63
|
|
- ( SELECT num_char_extract ( t5.floor_name, 2 ) ) DESC,
|
64
|
|
- ( SELECT num_char_extract ( t5.room_name, 2 ) )
|
|
77
|
+ t5.termNamePre,
|
|
78
|
+ t5.blockNamePre,
|
|
79
|
+ t5.unitNamePre,
|
|
80
|
+ ( SELECT num_char_extract ( t5.floor_name, 2 ) + 0 ) DESC,
|
|
81
|
+ ( SELECT num_char_extract ( t5.room_name, 2 ) + 0)
|
65
|
82
|
</select>
|
66
|
83
|
|
67
|
84
|
<select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
|