|
@@ -13,6 +13,9 @@
|
13
|
13
|
tpvr.person_type as personType,
|
14
|
14
|
tpvr.building_id as buildingId,
|
15
|
15
|
tpvr.activity as activity,
|
|
16
|
+ tpvr.event as event,
|
|
17
|
+ tpvr.event_type as eventType,
|
|
18
|
+ tpvr.visit_duration as visitDuration,
|
16
|
19
|
(SELECT MIN(t.visit_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event ) as visitTime,
|
17
|
20
|
(SELECT MAX(t.leave_time) FROM ta_person_visit_record t WHERE t.person_id = tpvr.person_id and t.event = tpvr.event ) as leaveTime,
|
18
|
21
|
ifnull(tp.name, tp.nickname) as userName,
|
|
@@ -23,6 +26,9 @@
|
23
|
26
|
LEFT JOIN ta_person tp ON tpvr.person_id = tp.person_id
|
24
|
27
|
LEFT JOIN td_biz_event tbe on tpvr.event = tbe.event_code
|
25
|
28
|
<trim prefix="where" prefixOverrides="and | or">
|
|
29
|
+ <if test="startDate != null and endDate != null">
|
|
30
|
+ and tpvr.visit_time between #{startDate} and #{endDate}
|
|
31
|
+ </if>
|
26
|
32
|
<if test="buildingId != null and buildingId != ''">
|
27
|
33
|
and tpvr.building_id = #{buildingId}
|
28
|
34
|
</if>
|