|
@@ -107,12 +107,18 @@
|
|
|
|
|
|
<select id="channelNumberUsageDetailsList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT IFNULL((SELECT MAX(tt.create_time)
|
|
|
- FROM ctop_kuaishou_creative tt
|
|
|
- WHERE tt.unit_id = t1.unit_id),'-') as 'createTime', CASE t1.usage_range WHEN 1 THEN '账户' WHEN 2 THEN '项目' ELSE '' END as 'usageRange', IFNULL(t1.channel_code, '') as 'channelCode', IFNULL(t1.project_name, '') as 'projectName', IFNULL(t2.auth_name, '') as 'authName', IFNULL(t1.account_id, '') as 'accountId', IFNULL(t1.campaign_id, '') as 'campaignId', IFNULL(t1.unit_id, '') as 'unitId'
|
|
|
- FROM ctop_kuaishou_channel t1
|
|
|
+ FROM ctop_kuaishou_creative tt
|
|
|
+ WHERE tt.unit_id = t3.unit_id),'-') as 'createTime',
|
|
|
+ CASE t1.usage_range WHEN 1 THEN '账户' WHEN 2 THEN '项目' ELSE '' END as 'usageRange',
|
|
|
+ IFNULL(t3.channel_code, '') as 'channelCode', IFNULL(t1.project_name, '') as 'projectName',
|
|
|
+ IFNULL(t2.auth_name, '') as 'authName', IFNULL(t3.account_id, '') as 'accountId',
|
|
|
+ IFNULL(t3.campaign_id, '') as 'campaignId',
|
|
|
+ IFNULL(t3.unit_id, '') as 'unitId'
|
|
|
+ FROM ctop_kuaishou_channel_rel t3
|
|
|
+ INNER JOIN ctop_kuaishou_channel t1 ON t1.account_id = t3.account_id AND t1.channel_code = t3.channel_code
|
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
- WHERE t1.account_id = #{accountId}
|
|
|
- AND t1.channel_code = #{channelCode}
|
|
|
+ WHERE t3.account_id = #{accountId}
|
|
|
+ AND t3.channel_code = #{channelCode}
|
|
|
</select>
|
|
|
|
|
|
<select id="channelNumberBindingItemInfo" resultType="com.alibaba.fastjson.JSONObject">
|