package org.jeecg.modules.bytedance.common.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.bytedance.common.entity.UserAllocation;

import java.util.List;
import java.util.Set;

/**
 * @Description: 用户分配
 * @Author: jeecg-boot
 * @Date: 2019-08-08
 * @Version: V1.0
 */
public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
    List<UserAllocation> selectAccountListByProjectId(@Param("projectId") Long projectId);

    String queryAdvertiserId(@Param("accountId") Long accountId);

    String queryUserIdByAccountId(@Param("accountId") Long accountId);

    List<JSONObject> getAccountListByProject(@Param("projectId") Long projectId);

    List<JSONObject> getUserIdListByProjectId(@Param("projectId") Long projectId);

    List<JSONObject> getAccountIdListByUserId(@Param("userId") Long userId);

    List<JSONObject> getAccountIdsByUserId(@Param("userId") String userId);

    List<JSONObject> getAllAccountIdsByMediaId(@Param("mediaId") String mediaId);

    Long getProjectIdByAccountId(@Param("accountId") Long accountId);

    UserAllocation getUserAllocation(@Param("accountId") Long accountId);

    JSONObject getSwitchStatusByAccount(@Param("accountId") Long accountId);

    List<Long>  queryAccountsByDeleteComment();

    List<UserAllocation> listByMediaId(@Param("mediaId")String mediaId, @Param("accountStatus")Integer accountStatus);

    List<JSONObject> getAccountListByProjectList(@Param("list") List list);


    Set<String> recursiveQuerySubordinateByLeader(@Param("leaderId") String leaderId);
    Set<String> recursiveQuerySubordinateByLeaders(@Param("leaderIds") Set<String> leaderId);

}
