|
|
@@ -227,9 +227,9 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectSignPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
- select
|
|
|
- t0.buyer_id as uid,
|
|
|
- t0.last_sign_time as lastSignTime,
|
|
|
+ select
|
|
|
+ t0.uid as uid,
|
|
|
+ t0.update_time as lastSignTime,
|
|
|
t1.last_follow_time as lastFollowTime,
|
|
|
t2.society_tag as societyTag,
|
|
|
t2.identify_name as name,
|
|
|
@@ -243,15 +243,17 @@
|
|
|
c.name as industry,
|
|
|
d.name as adminName
|
|
|
from
|
|
|
- (select buyer_id,salesman_id,max(sign_time) as last_sign_time from t_order where salesman_id = #{aid} and order_status = 3 and delete_sign != 1 group by buyer_id)t0
|
|
|
- <!-- (select uid,max(lock_time) from user_lock_release where aid = #{aid} and type = 1 and status = 0 group by uid)t0 -->
|
|
|
+ (select uid,aid,max(update_time) as update_time
|
|
|
+ from user_business
|
|
|
+ where follow_situation=5 and aid=1
|
|
|
+ group by uid)t0
|
|
|
left join
|
|
|
- (select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
|
|
|
- on t0.buyer_id = t1.uid
|
|
|
+ (select uid,aid,max(create_time) as last_follow_time from user_follow where aid ='1' group by uid)t1
|
|
|
+ on t0.uid = t1.uid
|
|
|
inner join
|
|
|
(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 0 and status != 1)t2
|
|
|
- on t0.buyer_id = t2.id
|
|
|
- left join user_identity b on t0.buyer_id = b.uid
|
|
|
+ on t0.uid = t2.id
|
|
|
+ left join user_identity b on t0.uid = b.uid
|
|
|
left join district_glossory dg1 on b.province = dg1.id
|
|
|
left join district_glossory dg2 on b.city = dg2.id
|
|
|
left join district_glossory dg3 on b.area = dg3.id
|
|
|
@@ -286,7 +288,10 @@
|
|
|
select
|
|
|
count(0)
|
|
|
from
|
|
|
- (select buyer_id,salesman_id,max(sign_time) as last_sign_time from t_order where salesman_id = #{aid} and order_status = 3 and delete_sign != 1 group by buyer_id)t0
|
|
|
+ (select uid,aid,max(update_time) as update_time
|
|
|
+ from user_business
|
|
|
+ where follow_situation=5 and aid=1
|
|
|
+ group by uid)t0
|
|
|
<!-- (select uid,max(lock_time) from user_lock_release where aid = #{aid} and type = 1 and status = 0 group by uid)t0 -->
|
|
|
inner join
|
|
|
(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 0 and status != 1)t2
|