|
@@ -158,6 +158,10 @@
|
158
|
158
|
INNER JOIN ta_person t ON t.person_id = e.person_id
|
159
|
159
|
WHERE e.org_id = #{orgId}
|
160
|
160
|
AND e.share_person = #{userId}
|
|
161
|
+ AND (
|
|
162
|
+ e.target_type IN ( 'building_share', 'dynamic_share', 'group_share', 'h5_share', 'help_share', 'house_share', 'live_share', 'news_share', 'poster' )
|
|
163
|
+ or ( e.target_type = 'share' and e.target_id = 'index' )
|
|
164
|
+ )m
|
161
|
165
|
AND e.create_date BETWEEN #{startDate} and #{endDate}
|
162
|
166
|
<!-- building_id 字段数据不全
|
163
|
167
|
<if test="buildingId != null and buildingId !=''">
|
|
@@ -167,6 +171,7 @@
|
167
|
171
|
AND e.is_first_time = 1
|
168
|
172
|
|
169
|
173
|
AND t.phone is not null
|
|
174
|
+ AND t.person_type != 'Realty Consultant'
|
170
|
175
|
|
171
|
176
|
<!-- 为了与存储过程一致 -->
|
172
|
177
|
<!-- AND t.`status` = 1-->
|
|
@@ -177,7 +182,7 @@
|
177
|
182
|
SELECT
|
178
|
183
|
t.*,
|
179
|
184
|
count( * ) as visit_times,
|
180
|
|
- MAX(f.visit_time) as visit_time
|
|
185
|
+ f.visit_time as visit_time
|
181
|
186
|
FROM
|
182
|
187
|
ta_person t
|
183
|
188
|
INNER JOIN ta_person_visit_record f ON f.org_id = #{orgId} AND f.person_id = t.person_id
|
|
@@ -195,8 +200,8 @@
|
195
|
200
|
|
196
|
201
|
<!-- 为了与存储过程一致 -->
|
197
|
202
|
<!-- AND s.`status` = 1-->
|
198
|
|
- GROUP BY t.person_id, DATE_FORMAT(t.create_date, '%Y%m%d')
|
199
|
|
- ORDER BY t.create_date DESC
|
|
203
|
+ GROUP BY t.person_id, DATE_FORMAT(f.visit_time, '%Y%m%d')
|
|
204
|
+ ORDER BY f.visit_time DESC
|
200
|
205
|
</select>
|
201
|
206
|
|
202
|
207
|
<select id="getConsultantHomePageTimes" resultType="com.huiju.estateagents.entity.TaPerson">
|
|
@@ -229,7 +234,7 @@
|
229
|
234
|
<select id="getConsultantChatPersons" resultType="com.huiju.estateagents.entity.TaPerson">
|
230
|
235
|
SELECT
|
231
|
236
|
t.*,
|
232
|
|
- max( h.create_date ) AS visit_time
|
|
237
|
+ h.create_date AS visit_time
|
233
|
238
|
FROM
|
234
|
239
|
ta_person t
|
235
|
240
|
INNER JOIN ta_chat h ON h.send_person = t.person_id
|
|
@@ -311,12 +316,16 @@
|
311
|
316
|
SELECT
|
312
|
317
|
t.*,
|
313
|
318
|
count(*) as visit_times,
|
314
|
|
- max(e.create_date) as visit_time
|
|
319
|
+ e.create_date as visit_time
|
315
|
320
|
FROM ta_share_person_from e
|
316
|
321
|
INNER JOIN ta_person t ON t.person_id = e.person_id
|
317
|
322
|
WHERE e.org_id = #{orgId}
|
318
|
323
|
AND e.share_person = #{userId}
|
319
|
324
|
AND e.create_date BETWEEN #{startDate} and #{endDate}
|
|
325
|
+ AND (
|
|
326
|
+ e.target_type IN ( 'building_share', 'dynamic_share', 'group_share', 'h5_share', 'help_share', 'house_share', 'live_share', 'news_share', 'poster' )
|
|
327
|
+ OR ( e.target_type = 'share' AND e.target_id = 'index' )
|
|
328
|
+ )
|
320
|
329
|
<!-- building_id 字段数据不全
|
321
|
330
|
<if test="buildingId != null and buildingId !=''">
|
322
|
331
|
AND e.building_id = #{buildingId}
|