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

import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
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-08-30
 * @version V1.0
 */
public interface KuaishouChannelMapper extends BaseMapper<KuaishouChannel> {

    List<JSONObject> channelManagementHome(KuaishouChannel kuaishouChannel);

    Long channelNumberDetailsTotal(KuaishouChannel kuaishouChannel);

    List<KuaishouChannel> channelNumberDetails(KuaishouChannel kuaishouChannel);

    Long channelNumberUsageDetailsListTotal(KuaishouChannel kuaishouChannel);

    List<KuaishouChannel> channelNumberUsageDetailsList(KuaishouChannel kuaishouChannel);

    List<JSONObject> channelNumberBindingItemInfo(@Param("request") JSONArray request);

    List<KuaishouChannel> queryFollowOrder(@Param("accountId") Long accountId, @Param("usedId") Long usedId, @Param("usageRange") Integer usageRange);

    KuaishouChannel queryByAccountId(@Param("accountId") Long accountId, @Param("isHaveItem") Integer isHaveItem);

    List<KuaishouChannel> queryMaxChannelNumber(@Param("strategyId") Long strategyId);

    Integer queryUsedChannelNumber(@Param("strategyId") Long strategyId);

    List<KuaishouChannel> queryByAccountIdLevel(@Param("accountId") Long accountId, @Param("usageLevel") String usageLevel);

    List<Integer> queryUsedLevel(@Param("strategys") List<Long> strategys);

    List<KuaishouChannel> queryChannelByUsageTimes(@Param("usageTimes") Integer usageTimes, @Param("usageLevel") String usageLevel, @Param("strategys") List<Long> strategys, @Param("appName") String appName);

    List<JSONObject> queryItemsListByAccountId(@Param("accountId") Long accountId, @Param("appName") String appName);

    KuaishouChannel queryUsedChannel(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId, @Param("level") String level);

    List<JSONObject> queryChannelList(@Param("accountId") Long accountId, @Param("appName") String appName);

    List<KuaishouChannel> queryChannelListByAccount(@Param("accountId") Long accountId);

    List<KuaishouChannel> getAccountLevelRepeatChannel(@Param("accountId") Long accountId, @Param("appName") String appName);

    List<KuaishouChannel> getAccountLevelNoRepeatChannel(@Param("accountId") Long accountId, @Param("appName") String appName);

    KuaishouChannel getChannelEntity(@Param("accountId") Long accountId);

    List<KuaishouChannel> queryNoAccountLevelNoRepeatChannel(@Param("usageLevel") String usageLevel, @Param("accountId") Long accountId, @Param("appName") String appName);
}
