|
@@ -164,11 +164,9 @@
|
164
|
164
|
or ( e.target_type = 'share' and e.target_id = 'index' )
|
165
|
165
|
)
|
166
|
166
|
AND e.create_date BETWEEN #{startDate} and #{endDate}
|
167
|
|
- <!-- building_id 字段数据不全
|
168
|
167
|
<if test="buildingId != null and buildingId !=''">
|
169
|
168
|
AND e.building_id = #{buildingId}
|
170
|
169
|
</if>
|
171
|
|
- -->
|
172
|
170
|
AND e.is_first_time = 1
|
173
|
171
|
|
174
|
172
|
AND t.phone is not null
|
|
@@ -183,7 +181,7 @@
|
183
|
181
|
SELECT
|
184
|
182
|
t.*,
|
185
|
183
|
count( * ) as visit_times,
|
186
|
|
- f.visit_time as visit_time
|
|
184
|
+ max(f.visit_time) as visit_time
|
187
|
185
|
FROM
|
188
|
186
|
ta_person t
|
189
|
187
|
INNER JOIN ta_person_visit_record f ON f.org_id = #{orgId} AND f.person_id = t.person_id
|
|
@@ -235,7 +233,7 @@
|
235
|
233
|
<select id="getConsultantChatPersons" resultType="com.huiju.estateagents.entity.TaPerson">
|
236
|
234
|
SELECT
|
237
|
235
|
t.*,
|
238
|
|
- h.create_date AS visit_time
|
|
236
|
+ max(h.create_date) AS visit_time
|
239
|
237
|
FROM
|
240
|
238
|
ta_person t
|
241
|
239
|
INNER JOIN ta_chat h ON h.send_person = t.person_id
|
|
@@ -298,7 +296,10 @@
|
298
|
296
|
OR t.tagert_type like 'live%'
|
299
|
297
|
)
|
300
|
298
|
</if>
|
301
|
|
- <if test="targetType != null and targetType !=''">
|
|
299
|
+ <if test="targetType != null and targetType =='card_share'">
|
|
300
|
+ AND t.tagert_type = 'consultant'
|
|
301
|
+ </if>
|
|
302
|
+ <if test="targetType != null and targetType !='' and targetType != 'card_share'">
|
302
|
303
|
AND t.tagert_type like concat(#{targetType}, '%')
|
303
|
304
|
</if>
|
304
|
305
|
|
|
@@ -317,7 +318,7 @@
|
317
|
318
|
SELECT
|
318
|
319
|
t.*,
|
319
|
320
|
count(*) as visit_times,
|
320
|
|
- e.create_date as visit_time
|
|
321
|
+ max(e.create_date) as visit_time
|
321
|
322
|
FROM ta_share_person_from e
|
322
|
323
|
INNER JOIN ta_person t ON t.person_id = e.person_id
|
323
|
324
|
WHERE e.org_id = #{orgId}
|
|
@@ -327,11 +328,11 @@
|
327
|
328
|
e.target_type IN ( 'card_share', 'building_share', 'dynamic_share', 'group_share', 'h5_share', 'help_share', 'house_share', 'live_share', 'news_share', 'poster' )
|
328
|
329
|
OR ( e.target_type = 'share' AND e.target_id = 'index' )
|
329
|
330
|
)
|
330
|
|
- <!-- building_id 字段数据不全
|
331
|
|
- <if test="buildingId != null and buildingId !=''">
|
332
|
|
- AND e.building_id = #{buildingId}
|
333
|
|
- </if>
|
334
|
|
- -->
|
|
331
|
+
|
|
332
|
+ <if test="buildingId != null and buildingId !=''">
|
|
333
|
+ AND e.building_id = #{buildingId}
|
|
334
|
+ </if>
|
|
335
|
+
|
335
|
336
|
<!-- AND t.`status` = 1-->
|
336
|
337
|
GROUP BY t.person_id, DATE_FORMAT(e.create_date, '%Y%m%d')
|
337
|
338
|
ORDER BY e.create_date DESC
|
|
@@ -368,11 +369,10 @@
|
368
|
369
|
</if>
|
369
|
370
|
|
370
|
371
|
AND e.create_date BETWEEN #{startDate} and #{endDate}
|
371
|
|
- <!-- building_id 字段数据不全
|
372
|
|
- <if test="buildingId != null and buildingId !=''">
|
373
|
|
- AND e.building_id = #{buildingId}
|
374
|
|
- </if>
|
375
|
|
- -->
|
|
372
|
+
|
|
373
|
+ <if test="buildingId != null and buildingId !=''">
|
|
374
|
+ AND e.building_id = #{buildingId}
|
|
375
|
+ </if>
|
376
|
376
|
|
377
|
377
|
<if test="personId != null and personId !=''">
|
378
|
378
|
AND t.person_id = #{personId}
|