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

import cn.com.ctop.common.module.vo.BytedanceImageCostVO;
import cn.com.ctop.common.module.vo.BytedanceImageCostVOEntity;
import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialRetry;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportVideoMaterialDaily;
import cn.com.ctop.toutiao.modules.report.entity.BytedanceVideoEtlInfo;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 素材报表
 * @author: jeecg-boot
 * @date:   2020-04-16
 * @cersion: V1.0
 */
public interface BytedanceReportMaterialDailyMapper extends BaseMapper<BytedanceReportMaterialDaily> {

    void replaceIntoBatch(@Param("infos") List<BytedanceReportMaterialDaily> infos);

    void replaceIntoVideoMaterialBatch(@Param("infos") List<BytedanceReportVideoMaterialDaily> infos);

    void replaceMaterialRetry(@Param("retry") BytedanceReportMaterialRetry retry);

    List<BytedanceReportMaterialRetry> getRetryList();

    void updateRetry(@Param("retry") BytedanceReportMaterialRetry retry);

    List<BytedanceVideoVo> getVideoVoByDate(@Param("date")String date);

    List<BytedanceImageCostVO> bytedanceImageCost(@Param("startDate")String startDate,
                                                  @Param("endDate")String endDate,
                                                  @Param("accountList")JSONArray accountList,
                                                  @Param("code")String code,
                                                  @Param("order")String order,
                                                  @Param("target")String target);

    BytedanceImageCostVO bytedanceImageCostTotal(@Param("startDate")String startDate,
                                                  @Param("endDate")String endDate,
                                                  @Param("accountList")JSONArray accountList,
                                                  @Param("code")String code
);

    void replaceImageBatch(@Param("infos")List<BytedanceReportMaterialDaily> bytedanceReportImageDailyList);
    void updateImageReportCode();
    void updateImageReportProjectId();
    void updateImageReportProjectName();
    void updateImageReportPlaneId();
    void updateImageReportPlaneName();

    List<BytedanceImageCostVOEntity> bytedanceImageCostEntity(@Param("startDate")String startDate,
                                                              @Param("endDate")String endDate,
                                                              @Param("accountList")JSONArray accountList,
                                                              @Param("code")String code,
                                                              @Param("order")String order,
                                                              @Param("target")String target);

    List<BytedanceVideoEtlInfo> getSignatureByDate(@Param(value = "date") String date);

    BytedanceVideoEtlInfo getEtlDataByParams(@Param("signature")String signature, @Param("date")String date);
}
