|
|
@@ -4,15 +4,17 @@
|
|
|
|
|
|
|
|
|
<insert id="replaceBytedanceAdvertiserLists">
|
|
|
- INSERT into deepthink.bytedance_advertiser_list(
|
|
|
+ INSERT into nuojing_data.media_advertiser_account(
|
|
|
+ media_type,
|
|
|
admin_advertiser_id,
|
|
|
advertiser_id,
|
|
|
advertiser_name,
|
|
|
- advertiser_type
|
|
|
+ account_role
|
|
|
)
|
|
|
values
|
|
|
<foreach collection="adds" item="add" separator=",">
|
|
|
(
|
|
|
+ 1,
|
|
|
#{add.adminAdvertiserId},
|
|
|
#{add.advertiserId},
|
|
|
#{add.advertiserName},
|
|
|
@@ -20,7 +22,8 @@
|
|
|
)
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
- advertiser_name= VALUES(advertiser_name)
|
|
|
+ advertiser_name= VALUES(advertiser_name),
|
|
|
+ account_role= VALUES(account_role)
|
|
|
</insert>
|
|
|
<insert id="addAgentList">
|
|
|
replace into deepthink.bytedance_agent_advertiser_list(
|
|
|
@@ -82,8 +85,8 @@
|
|
|
<select id="getAdvertiserInfos" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT t1.advertiser_id AS 'advertiserId', t2.advertiser_name AS 'advertiserName'
|
|
|
FROM deepthink.advertiser_bind_info t1
|
|
|
- LEFT JOIN deepthink.bytedance_advertiser_list t2
|
|
|
- ON t1.advertiser_id = t2.advertiser_id
|
|
|
+ LEFT JOIN nuojing_data.media_advertiser_account t2
|
|
|
+ ON t1.advertiser_id = t2.advertiser_id AND t2.media_type = 1
|
|
|
WHERE t1.media_type = 1
|
|
|
AND t1.advertiser_name != t2.advertiser_name
|
|
|
</select>
|
|
|
@@ -95,31 +98,35 @@
|
|
|
WHERE stat_time_day >= 20250601
|
|
|
AND stat_time_day <= 20250603
|
|
|
GROUP BY advertiser_id) t1
|
|
|
- LEFT JOIN deepthink.bytedance_advertiser_list t2 ON t1.advertiser_id = t2.advertiser_id
|
|
|
- LEFT JOIN deepthink.bytedance_auth_list t3 ON t2.admin_advertiser_id = t3.admin_advertiser_id) t
|
|
|
+ LEFT JOIN nuojing_data.media_advertiser_account t2 ON t1.advertiser_id = t2.advertiser_id AND t2.media_type = 1
|
|
|
+ LEFT JOIN nuojing_data.media_auth_account t3 ON t2.admin_advertiser_id = t3.admin_advertiser_id AND t3.media_type = 1) t
|
|
|
WHERE t.advertiserId IS NOT NULL
|
|
|
|
|
|
</select>
|
|
|
<select id="getAgentAdvertiserList" resultType="java.lang.Long">
|
|
|
select t1.advertiser_id
|
|
|
- from deepthink.bytedance_advertiser_list t1
|
|
|
+ from nuojing_data.media_advertiser_account t1
|
|
|
left join deepthink.bytedance_agent_advertiser_list t2
|
|
|
on t1.advertiser_id = t2.advertiser_id
|
|
|
|
|
|
where t1.admin_advertiser_id = #{adminAdvertiserId}
|
|
|
+ and t1.media_type = 1
|
|
|
and t2.advertiser_id is null
|
|
|
</select>
|
|
|
<select id="getAdminAdvertiserList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select admin_advertiser_id as 'adminAdvertiserId',access_token as 'accessToken'
|
|
|
- from deepthink.bytedance_auth_list
|
|
|
- group by admin_advertiser_id
|
|
|
+ SELECT admin_advertiser_id AS 'adminAdvertiserId',
|
|
|
+ ANY_VALUE(access_token) AS 'accessToken'
|
|
|
+ FROM nuojing_data.media_auth_account
|
|
|
+ WHERE media_type = 1
|
|
|
+ GROUP BY admin_advertiser_id
|
|
|
</select>
|
|
|
<select id="getNotAgentAdvertiserList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
select t1.advertiser_id as 'advertiserId', t1.admin_advertiser_id as 'adminAdvertiserId', t3.access_token as 'accessToken'
|
|
|
- from deepthink.bytedance_advertiser_list t1
|
|
|
+ from nuojing_data.media_advertiser_account t1
|
|
|
left join deepthink.bytedance_agent_advertiser_list t2
|
|
|
on t1.advertiser_id = t2.advertiser_id
|
|
|
- left join deepthink.bytedance_auth_list t3 on t1.admin_advertiser_id = t3.admin_advertiser_id
|
|
|
- where t2.advertiser_id is null
|
|
|
+ left join nuojing_data.media_auth_account t3 on t1.admin_advertiser_id = t3.admin_advertiser_id AND t3.media_type = 1
|
|
|
+ where t1.media_type = 1
|
|
|
+ and t2.advertiser_id is null
|
|
|
</select>
|
|
|
</mapper>
|