|
@@ -164,6 +164,7 @@ FROM
|
164
|
164
|
FROM
|
165
|
165
|
ta_person tp
|
166
|
166
|
INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
|
167
|
+ where tp.person_type != #{personType}
|
167
|
168
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.visit_time , '%Y-%m-%d' )
|
168
|
169
|
</select>
|
169
|
170
|
|
|
@@ -193,7 +194,7 @@ FROM
|
193
|
194
|
FROM
|
194
|
195
|
ta_person tp
|
195
|
196
|
INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
196
|
|
- where tp.person_type = #{personType}
|
|
197
|
+ where tp.person_type != #{personType}
|
197
|
198
|
GROUP BY tpvr.activity
|
198
|
199
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.visitTime , '%Y-%m-%d' )
|
199
|
200
|
</select>
|
|
@@ -230,14 +231,14 @@ FROM
|
230
|
231
|
FROM
|
231
|
232
|
ta_person tp
|
232
|
233
|
INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
233
|
|
- where tp.person_type = #{personType}
|
|
234
|
+ where tp.person_type != #{personType}
|
234
|
235
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.visit_time , '%Y-%m-%d' )
|
235
|
236
|
</select>
|
236
|
237
|
|
237
|
|
- <select id="selectNewsUserCount" >
|
|
238
|
+ <select id="selectNewsUserCount" resultType="map">
|
238
|
239
|
SELECT
|
239
|
|
- consultant_count_table.date as date,
|
240
|
|
- consultant_count_table.consultant_count as consultant_count,
|
|
240
|
+ authorization_count_table.date as date,
|
|
241
|
+ authorization_count_table.authorization_count as authorization_count,
|
241
|
242
|
user_count_table.user_count as user_count
|
242
|
243
|
FROM
|
243
|
244
|
(
|
|
@@ -259,14 +260,15 @@ FROM
|
259
|
260
|
) AS temp_date
|
260
|
261
|
LEFT JOIN (
|
261
|
262
|
SELECT
|
262
|
|
- COUNT(1) as consultant_count,
|
|
263
|
+ COUNT(1) as authorization_count,
|
263
|
264
|
tpvr.visit_time AS visit_time
|
264
|
265
|
FROM
|
265
|
266
|
ta_person tp
|
266
|
267
|
INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
267
|
|
- where tp.person_type = 'Realty Consultant'
|
|
268
|
+ where tp.person_type != #{personType}
|
|
269
|
+ and tp.phone is NOT NULL
|
268
|
270
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.visit_time , '%Y-%m-%d' )
|
269
|
|
- ) as consultant_count_table
|
|
271
|
+ ) as authorization_count_table
|
270
|
272
|
,
|
271
|
273
|
(SELECT
|
272
|
274
|
*
|
|
@@ -291,10 +293,62 @@ FROM
|
291
|
293
|
FROM
|
292
|
294
|
ta_person tp
|
293
|
295
|
INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
|
296
|
+ where tp.person_type != #{personType}
|
294
|
297
|
) AS temp ON temp_date.date = DATE_FORMAT( temp.visit_time , '%Y-%m-%d' )
|
295
|
298
|
|
296
|
299
|
) as user_count_table
|
297
|
300
|
GROUP BY date
|
298
|
301
|
</select>
|
299
|
302
|
|
|
303
|
+ <select id="selectUserSourcePie">
|
|
304
|
+ select count(1)
|
|
305
|
+ FROM ta_person
|
|
306
|
+ WHERE person_type != #{personType}
|
|
307
|
+ <if test="recommendPersonType != null and recommendPersonType != ''">
|
|
308
|
+ and recommend_person_type = #{recommendPersonType}
|
|
309
|
+ </if>
|
|
310
|
+ </select>
|
|
311
|
+
|
|
312
|
+ <select id="selectUserSourceColumnar" resultType="map">
|
|
313
|
+ SELECT
|
|
314
|
+ tpf.from_name as from_name,
|
|
315
|
+ (
|
|
316
|
+ SELECT
|
|
317
|
+ COUNT(1)
|
|
318
|
+ FROM ta_person tps
|
|
319
|
+ LEFT JOIN td_person_from tpfs
|
|
320
|
+ ON tps.from_code = tpfs.from_code
|
|
321
|
+ WHERE tpfs.from_code = tpf.from_code and tps.phone is NOT NULL
|
|
322
|
+ and tps.person_type != #{personType}
|
|
323
|
+ <if test="startDate != null or endDate != null">
|
|
324
|
+ and tps.create_date BETWEEN #{startDate} and #{endDate}
|
|
325
|
+ </if>
|
|
326
|
+ <if test="startDate == null or endDate == null">
|
|
327
|
+ and tps.create_date BETWEEN DATE_SUB( tp.create_date, INTERVAL 7 DAY ) and now()
|
|
328
|
+ </if>
|
|
329
|
+ ) as registered,
|
|
330
|
+ (
|
|
331
|
+ SELECT
|
|
332
|
+ COUNT(1)
|
|
333
|
+ FROM ta_person tps
|
|
334
|
+ LEFT JOIN td_person_from tpfs
|
|
335
|
+ ON tps.from_code = tpfs.from_code
|
|
336
|
+ WHERE tpfs.from_code = tpf.from_code
|
|
337
|
+ and tps.person_type != #{personType}
|
|
338
|
+ <if test="startDate != null or endDate != null">
|
|
339
|
+ and tps.create_date BETWEEN #{startDate} and #{endDate}
|
|
340
|
+ </if>
|
|
341
|
+ <if test="startDate == null or endDate == null">
|
|
342
|
+ and tps.create_date BETWEEN DATE_SUB( tp.create_date, INTERVAL 7 DAY ) and now()
|
|
343
|
+ </if>
|
|
344
|
+ ) as user_count
|
|
345
|
+
|
|
346
|
+ FROM td_person_from tpf
|
|
347
|
+ LEFT JOIN ta_person tp
|
|
348
|
+ ON tp.from_code = tpf.from_code
|
|
349
|
+ where tp.person_type != #{personType}
|
|
350
|
+ GROUP BY tpf.from_code
|
|
351
|
+ </select>
|
|
352
|
+
|
|
353
|
+
|
300
|
354
|
</mapper>
|