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

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

import java.util.List;

/**
 * @Description: 快手-创意信息
 * @Author: jeecg-boot
 * @Date: 2019-07-23
 * @Version: V1.0
 */
public interface KuaiShouCreativeMapper extends BaseMapper<KuaiShouCreative> {

    void replaceBatch(@Param(value = "creatives") List<KuaiShouCreative> creatives);

    Integer checkCreativeCount(@Param("accountId") Long accountId, @Param("unitId") Long unitId);

    Integer getCreateCount(Long accountId, String startTime);

    List<JSONObject> checkZombieProject(String date);

    void delAllCreativesByCampaignId(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId);

    List<KuaiShouCreative> queryCreativeInfoByCampaignId(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId);

    List<Long> getCreativeIds(@Param("accountId") Long accountId);

    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);

    Integer getRejectedCountsforAccountId(Long accountId);

    String getClickTrackUrl(@Param("accountId") Long accountId, @Param("unitId") Long unitId);

    Long queryCreativeByPhotoIdTotal(@Param("photoIds") List<String> photoIds, @Param("accountId") Long accountId);

    List<JSONObject> queryCreativeByPhotoId(@Param("photoId") String photoId);

    List<JSONObject> queryCreativeByPhotoIds(@Param("photoIds") List<String> photoIds, @Param("accountId") Long accountId);

    String querMaxCreateTime(@Param("unitId") Long unitId);
}
