|
@@ -46,7 +46,9 @@ class AppBytedanceAccountBaseInfoDsD:
|
|
|
all_video_num,
|
|
|
new_video_num,
|
|
|
effect_num,
|
|
|
+ new_effect_num,
|
|
|
hot_num,
|
|
|
+ new_hot_num,
|
|
|
put_campaign_num,
|
|
|
put_unit_num,
|
|
|
trust_campaign_num,
|
|
@@ -74,8 +76,10 @@ class AppBytedanceAccountBaseInfoDsD:
|
|
|
t2.ad_num new_ad_num,
|
|
|
(ifnull(t1.all_video_num,0)+ifnull(t3.day_num,0)) as all_video_num,
|
|
|
t3.day_num new_video_num,
|
|
|
- t4.effect_num,
|
|
|
- t4.hot_num,
|
|
|
+ (ifnull(t1.effect_num,0)+ifnull(t4.new_eff_material,0)) effect_num,
|
|
|
+ ifnull(t4.new_eff_material,0) as new_effect_num,
|
|
|
+ (ifnull(t1.hot_num,0)+ifnull(t5.new_hot_material,0)) as hot_num,
|
|
|
+ ifnull(t5.new_hot_material,0) as new_hot_num,
|
|
|
t1.put_campaign_num,
|
|
|
t1.put_unit_num,
|
|
|
t1.trust_campaign_num,
|
|
@@ -90,15 +94,22 @@ class AppBytedanceAccountBaseInfoDsD:
|
|
|
where date_format(create_time,'%Y%m%d')={date_time} group by advertiser_id) t3
|
|
|
on t1.account_id=t3.account_id
|
|
|
left join
|
|
|
- (select a.account_id,count(distinct ifnull(b.signature,null)) effect_num,count(distinct ifnull(c.signature,null)) hot_num from
|
|
|
- (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')<={date_time}) a
|
|
|
- left join (select distinct signature from application.effect_material where media_id=1) b
|
|
|
- on a.signature=b.signature
|
|
|
- left join (select distinct signature from application.hot_material where media_id=1) c
|
|
|
- on a.signature=c.signature
|
|
|
- group by a.account_id) t4
|
|
|
+ (select t2.account_id,count(distinct t1.material_id) new_eff_material from
|
|
|
+ (select material_id from application.app_bytedance_material_info where effect_date={date_time}) t1
|
|
|
+ inner join
|
|
|
+ (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')>=
|
|
|
+ date_sub({date_time},INTERVAL 29 DAY)) t2
|
|
|
+ on t1.material_id=t2.signature group by t2.account_id) t4
|
|
|
on t1.account_id=t4.account_id
|
|
|
left join
|
|
|
+ (select t2.account_id,count(distinct t1.material_id) new_hot_material from
|
|
|
+ (select material_id from application.app_bytedance_material_info where faddish_date={date_time}) t1
|
|
|
+ inner join
|
|
|
+ (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')>=
|
|
|
+ date_sub({date_time},INTERVAL 29 DAY)) t2
|
|
|
+ on t1.material_id=t2.signature group by t2.account_id) t5
|
|
|
+ on t1.account_id=t5.account_id
|
|
|
+ left join
|
|
|
(
|
|
|
SELECT
|
|
|
cua.account_id id,
|
|
@@ -157,8 +168,10 @@ class AppBytedanceAccountBaseInfoDsD:
|
|
|
t2.ad_num as new_ad_num,
|
|
|
t3.day_num as all_video_num,
|
|
|
t3.day_num new_video_num,
|
|
|
- t4.effect_num,
|
|
|
- t4.hot_num,
|
|
|
+ ifnull(t4.new_eff_material,0) as effect_num,
|
|
|
+ ifnull(t4.new_eff_material,0) as new_effect_num,
|
|
|
+ ifnull(t5.new_hot_material,0) as hot_num,
|
|
|
+ ifnull(t5.new_hot_material,0) as new_hot_num,
|
|
|
0 put_campaign_num,
|
|
|
0 put_unit_num,
|
|
|
0 trust_campaign_num,
|
|
@@ -176,15 +189,22 @@ class AppBytedanceAccountBaseInfoDsD:
|
|
|
where date_format(create_time,'%Y%m%d')={date_time} group by advertiser_id) t3
|
|
|
on t1.account_id=t3.account_id
|
|
|
left join
|
|
|
- (select a.account_id,count(distinct ifnull(b.signature,null)) effect_num,count(distinct ifnull(c.signature,null)) hot_num from
|
|
|
- (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')<={date_time}) a
|
|
|
- left join (select distinct signature from application.effect_material where media_id=1) b
|
|
|
- on a.signature=b.signature
|
|
|
- left join (select distinct signature from application.hot_material where media_id=1) c
|
|
|
- on a.signature=c.signature
|
|
|
- group by a.account_id) t4
|
|
|
+ (select t2.account_id,count(distinct t1.material_id) new_eff_material from
|
|
|
+ (select material_id from application.app_bytedance_material_info where effect_date={date_time}) t1
|
|
|
+ inner join
|
|
|
+ (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')>=
|
|
|
+ date_sub({date_time},INTERVAL 29 DAY)) t2
|
|
|
+ on t1.material_id=t2.signature group by t2.account_id) t4
|
|
|
on t1.account_id=t4.account_id
|
|
|
left join
|
|
|
+ (select t2.account_id,count(distinct t1.material_id) new_hot_material from
|
|
|
+ (select material_id from application.app_bytedance_material_info where faddish_date={date_time}) t1
|
|
|
+ inner join
|
|
|
+ (select distinct advertiser_id account_id,signature from `media_api`.bytedance_file_video_get where date_format(create_time,'%Y%m%d')>=
|
|
|
+ date_sub({date_time},INTERVAL 29 DAY)) t2
|
|
|
+ on t1.material_id=t2.signature group by t2.account_id) t5
|
|
|
+ on t1.account_id=t5.account_id
|
|
|
+ left join
|
|
|
(
|
|
|
SELECT
|
|
|
cua.account_id id,
|