|
|
@@ -89,20 +89,19 @@
|
|
|
as intention
|
|
|
from (select relation_id
|
|
|
from `corp_user_tag` ct
|
|
|
- where tag_id = #{tagIdStr}
|
|
|
- group by relation_id
|
|
|
- <if test="thisDate != null">
|
|
|
- having date_format(min(ct.created_time),'%Y-%m-%d') = #{thisDate}
|
|
|
- </if>) s
|
|
|
+ where tag_id = #{tagIdStr}) s
|
|
|
left join corp_user_follow_relation cufr on cufr.id = s.relation_id
|
|
|
left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
|
|
|
left join corp_user cu on cu.id = ca.corp_user_id
|
|
|
- inner join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
|
|
|
+ inner join corp_user_pay_intention ccc on ccc.union_id = cu.unionid
|
|
|
+ <if test="thisDate != null">
|
|
|
+ and date_format(cu.created_time,'%Y-%m-%d') = #{thisDate}
|
|
|
+ </if>
|
|
|
group by ccc.intention
|
|
|
</select>
|
|
|
|
|
|
<select id="getCorpUserIntentionView" resultType="com.cyksj.model.views.CorpUserIntentionView">
|
|
|
- select cu.user_id,cu.name as nickname,cu.created_time,ccc.id as intentionId,ccc.intention
|
|
|
+ select cu.user_id,cu.name as nickname,cu.created_time,ccc2.id as intentionId,ccc.intention
|
|
|
from (select distinct cu.*
|
|
|
from (select DISTINCT relation_id from corp_user_tag where tag_id = #{tagIdStr}) ct
|
|
|
inner join corp_user_follow_relation cufr on cufr.id = ct.relation_id
|
|
|
@@ -112,7 +111,8 @@
|
|
|
where date_format(cu.created_time,'%Y-%m-%d') = #{thisDate}
|
|
|
</if>
|
|
|
) cu
|
|
|
- left join corp_customer_acquistion_callback ccc on ccc.union_id = cu.unionid
|
|
|
+ left join corp_user_pay_intention ccc on ccc.union_id = cu.unionid
|
|
|
+ left join corp_customer_acquistion_callback ccc2 on ccc2.union_id = cu.unionid
|
|
|
<where>
|
|
|
<if test="userId != null">
|
|
|
cu.user_id = #{userId}
|