package cn.com.ctop.kuaishou.modules.ai.mapper;

import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 自动投放账户——素材
 *
 * @author jeecg-boot
 * 2021-10-20
 * @version V1.0
 */
public interface AiKuaishouAccountAutoVideoMapper extends BaseMapper<AiKuaishouAccountAutoVideo> {

    void insertBatch(@Param("videoGetList") List<AiKuaishouAccountAutoVideo> videoGetList);

    List<AiKuaishouAccountAutoVideo> getUpNewVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword")  List<String>  keyword, @Param("videoCnt") Integer videoCnt, @Param("statDate") String statDate, @Param("createType") String createType);

    List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword")  List<String>  keyword, @Param("videoCnt") Integer videoCnt, @Param("createType") String createType, @Param("statDate") String statDate);

    List<AiKuaishouAccountAutoVideo> getHistoryCatchVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword")  List<String>  keyword, @Param("videoCnt") Integer videoCnt, @Param("statDate") String statDate);

    List<AiKuaishouAccountAutoVideo> getZeroVideoByParams(Long accountId, Integer channelType,  List<String>  keyword, Integer videoCnt, @Param("statDate") String date);

    Integer getAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType);

    void addAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType, @Param("usageTimes") Integer usageTimes, @Param("date") String date);

    void updateAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType, @Param("usageTimes") Integer usageTimes, @Param("date") String date);

    List<String> selectBatchByPhotoIds(@Param("details") JSONArray details, @Param("statDate") String statDate, @Param("accountId") Long accountId);

    void insertBatchAiKuaishouProjectAutoVideo(@Param("list") List<JSONObject> list);
}
