|
@@ -18,28 +18,6 @@ class AppBytedanceFileVideoGetAll:
|
|
def execSql(self):
|
|
def execSql(self):
|
|
try:
|
|
try:
|
|
sql = """select advertiser_id from media_api.bytedance_file_video_get
|
|
sql = """select advertiser_id from media_api.bytedance_file_video_get
|
|
- where advertiser_id in(
|
|
|
|
-1707223153526792
|
|
|
|
-,1664657972166663
|
|
|
|
-,1707223213061127
|
|
|
|
-,1698359675409486
|
|
|
|
-,1698089060301832
|
|
|
|
-,1707315154915335
|
|
|
|
-,1714136868023373
|
|
|
|
-,1707315154450440
|
|
|
|
-,1707315153522695
|
|
|
|
-,1692751131201549
|
|
|
|
-,1715489403810824
|
|
|
|
-,1715489404251150
|
|
|
|
-,1707315152598024
|
|
|
|
-,1696450109948936
|
|
|
|
-,1707315152139335
|
|
|
|
-,1672178052130888
|
|
|
|
-,1698359674963080
|
|
|
|
-,1700996856859720
|
|
|
|
-,1697174845285384
|
|
|
|
-,1678959320699917
|
|
|
|
-)
|
|
|
|
group by advertiser_id"""
|
|
group by advertiser_id"""
|
|
account_list = TidbConn.quary(self.conn, sql)
|
|
account_list = TidbConn.quary(self.conn, sql)
|
|
for account_id in account_list:
|
|
for account_id in account_list:
|
|
@@ -202,10 +180,12 @@ from (
|
|
from (
|
|
from (
|
|
select stat_datetime, video.signature, cost
|
|
select stat_datetime, video.signature, cost
|
|
from (select material_id, signature, create_time
|
|
from (select material_id, signature, create_time
|
|
- from (select material_id, min(create_time) as create_time, signature
|
|
|
|
|
|
+ from (select material_id, create_time, signature,
|
|
|
|
+ row_number() over (partition by material_id order by create_time) as rn
|
|
from media_api.bytedance_file_video_get
|
|
from media_api.bytedance_file_video_get
|
|
where material_id is not null and advertiser_id={account_id}
|
|
where material_id is not null and advertiser_id={account_id}
|
|
- group by material_id, signature) s) video
|
|
|
|
|
|
+
|
|
|
|
+ )s where rn =1) video
|
|
inner join
|
|
inner join
|
|
(
|
|
(
|
|
select stat_datetime, material_id, sum(cost) as cost
|
|
select stat_datetime, material_id, sum(cost) as cost
|
|
@@ -235,10 +215,12 @@ from (
|
|
from (
|
|
from (
|
|
select stat_datetime, video.signature, cost
|
|
select stat_datetime, video.signature, cost
|
|
from (select material_id, signature, create_time
|
|
from (select material_id, signature, create_time
|
|
- from (select material_id, min(create_time) as create_time, signature
|
|
|
|
- from media_api.bytedance_file_video_get
|
|
|
|
|
|
+ from (select material_id, create_time, signature,
|
|
|
|
+ row_number() over (partition by material_id order by create_time) as rn
|
|
|
|
+ from media_api.bytedance_file_video_get
|
|
where material_id is not null and advertiser_id={account_id}
|
|
where material_id is not null and advertiser_id={account_id}
|
|
- group by material_id, signature) s) video
|
|
|
|
|
|
+
|
|
|
|
+ )s where rn =1) video
|
|
inner join
|
|
inner join
|
|
(
|
|
(
|
|
select stat_datetime, material_id, sum(cost) as cost
|
|
select stat_datetime, material_id, sum(cost) as cost
|