|
@@ -185,6 +185,7 @@
|
185
|
185
|
<select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
|
186
|
186
|
select * From (
|
187
|
187
|
select
|
|
188
|
+ t.target_id,
|
188
|
189
|
a.url as activity_img,
|
189
|
190
|
a.building_name as activity_name,
|
190
|
191
|
a.building_name,
|
|
@@ -203,6 +204,7 @@
|
203
|
204
|
union all
|
204
|
205
|
|
205
|
206
|
select
|
|
207
|
+ t.target_id,
|
206
|
208
|
b.list_img_url as activity_img,
|
207
|
209
|
b.title as activity_name,
|
208
|
210
|
'1' as price,
|
|
@@ -221,6 +223,7 @@
|
221
|
223
|
union all
|
222
|
224
|
|
223
|
225
|
select
|
|
226
|
+ t.target_id,
|
224
|
227
|
c.list_img as activity_img,
|
225
|
228
|
c.title as activity_name,
|
226
|
229
|
'1' as price,
|
|
@@ -239,6 +242,7 @@
|
239
|
242
|
union all
|
240
|
243
|
|
241
|
244
|
select
|
|
245
|
+ t.target_id,
|
242
|
246
|
d.list_img as activity_img,
|
243
|
247
|
d.activity_name as activity_name,
|
244
|
248
|
'1' as price,
|
|
@@ -257,6 +261,7 @@
|
257
|
261
|
union all
|
258
|
262
|
|
259
|
263
|
select
|
|
264
|
+ t.target_id,
|
260
|
265
|
e.news_img as activity_img,
|
261
|
266
|
e.news_name as activity_name,
|
262
|
267
|
'1' as price,
|
|
@@ -275,6 +280,7 @@
|
275
|
280
|
union all
|
276
|
281
|
|
277
|
282
|
select
|
|
283
|
+ t.target_id,
|
278
|
284
|
f.share_img as activity_img,
|
279
|
285
|
f.`name` as activity_name,
|
280
|
286
|
'1' as price,
|
|
@@ -292,14 +298,16 @@
|
292
|
298
|
</select>
|
293
|
299
|
|
294
|
300
|
<select id="countShareNumByEventType" resultType="java.lang.Integer">
|
295
|
|
- select count(*) from ta_person_visit_record t
|
296
|
|
- where
|
297
|
|
- t.consultant_id = #{userId}
|
298
|
|
- and t.org_id = #{orgId}
|
299
|
|
- and t.event_type = #{eventType}
|
300
|
|
- and t.target_id = #{targetId}
|
301
|
|
- and t.person_id != t.share_person_id
|
302
|
|
- group by t.event_type, person_id
|
|
301
|
+ select count(1) from (
|
|
302
|
+ SELECT
|
|
303
|
+ t.*
|
|
304
|
+ FROM
|
|
305
|
+ ( SELECT t.* FROM ta_person_visit_record t WHERE org_id = #{orgId} and target_id = #{targetId} AND consultant_id = #{userId} and person_id != #{personId} and t.event_type = #{eventType} ORDER BY visit_time DESC LIMIT 999) t
|
|
306
|
+ left JOIN ta_person p on t.person_id = p.person_id
|
|
307
|
+ GROUP BY
|
|
308
|
+ t.person_id
|
|
309
|
+ ORDER BY
|
|
310
|
+ t.visit_time DESC ) t;
|
303
|
311
|
</select>
|
304
|
312
|
|
305
|
313
|
</mapper>
|