package com.game.business.service;

import java.rmi.ServerException;
import java.util.List;
import com.game.business.domain.AppUserAgent;
import com.baomidou.mybatisplus.extension.service.IService;
import com.game.business.dto.AppAgentEditDto;
import com.game.business.dto.AppAgentTeamDto;
import com.game.business.dto.AppUserTeamTranserDto;
import com.game.business.vo.AppAgentTeamVo;
import com.game.common.core.domain.HttpRet;

/**
 * 用户代理表Service接口
 *
 * @author game
 * @date 2024-06-25
 */
public interface IAppUserAgentService extends IService<AppUserAgent> {
    /**
     * 查询用户代理表
     *
     * @param id 用户代理表主键
     * @return 用户代理表
     */
    public AppUserAgent selectAppUserAgentById(Long id);

    /**
     * 查询用户代理表列表
     *
     * @param appUserAgent 用户代理表
     * @return 用户代理表集合
     */
    public List<AppUserAgent> selectAppUserAgentList(AppUserAgent appUserAgent);

    /**
     * 新增用户代理表
     *
     * @param appUserAgent 用户代理表
     * @return 结果
     */
    public int insertAppUserAgent(AppUserAgent appUserAgent);

    /**
     * 修改用户代理表
     *
     * @param appUserAgent 用户代理表
     * @return 结果
     */
    public int updateAppUserAgent(AppUserAgent appUserAgent);

    /**
     * 批量删除用户代理表
     *
     * @param ids 需要删除的用户代理表主键集合
     * @return 结果
     */
    public int deleteAppUserAgentByIds(Long[] ids);

    /**
     * 删除用户代理表信息
     *
     * @param id 用户代理表主键
     * @return 结果
     */
    public int deleteAppUserAgentById(Long id);

    /**
     * 统计用户代理
     *
     * */
    public int countAgent(Long userId,String beginTime,String endTime);

    /**
     * 统计用户团队投注金额
     * */
    public Double sumBetting(String beginTime,String endTime,Long pid);

    /**
     * 修改代理设置
     * */
    public HttpRet<Boolean> updateSetting(AppAgentEditDto editDto);

    /**
     * 团队列表
     * */
    public List<AppAgentTeamVo> teamList(AppAgentTeamDto teamDto);

    /**
     * 团队转账
     * */
    public HttpRet<String> transfer(AppUserTeamTranserDto transfer);

    /**
     * 递归查询所有下级代理(包含自己)
     * */
    public List<AppUserAgent> selectAllAgentList(Long pid,Long userId,String beginTime,String endTime);

    /**
     * 递归查询所有上级代理(包含自己)
     * */
    public List<AppUserAgent> selectSuperList(Long userId);

    public AppUserAgent selectInfo(Long userId);


    public List<AppUserAgent> selectDownByRate(Long userId,Double rate,Integer upType);
}