魏超 5 years ago
parent
commit
d6b3144dd4
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/main/resources/mapper/TaPersonVisitRecordMapper.xml

+ 6
- 0
src/main/resources/mapper/TaPersonVisitRecordMapper.xml View File

196
         and t.consultant_id = #{userId}
196
         and t.consultant_id = #{userId}
197
         and t.org_id = #{orgId}
197
         and t.org_id = #{orgId}
198
         and t.`event` = 'share'
198
         and t.`event` = 'share'
199
+        group by t.target_id
199
         order by t.visit_time desc
200
         order by t.visit_time desc
200
 
201
 
201
         union all
202
         union all
213
         and t.consultant_id = #{userId}
214
         and t.consultant_id = #{userId}
214
         and t.org_id = #{orgId}
215
         and t.org_id = #{orgId}
215
         and t.`event` = 'share'
216
         and t.`event` = 'share'
217
+        group by t.target_id
216
         order by t.visit_time desc
218
         order by t.visit_time desc
217
 
219
 
218
         union all
220
         union all
230
         and t.consultant_id = #{userId}
232
         and t.consultant_id = #{userId}
231
         and t.org_id = #{orgId}
233
         and t.org_id = #{orgId}
232
         and t.`event` = 'share'
234
         and t.`event` = 'share'
235
+        group by t.target_id
233
         order by t.visit_time desc
236
         order by t.visit_time desc
234
 
237
 
235
         union all
238
         union all
247
         and t.consultant_id = #{userId}
250
         and t.consultant_id = #{userId}
248
         and t.org_id = #{orgId}
251
         and t.org_id = #{orgId}
249
         and t.`event` = 'share'
252
         and t.`event` = 'share'
253
+        group by t.target_id
250
         order by t.visit_time desc
254
         order by t.visit_time desc
251
 
255
 
252
         union all
256
         union all
263
         where t.event_type = 'news'
267
         where t.event_type = 'news'
264
         and t.consultant_id = #{userId}
268
         and t.consultant_id = #{userId}
265
         and t.org_id = #{orgId}
269
         and t.org_id = #{orgId}
270
+        group by t.target_id
266
         and t.`event` = 'share'
271
         and t.`event` = 'share'
267
         order by t.visit_time desc
272
         order by t.visit_time desc
268
 
273
 
281
         and t.consultant_id = #{userId}
286
         and t.consultant_id = #{userId}
282
         and t.org_id = #{orgId}
287
         and t.org_id = #{orgId}
283
         and t.`event` = 'share'
288
         and t.`event` = 'share'
289
+        group by t.target_id
284
         order by t.visit_time desc
290
         order by t.visit_time desc
285
     </select>
291
     </select>
286
 
292