package cn.com.ctop.toutiao.modules.link.mapper;

import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 头条视频报表ETL
 */
public interface ETLReportBytedanceVideoMapper extends BaseMapper<ETLReportBytedanceVideo> {

    //根据material_id查询MD5、头条视频链接
    JSONObject queryVideoInfoByMaterialId(@Param("materialId") Long materialId);
    //根据MD5查询视频信息
    JSONObject queryMaterialVideoByMd5(@Param("md5") String md5);

    JSONObject queryMaterialVideoByMd5Old(@Param("md5") String md5);

    //根据MD5查询素材关联人信息
    JSONObject queryRelatePersonByMd5(@Param("md5") String md5);

    JSONObject queryRelatePersonByMd5Old(@Param("md5") String md5);

    //根据accountId 查询项目、产品、广告主信息
    JSONObject queryAccountDetailByAccountId(@Param("accountId") Long accountId);

    List<ETLReportBytedanceVideo> queryETLData(@Param("statDate") String statDate);

    void insertBatch(@Param("records") List<ETLReportBytedanceVideo>records);

    List<ETLReportBytedanceVideo> getDuplicateVideoInfo(@Param("date")String date);

    void deleteDuplicateVideoInfo(@Param("video")ETLReportBytedanceVideo video);

    List<ETLReportBytedanceVideo> getBytedanceVideoClipInfo();
    List<ETLReportBytedanceVideo> getBytedanceVideoShotInfo();
    List<ETLReportBytedanceVideo> getBytedanceVideoPlanInfo();

    void updateClipInfo(@Param("clipId")String clipId, @Param("clipName")String clipName, @Param("md5")String md5);
    void updateShotInfo(@Param("shotId")String shotId, @Param("shotName")String shotName, @Param("md5")String md5);
    void updatePlanInfo(@Param("planId")String planId, @Param("planName")String planName, @Param("md5")String md5);

    void updateTeamLeader();
    void updateDesignTeamLeader();
}
