|
@@ -191,29 +191,30 @@ FROM
|
191
|
191
|
) AS temp_date
|
192
|
192
|
|
193
|
193
|
LEFT JOIN (
|
194
|
|
- SELECT
|
195
|
|
- COUNT(1) as activityCount,
|
196
|
|
- tpvr.event_type,
|
197
|
|
- DATE_FORMAT( tpvr.visit_time , '%Y-%m-%d' ) as date
|
198
|
|
- FROM
|
199
|
|
- ta_person tp
|
200
|
|
- INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
201
|
|
- where ifnull(tp.person_type, '') != #{personType}
|
202
|
|
- <if test="buildingId != null and buildingId != ''">
|
203
|
|
- and tpvr.building_id = #{buildingId}
|
204
|
|
- </if>
|
205
|
|
- <if test="eventType != null and eventType != ''">
|
206
|
|
- and tpvr.event_type = #{eventType}
|
207
|
|
- </if>
|
208
|
|
- <if test="event != null and event != ''">
|
209
|
|
- and tpvr.event = #{event}
|
210
|
|
- </if>
|
211
|
|
- <if test="activity != null and activity != ''">
|
212
|
|
- and tpvr.activity = #{activity}
|
213
|
|
- </if>
|
|
194
|
+ SELECT
|
|
195
|
+ COUNT(1) as activityCount,
|
|
196
|
+ tpvr.event_type,
|
|
197
|
+ DATE_FORMAT( tpvr.visit_time , '%Y-%m-%d' ) as date
|
|
198
|
+ FROM
|
|
199
|
+ ta_person tp
|
|
200
|
+ INNER JOIN ta_person_visit_record tpvr ON tp.person_id = tpvr.person_id
|
|
201
|
+ where ifnull(tp.person_type, '') != #{personType}
|
|
202
|
+ <if test="buildingId != null and buildingId != ''">
|
|
203
|
+ and tpvr.building_id = #{buildingId}
|
|
204
|
+ </if>
|
|
205
|
+ <if test="eventType != null and eventType != ''">
|
|
206
|
+ and tpvr.event_type = #{eventType}
|
|
207
|
+ </if>
|
|
208
|
+ <if test="event != null and event != ''">
|
|
209
|
+ and tpvr.event = #{event}
|
|
210
|
+ </if>
|
|
211
|
+ <if test="activity != null and activity != ''">
|
|
212
|
+ and tpvr.activity = #{activity}
|
|
213
|
+ </if>
|
214
|
214
|
|
215
|
|
- GROUP BY tpvr.event_type, DATE_FORMAT( tpvr.visit_time , '%Y-%m-%d' )
|
|
215
|
+ GROUP BY tpvr.event_type, DATE_FORMAT( tpvr.visit_time , '%Y-%m-%d' )
|
216
|
216
|
) AS temp ON temp_date.date = temp.date and temp_date.type_id = temp.event_type
|
|
217
|
+ order by temp.date asc
|
217
|
218
|
</select>
|
218
|
219
|
|
219
|
220
|
<select id="selectActiveUserCount" resultType="map">
|