package cn.com.ctop.common.module.service;

import cn.com.ctop.common.module.entity.UserAllocation;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description: 用户分配
 * @Author: jeecg-boot
 * @Date: 2019-08-08
 * @Version: V1.0
 */
public interface IUserAllocationService extends IService<UserAllocation> {

    UserAllocation getByAccountId(Long accountId);

    List<UserAllocation> getByParams(Long projectId, String systemType, Integer accountStatus);

    Map<String, Object> getPangolinAccountListByParams(String userId, JSONObject data);

    Map<String, Object> getPangolinProjectListByParams(String userId);

    List<UserAllocation> getByMediaId(String mediaId);

    List<UserAllocation> listByMediaId(String mediaId, int accountStatus);

    String getAdvertiserIdByAccountId(Long accountId);

    List<JSONObject> getAccountListByProject(Long projectId);

    List<JSONObject> getUserIdListByProjectId(Long projectId);

    List<JSONObject> getAccountIdListByUserId(String userId);

    List<JSONObject> getAccountIdsByUserId(String userId);

    List<UserAllocation> getUserAllocations(String mediaId, int switchType);

    JSONObject getSwitchStatusByAccount(Long accountId);

    List<Long> getAccountsByDeleteComment();

    List<UserAllocation> getAccountListByUserIdAndProductId(String userId, Long projectId, Long productId);

    Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList);

    List<JSONObject> getUserIdListByProductId(Long productId);

    /**
     * 获取有效的项目ID集合
     *
     * @param mediaId 平台类型 1 头条 2快手
     * @throws
     */
    List<Long> getValidProjectIds(Integer mediaId);

    List<JSONObject> getByAccountIds(JSONArray accountIds);

    List<Long> getKuaiShouUserIdListByProjectId(Long projectId);

    List<JSONObject> selectAccountsByKuaishouUserId(Long userId);
    boolean updateProjectStrategyStatus(Long accountId, Integer projectStrategy);

    List<Long> queryAutomaticAccounts(Long projectId);

    List<Long> getIdList();

    int closeExpiredByteDanceAccounts(String createTimeLimit, Integer statDatetimeLimit);

    int closeExpiredKuaiShouAccounts(String createTimeLimit, Integer statDatetimeLimit);
}
