魏超 5 years ago
parent
commit
55799120e9

+ 1
- 1
src/main/java/com/huiju/estateagents/common/CommConstant.java View File

@@ -125,7 +125,7 @@ public class CommConstant {
125 125
     public final static String POINTS_CHANGE_DOCUMENT_VERIFY = "document_verify";
126 126
 
127 127
     /**
128
-     * 资料审核
128
+     * 活动签到
129 129
      */
130 130
     public final static String POINTS_CHANGE_ACTIVITY_CHECKIN = "activity_checkin";
131 131
 

+ 17
- 16
src/main/resources/mapper/TaPersonVisitRecordMapper.xml View File

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