|
@@ -58,4 +58,122 @@
|
58
|
58
|
sum(if(gender = '2', 1, 0)) as female_num
|
59
|
59
|
from ta_person
|
60
|
60
|
</select>
|
|
61
|
+ <select id="getGkLeaderboard" resultType="com.yunzhi.marketing.xlk.vo.PcStatisticsLeaderboardVO">
|
|
62
|
+ SELECT
|
|
63
|
+ count(1) as num,
|
|
64
|
+ b.building_id,
|
|
65
|
+ d.building_name
|
|
66
|
+ FROM
|
|
67
|
+ ta_recommend_customer b
|
|
68
|
+ LEFT JOIN ta_building d ON b.building_id = d.building_id
|
|
69
|
+ LEFT JOIN xlk_institution i ON b.institution_id = i.institution_id
|
|
70
|
+ WHERE
|
|
71
|
+ b.STATUS > 0
|
|
72
|
+ AND b.org_id = 1
|
|
73
|
+ AND b.verify_status = 1
|
|
74
|
+ AND ( b.realty_consultant IS NULL OR b.realty_consultant = '' )
|
|
75
|
+ AND b.building_id IS NOT NULL
|
|
76
|
+ <if test="params.cityId != null">
|
|
77
|
+ and d.city_id = #{params.cityId}
|
|
78
|
+ </if>
|
|
79
|
+ <if test="params.startTime != null">
|
|
80
|
+ and TO_DAYS(b.create_date) >= TO_DAYS(#{params.startTime})
|
|
81
|
+ </if>
|
|
82
|
+ <if test="params.endTime != null">
|
|
83
|
+ and TO_DAYS(b.create_date) <= TO_DAYS(#{params.endTime})
|
|
84
|
+ </if>
|
|
85
|
+ AND i.institution_code like CONCAT(#{params.institutionCode}, '%')
|
|
86
|
+ GROUP BY b.building_id
|
|
87
|
+ ORDER BY num desc
|
|
88
|
+ LIMIT 6
|
|
89
|
+ </select>
|
|
90
|
+ <select id="getSkLeaderboard" resultType="com.yunzhi.marketing.xlk.vo.PcStatisticsLeaderboardVO">
|
|
91
|
+ SELECT
|
|
92
|
+ count(1) as num,
|
|
93
|
+ b.building_id,
|
|
94
|
+ d.building_name
|
|
95
|
+ FROM
|
|
96
|
+ ta_recommend_customer b
|
|
97
|
+ LEFT JOIN ta_building d ON b.building_id = d.building_id
|
|
98
|
+ LEFT JOIN xlk_institution i ON b.institution_id = i.institution_id
|
|
99
|
+ WHERE
|
|
100
|
+ b.STATUS > 0
|
|
101
|
+ AND b.org_id = 1
|
|
102
|
+ AND b.verify_status = 1
|
|
103
|
+ AND b.realty_consultant IS NOT NULL
|
|
104
|
+ AND b.realty_consultant != ''
|
|
105
|
+ AND b.building_id IS NOT NULL
|
|
106
|
+ <if test="params.cityId != null">
|
|
107
|
+ and d.city_id = #{params.cityId}
|
|
108
|
+ </if>
|
|
109
|
+ <if test="params.startTime != null">
|
|
110
|
+ and TO_DAYS(b.create_date) >= TO_DAYS(#{params.startTime})
|
|
111
|
+ </if>
|
|
112
|
+ <if test="params.endTime != null">
|
|
113
|
+ and TO_DAYS(b.create_date) <= TO_DAYS(#{params.endTime})
|
|
114
|
+ </if>
|
|
115
|
+ AND i.institution_code like CONCAT(#{params.institutionCode}, '%')
|
|
116
|
+ GROUP BY b.building_id
|
|
117
|
+ ORDER BY num desc
|
|
118
|
+ LIMIT 6
|
|
119
|
+ </select>
|
|
120
|
+ <select id="getVisitNumLeaderboard" resultType="com.yunzhi.marketing.xlk.vo.PcStatisticsLeaderboardVO">
|
|
121
|
+ SELECT
|
|
122
|
+ count( * ) AS num,
|
|
123
|
+ a.be_uv AS building_id,
|
|
124
|
+ d.building_name
|
|
125
|
+ FROM
|
|
126
|
+ ta_uv a
|
|
127
|
+ LEFT JOIN ta_building d ON a.be_uv = d.building_id
|
|
128
|
+ LEFT JOIN xlk_institution i ON d.institution_id = i.institution_id
|
|
129
|
+ WHERE
|
|
130
|
+ a.tagert_type = 'project'
|
|
131
|
+ AND d.org_id = 1
|
|
132
|
+ AND a.be_uv != "undefined"
|
|
133
|
+ <if test="params.cityId != null">
|
|
134
|
+ and d.city_id = #{params.cityId}
|
|
135
|
+ </if>
|
|
136
|
+ <if test="params.startTime != null">
|
|
137
|
+ and TO_DAYS(a.create_date) >= TO_DAYS(#{params.startTime})
|
|
138
|
+ </if>
|
|
139
|
+ <if test="params.endTime != null">
|
|
140
|
+ and TO_DAYS(a.create_date) <= TO_DAYS(#{params.endTime})
|
|
141
|
+ </if>
|
|
142
|
+ AND i.institution_code like CONCAT(#{params.institutionCode}, '%')
|
|
143
|
+ GROUP BY
|
|
144
|
+ a.be_uv
|
|
145
|
+ ORDER BY
|
|
146
|
+ num DESC
|
|
147
|
+ LIMIT 6
|
|
148
|
+ </select>
|
|
149
|
+ <select id="getSuccessLeaderboard" resultType="com.yunzhi.marketing.xlk.vo.PcStatisticsLeaderboardVO">
|
|
150
|
+ SELECT
|
|
151
|
+ count(1) as num,
|
|
152
|
+ b.building_id,
|
|
153
|
+ d.building_name
|
|
154
|
+ FROM
|
|
155
|
+ ta_recommend_customer b
|
|
156
|
+ LEFT JOIN ta_building d ON b.building_id = d.building_id
|
|
157
|
+ LEFT JOIN xlk_institution i ON b.institution_id = i.institution_id
|
|
158
|
+ WHERE
|
|
159
|
+ b.STATUS > 3
|
|
160
|
+ AND b.org_id = 1
|
|
161
|
+ AND b.verify_status = 1
|
|
162
|
+ AND b.realty_consultant IS NOT NULL
|
|
163
|
+ AND b.realty_consultant != ''
|
|
164
|
+ AND b.building_id IS NOT NULL
|
|
165
|
+ <if test="params.cityId != null">
|
|
166
|
+ and d.city_id = #{params.cityId}
|
|
167
|
+ </if>
|
|
168
|
+ <if test="params.startTime != null">
|
|
169
|
+ and TO_DAYS(b.create_date) >= TO_DAYS(#{params.startTime})
|
|
170
|
+ </if>
|
|
171
|
+ <if test="params.endTime != null">
|
|
172
|
+ and TO_DAYS(b.create_date) <= TO_DAYS(#{params.endTime})
|
|
173
|
+ </if>
|
|
174
|
+ AND i.institution_code like CONCAT(#{params.institutionCode}, '%')
|
|
175
|
+ GROUP BY b.building_id
|
|
176
|
+ ORDER BY num desc
|
|
177
|
+ LIMIT 6
|
|
178
|
+ </select>
|
61
|
179
|
</mapper>
|