#1.快手-骄阳近一周素材消耗明细(北京骄阳数字科技有限公司) ----线上 select '北京骄阳数字科技有限公司' as '公司', ifnull(report.project_name,'-') AS '项目', ifnull(report.signature,'-') AS '素材标识', ifnull(date(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_format(date_sub(${stat_date}, INTERVAL 6 DAY),'%Y%m%d') 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 = '5e46b5dea3d740eeb8ff1a2895015a4b'))) report left join material_farst_cost_time video on report.signature=video.signature group by report.signature;