|
@@ -255,7 +255,7 @@
|
|
|
<include refid="iaaRoi"/>,
|
|
<include refid="iaaRoi"/>,
|
|
|
<include refid="iapRoi"/>
|
|
<include refid="iapRoi"/>
|
|
|
from
|
|
from
|
|
|
- (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
@@ -302,7 +302,7 @@
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
rank() over (order by sum(cost_amount) desc) as rk
|
|
rank() over (order by sum(cost_amount) desc) as rk
|
|
|
from
|
|
from
|
|
|
- (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
|
from application.media_ad_report_daily
|
|
from application.media_ad_report_daily
|
|
@@ -335,7 +335,7 @@
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
max(tb2.update_time) as update_time
|
|
max(tb2.update_time) as update_time
|
|
|
from
|
|
from
|
|
|
- (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
|
from application.media_ad_report_hourly
|
|
from application.media_ad_report_hourly
|
|
@@ -360,7 +360,7 @@
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
ifnull(sum(cost_amount_hour), 0) as cost_amount_hour
|
|
ifnull(sum(cost_amount_hour), 0) as cost_amount_hour
|
|
|
from
|
|
from
|
|
|
- (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
left join (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
left join (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
|
from application.media_ad_report_daily where stat_date=#{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
from application.media_ad_report_daily where stat_date=#{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
|
group by advertiser_id) tb2
|
|
group by advertiser_id) tb2
|
|
@@ -379,7 +379,6 @@
|
|
|
select dept_id, dept_name, dept_id as sub_dept_id, dept_name as sub_dept_name from tidb.deepthink.sys_dept where parent_id in (select dept_id from tidb.deepthink.sys_dept where parent_id=300)
|
|
select dept_id, dept_name, dept_id as sub_dept_id, dept_name as sub_dept_name from tidb.deepthink.sys_dept where parent_id in (select dept_id from tidb.deepthink.sys_dept where parent_id=300)
|
|
|
) tb5
|
|
) tb5
|
|
|
on tb4.dept_id = tb5.sub_dept_id
|
|
on tb4.dept_id = tb5.sub_dept_id
|
|
|
- where tb1.user_id is not null
|
|
|
|
|
group by tb5.dept_id, tb5.dept_name
|
|
group by tb5.dept_id, tb5.dept_name
|
|
|
having sum(cost_amount)>1
|
|
having sum(cost_amount)>1
|
|
|
order by rk asc
|
|
order by rk asc
|
|
@@ -458,7 +457,7 @@
|
|
|
<include refid="iaaRoi"/>,
|
|
<include refid="iaaRoi"/>,
|
|
|
<include refid="iapRoi"/>
|
|
<include refid="iapRoi"/>
|
|
|
from
|
|
from
|
|
|
- (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|