|
@@ -180,35 +180,106 @@
|
180
|
180
|
|
181
|
181
|
<select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
|
182
|
182
|
select
|
183
|
|
- t.target_id,
|
184
|
|
- t.event_type as share_type,
|
185
|
|
- a.url as building_img,
|
186
|
|
- a.building_name,
|
187
|
|
- a.address,
|
188
|
|
- a.price,
|
189
|
|
- b.list_img_url as activity_img,
|
190
|
|
- b.title as activity_name,
|
191
|
|
- c.list_img as help_activity_img,
|
192
|
|
- c.title as help_activity_name,
|
193
|
|
- d.list_img as group_activity_img,
|
194
|
|
- d.activity_name as group_activity_name,
|
195
|
|
- e.news_img,
|
196
|
|
- e.news_name,
|
197
|
|
- f.share_img as drainage_img,
|
198
|
|
- f.`name` as drainage_name
|
199
|
|
- From ta_person_visit_record t
|
|
183
|
+ a.url as activity_img,
|
|
184
|
+ a.building_name as activity_name,
|
|
185
|
+ a.building_name,
|
|
186
|
+ a.address,
|
|
187
|
+ a.price,
|
|
188
|
+ t.event_type
|
|
189
|
+ from ta_person_visit_record t
|
200
|
190
|
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
|
|
191
|
+ where t.event_type = 'building'
|
|
192
|
+ and t.consultant_id = #{userId}
|
|
193
|
+ and t.org_id = #{orgId}
|
|
194
|
+ and t.`event` = 'share'
|
|
195
|
+ order by t.visit_time desc
|
|
196
|
+
|
|
197
|
+ union all
|
|
198
|
+
|
|
199
|
+ select
|
|
200
|
+ b.list_img_url as activity_img,
|
|
201
|
+ b.title as activity_name,
|
|
202
|
+ '1' as price,
|
|
203
|
+ '2' as building_name,
|
|
204
|
+ '3' as address,
|
|
205
|
+ t.event_type
|
|
206
|
+ from ta_person_visit_record t
|
201
|
207
|
left join ta_building_dynamic b on t.target_id = b.dynamic_id
|
|
208
|
+ where t.event_type = 'activity'
|
|
209
|
+ and t.consultant_id = #{userId}
|
|
210
|
+ and t.org_id = #{orgId}
|
|
211
|
+ and t.`event` = 'share'
|
|
212
|
+ order by t.visit_time desc
|
|
213
|
+
|
|
214
|
+ union all
|
|
215
|
+
|
|
216
|
+ select
|
|
217
|
+ c.list_img as activity_img,
|
|
218
|
+ c.title as activity_name,
|
|
219
|
+ '1' as price,
|
|
220
|
+ '2' as building_name,
|
|
221
|
+ '3' as address,
|
|
222
|
+ t.event_type
|
|
223
|
+ from ta_person_visit_record t
|
202
|
224
|
left join ta_help_activity c on t.target_id = c.help_activity_id
|
|
225
|
+ where t.event_type = 'help'
|
|
226
|
+ and t.consultant_id = #{userId}
|
|
227
|
+ and t.org_id = #{orgId}
|
|
228
|
+ and t.`event` = 'share'
|
|
229
|
+ order by t.visit_time desc
|
|
230
|
+
|
|
231
|
+ union all
|
|
232
|
+
|
|
233
|
+ select
|
|
234
|
+ d.list_img as activity_img,
|
|
235
|
+ d.activity_name as activity_name,
|
|
236
|
+ '1' as price,
|
|
237
|
+ '2' as building_name,
|
|
238
|
+ '3' as address,
|
|
239
|
+ t.event_type
|
|
240
|
+ from ta_person_visit_record t
|
203
|
241
|
left join ta_share_activity d on t.target_id = d.group_activity_id
|
|
242
|
+ where t.event_type = 'group'
|
|
243
|
+ and t.consultant_id = #{userId}
|
|
244
|
+ and t.org_id = #{orgId}
|
|
245
|
+ and t.`event` = 'share'
|
|
246
|
+ order by t.visit_time desc
|
|
247
|
+
|
|
248
|
+ union all
|
|
249
|
+
|
|
250
|
+ select
|
|
251
|
+ e.news_img as activity_img,
|
|
252
|
+ e.news_name,
|
|
253
|
+ '1' as price,
|
|
254
|
+ '2' as building_name,
|
|
255
|
+ '3' as address,
|
|
256
|
+ t.event_type
|
|
257
|
+ from ta_person_visit_record t
|
204
|
258
|
left join ta_news e on t.target_id = e.news_id
|
|
259
|
+ where t.event_type = 'news'
|
|
260
|
+ and t.consultant_id = #{userId}
|
|
261
|
+ and t.org_id = #{orgId}
|
|
262
|
+ and t.`event` = 'share'
|
|
263
|
+ order by t.visit_time desc
|
|
264
|
+
|
|
265
|
+ union all
|
|
266
|
+
|
|
267
|
+ select
|
|
268
|
+ f.share_img as drainage_img,
|
|
269
|
+ f.`name` as drainage_name,
|
|
270
|
+ '1' as price,
|
|
271
|
+ '2' as building_name,
|
|
272
|
+ '3' as address,
|
|
273
|
+ t.event_type
|
|
274
|
+ from ta_person_visit_record t
|
205
|
275
|
left join ta_drainage f on t.target_id = f.drainage_id
|
206
|
|
- where
|
207
|
|
- t.consultant_id = #{userId}
|
|
276
|
+ where t.event_type = 'h5'
|
|
277
|
+ and t.consultant_id = #{userId}
|
208
|
278
|
and t.org_id = #{orgId}
|
209
|
279
|
and t.`event` = 'share'
|
210
|
280
|
order by t.visit_time desc
|
211
|
281
|
</select>
|
|
282
|
+
|
212
|
283
|
<select id="countShareNumByEventType" resultType="java.lang.Integer">
|
213
|
284
|
select count(*) from ta_person_visit_record t
|
214
|
285
|
where
|
|
@@ -220,20 +291,4 @@
|
220
|
291
|
group by t.event_type, person_id
|
221
|
292
|
</select>
|
222
|
293
|
|
223
|
|
- <select id="getSharePersonList" resultType="com.huiju.estateagents.entity.TaPerson">
|
224
|
|
- select
|
225
|
|
- t.person_type,
|
226
|
|
- t.avatarurl,
|
227
|
|
- t.nickname,
|
228
|
|
- a.visit_time
|
229
|
|
- from ta_person t
|
230
|
|
- left join ta_person_visit_record a on t.person_id = a.person_id
|
231
|
|
- where
|
232
|
|
- a.org_id = #{orgId}
|
233
|
|
- and a.target_id = #{targetId}
|
234
|
|
- and a.consultant_id = #{userId}
|
235
|
|
- and a.person_id != a.share_person_id
|
236
|
|
- group by a.person_id order by a.visit_time desc
|
237
|
|
- </select>
|
238
|
|
-
|
239
|
294
|
</mapper>
|