|
|
@@ -560,8 +560,8 @@
|
|
|
</select>
|
|
|
<select id="selectSignOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
|
|
|
select
|
|
|
- t0.buyer_id as uid,
|
|
|
- t0.last_sign_time as lastSignTime,
|
|
|
+ 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,
|
|
|
@@ -575,14 +575,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,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 = 1)t2
|
|
|
- on t0.buyer_id = t2.id
|
|
|
- left join organization_identity b on t0.buyer_id = b.uid
|
|
|
+ on t0.uid = t2.id
|
|
|
+ left join organization_identity b on t0.uid = b.uid
|
|
|
left join district_glossory dg1 on b.location_province = dg1.id
|
|
|
left join district_glossory dg2 on b.location_city = dg2.id
|
|
|
left join district_glossory dg3 on b.location_area = dg3.id
|
|
|
@@ -619,11 +622,14 @@
|
|
|
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
|
|
|
inner join
|
|
|
(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 1)t2
|
|
|
- on t0.buyer_id = t2.id
|
|
|
- left join organization_identity b on t0.buyer_id = b.uid where 1 = 1
|
|
|
+ on t0.uid = t2.id
|
|
|
+ left join organization_identity b on t0.uid = b.uid where 1 = 1
|
|
|
<if test="name != null and name != ''">
|
|
|
and t2.identify_name like concat('%',#{name},'%')
|
|
|
</if>
|