#1.快手-华东近一周素材消耗明细(上海汇创思拓数字科技有限公司)
#华东
select
'上海汇创思拓数字科技有限公司' as '公司',
 ifnull(report.project_name,'-') AS '项目',
 ifnull(report.signature,'-') AS '素材标识',
 ifnull(video.frast_cost_time,'-') AS '上线时间',
 ifnull(report.channel_name,'-') AS '渠道',
 sum(report.charge)  AS '消耗',
 ifnull(report.clip_name,'-') AS '剪辑',
 ifnull(report.shot_name,'-') AS '拍摄',
 ifnull(report.plan_name,'-') AS '编导',
 ifnull(report.leader_name,'-') AS '负责人',
 ifnull(report.video_name,'-') AS '素材名称',
 ifnull(report.photo_url,'-') AS '素材'
from
(select
 t1.account_id,
 t1.photo_id,
 t1.project_name ,
 t1.signature,
 t1.channel_name,
 t1.charge,
 t1.clip_name,
 t1.shot_name,
 t1.plan_name,
 t1.leader_name,
 t1.video_name,
 t1.photo_url
from application.kuaishou_material_video_report_daily_dw t1
WHERE t1.stat_date  between date_sub(${stat_date}, INTERVAL 6 DAY) AND ${stat_date}
and t1.account_id in (SELECT account_id FROM `jeecg-boot`.ctop_user_allocation WHERE  user_id IN (SELECT user_id FROM `jeecg-boot`.user_company WHERE company_id = '4b10089775c040119e139087517aed88'))) report
left  join
material_farst_cost_time video
on report.signature=video.signature
group by
report.signature;