       select
       a.account_id as `账户 `,
       signature   as `视频md5`,
       photo_url as `视频链接`,
       video_name as `视频名称`,
       project_name   `项目名称`,
       clip_name      `剪辑`,
       plan_name      `编导`,
       shot_name      `拍摄`,
       leader_name   `负责人`,
       sum(charge) as `消耗`,
       case when channel_type =0 then '内部' when channel_type=1 then '塑造' else '-' end as `渠道`
from (select account_id,
             signature,
             channel_type,
             project_name,
             leader_name,
             plan_name,
             clip_name,
             shot_name,
             charge,
             clip_company_id,
             photo_url,
             video_name
      from application.kuaishou_material_video_report_daily_dw
      where stat_date between 20220401 and 20220430) a
         inner join (
    select account_id
    from `jeecg-boot`.ctop_user_allocation
    where user_id in (
        select user_id from `jeecg-boot`.user_company where company_id = 'd57fecdcf7a94d009736d9c850731582'
    )
) b
                   on a.account_id = b.account_id
 where clip_company_id='1648c7ceb4d449a9a13fbed7a8d9976c'
group by signature, a.account_id