|
@@ -211,20 +211,18 @@
|
211
|
211
|
select * From (
|
212
|
212
|
select * from (
|
213
|
213
|
select
|
214
|
|
- t.target_id,
|
|
214
|
+ t.be_share as target_id,
|
215
|
215
|
a.url as activity_img,
|
216
|
216
|
a.building_name as activity_name,
|
217
|
217
|
a.building_name,
|
218
|
218
|
a.address,
|
219
|
219
|
a.price,
|
220
|
|
- t.event_type,
|
221
|
|
- t.visit_time
|
222
|
|
- from ta_person_visit_record t
|
223
|
|
- left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.target_id = a.building_id
|
224
|
|
- where t.event_type = 'building'
|
225
|
|
- and t.consultant_id = #{userId}
|
226
|
|
- and t.org_id = #{orgId}
|
227
|
|
- and t.`event` = 'share' order by t.visit_time desc limit 9999
|
|
220
|
+ t.tagert_type as eventType,
|
|
221
|
+ t.create_date
|
|
222
|
+ from ta_share t
|
|
223
|
+ left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.be_share = a.building_id
|
|
224
|
+ where t.tagert_type = 'project'
|
|
225
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
228
|
226
|
) t
|
229
|
227
|
group by t.target_id
|
230
|
228
|
|
|
@@ -232,20 +230,18 @@
|
232
|
230
|
|
233
|
231
|
select * from (
|
234
|
232
|
select
|
235
|
|
- t.target_id,
|
|
233
|
+ t.be_share as target_id,
|
236
|
234
|
b.list_img_url as activity_img,
|
237
|
235
|
b.title as activity_name,
|
238
|
236
|
'1' as price,
|
239
|
237
|
'2' as building_name,
|
240
|
238
|
'3' as address,
|
241
|
|
- t.event_type,
|
242
|
|
- t.visit_time
|
243
|
|
- from ta_person_visit_record t
|
244
|
|
- left join ta_building_dynamic b on t.target_id = b.dynamic_id
|
245
|
|
- where t.event_type = 'activity'
|
246
|
|
- and t.consultant_id = #{userId}
|
247
|
|
- and t.org_id = #{orgId}
|
248
|
|
- and t.`event` = 'share' order by t.visit_time desc limit 9999
|
|
239
|
+ t.tagert_type as eventType,
|
|
240
|
+ t.create_date
|
|
241
|
+ from ta_share t
|
|
242
|
+ left join ta_building_dynamic b on t.be_share = b.dynamic_id
|
|
243
|
+ where t.tagert_type = 'activity'
|
|
244
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
249
|
245
|
) t
|
250
|
246
|
group by t.target_id
|
251
|
247
|
|
|
@@ -253,20 +249,18 @@
|
253
|
249
|
|
254
|
250
|
select * from (
|
255
|
251
|
select
|
256
|
|
- t.target_id,
|
|
252
|
+ t.be_share as target_id,
|
257
|
253
|
c.list_img as activity_img,
|
258
|
254
|
c.title as activity_name,
|
259
|
255
|
'1' as price,
|
260
|
256
|
'2' as building_name,
|
261
|
257
|
'3' as address,
|
262
|
|
- t.event_type,
|
263
|
|
- t.visit_time
|
264
|
|
- from ta_person_visit_record t
|
265
|
|
- left join ta_help_activity c on t.target_id = c.help_activity_id
|
266
|
|
- where t.event_type = 'help'
|
267
|
|
- and t.consultant_id = #{userId}
|
268
|
|
- and t.org_id = #{orgId}
|
269
|
|
- and t.`event` = 'share' order by t.visit_time desc limit 9999
|
|
258
|
+ t.tagert_type as eventType,
|
|
259
|
+ t.create_date
|
|
260
|
+ from ta_share t
|
|
261
|
+ left join ta_help_activity c on t.be_share = c.help_activity_id
|
|
262
|
+ where t.tagert_type = 'help'
|
|
263
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
270
|
264
|
) t
|
271
|
265
|
group by t.target_id
|
272
|
266
|
|
|
@@ -274,41 +268,37 @@
|
274
|
268
|
|
275
|
269
|
select * from (
|
276
|
270
|
select
|
277
|
|
- t.target_id,
|
|
271
|
+ t.be_share as target_id,
|
278
|
272
|
d.list_img as activity_img,
|
279
|
273
|
d.activity_name as activity_name,
|
280
|
274
|
'1' as price,
|
281
|
275
|
'2' as building_name,
|
282
|
276
|
'3' as address,
|
283
|
|
- t.event_type,
|
284
|
|
- t.visit_time
|
285
|
|
- from ta_person_visit_record t
|
286
|
|
- left join ta_share_activity d on t.target_id = d.group_activity_id
|
287
|
|
- where t.event_type = 'group'
|
288
|
|
- and t.consultant_id = #{userId}
|
289
|
|
- and t.org_id = #{orgId}
|
290
|
|
- and t.`event` = 'share'
|
291
|
|
- group by t.target_id order by t.visit_time desc limit 9999
|
|
277
|
+ t.tagert_type as eventType,
|
|
278
|
+ t.create_date
|
|
279
|
+ from ta_share t
|
|
280
|
+ left join ta_share_activity d on t.be_share = d.group_activity_id
|
|
281
|
+ where t.tagert_type = 'group'
|
|
282
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
292
|
283
|
) t
|
|
284
|
+ group by t.target_id
|
293
|
285
|
|
294
|
286
|
union all
|
295
|
287
|
|
296
|
288
|
select * from (
|
297
|
289
|
select
|
298
|
|
- t.target_id,
|
|
290
|
+ t.be_share as target_id,
|
299
|
291
|
e.news_img as activity_img,
|
300
|
292
|
e.news_name as activity_name,
|
301
|
293
|
'1' as price,
|
302
|
294
|
'2' as building_name,
|
303
|
295
|
'3' as address,
|
304
|
|
- t.event_type,
|
305
|
|
- t.visit_time
|
306
|
|
- from ta_person_visit_record t
|
307
|
|
- left join ta_news e on t.target_id = e.news_id
|
308
|
|
- where t.event_type = 'news'
|
309
|
|
- and t.consultant_id = #{userId}
|
310
|
|
- and t.org_id = #{orgId}
|
311
|
|
- and t.`event` = 'share' order by t.visit_time desc limit 9999
|
|
296
|
+ t.tagert_type as eventType,
|
|
297
|
+ t.create_date
|
|
298
|
+ from ta_share t
|
|
299
|
+ left join ta_news e on t.be_share = e.news_id
|
|
300
|
+ where t.tagert_type = 'news'
|
|
301
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
312
|
302
|
) t
|
313
|
303
|
group by t.target_id
|
314
|
304
|
|
|
@@ -316,35 +306,31 @@
|
316
|
306
|
|
317
|
307
|
select * from (
|
318
|
308
|
select
|
319
|
|
- t.target_id,
|
|
309
|
+ t.be_share as target_id,
|
320
|
310
|
f.share_img as activity_img,
|
321
|
311
|
f.`name` as activity_name,
|
322
|
312
|
'1' as price,
|
323
|
313
|
'2' as building_name,
|
324
|
314
|
'3' as address,
|
325
|
|
- t.event_type,
|
326
|
|
- t.visit_time
|
327
|
|
- from ta_person_visit_record t
|
328
|
|
- left join ta_drainage f on t.target_id = f.drainage_id
|
329
|
|
- where t.event_type = 'h5'
|
330
|
|
- and t.consultant_id = #{userId}
|
331
|
|
- and t.org_id = #{orgId}
|
332
|
|
- and t.`event` = 'share' order by t.visit_time desc limit 9999
|
|
315
|
+ t.tagert_type as eventType,
|
|
316
|
+ t.create_date
|
|
317
|
+ from ta_share t
|
|
318
|
+ left join ta_drainage f on t.be_share = f.drainage_id
|
|
319
|
+ where t.tagert_type = 'h5'
|
|
320
|
+ and t.person_id = #{personId} order by t.create_date desc limit 9999
|
333
|
321
|
) t
|
334
|
322
|
group by t.target_id
|
335
|
323
|
) t
|
336
|
|
- order by t.visit_time desc
|
|
324
|
+ order by t.create_date desc
|
337
|
325
|
</select>
|
338
|
326
|
|
339
|
327
|
<select id="countShareNumByEventType" resultType="java.lang.Integer">
|
340
|
|
- select count(DISTINCT t.person_id) from ta_person_visit_record t
|
|
328
|
+ select count(DISTINCT t.person_id) from ta_share_person_from t
|
341
|
329
|
where
|
342
|
|
- t.consultant_id = #{userId}
|
343
|
|
- and t.org_id = #{orgId}
|
344
|
|
- and t.event_type = #{eventType}
|
|
330
|
+ t.share_person = #{userId}
|
|
331
|
+ and t.target_type = #{eventType}
|
345
|
332
|
and t.target_id = #{targetId}
|
346
|
|
- and t.person_id != t.share_person_id
|
347
|
|
- group by t.event_type
|
|
333
|
+ group by t.target_type
|
348
|
334
|
</select>
|
349
|
335
|
|
350
|
336
|
</mapper>
|