package com.game.business.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.game.business.domain.AppUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.game.business.domain.FinTranRecord;
import com.game.business.vo.ApiUserInfoVo;

/**
 * app用户Service接口
 *
 * @author game
 * @date 2024-06-18
 */
public interface IAppUserService extends IService<AppUser> {
    /**
     * 查询app用户
     *
     * @param userid app用户主键
     * @return app用户
     */
    public AppUser selectAppUserByUserid(Long userid);

    /**
     * 查询app用户列表
     *
     * @param appUser app用户
     * @return app用户集合
     */
    public List<AppUser> selectAppUserList(AppUser appUser);

    /**
     * 查询总代理用户
     *
     * @param appUser app用户
     * @return app用户集合
     */
    public List<AppUser> selectTeamUserList();

    /**
     * 新增app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int insertAppUser(AppUser appUser);

    /**
     * 修改app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int updateAppUser(AppUser appUser);

    /**
     * 批量删除app用户
     *
     * @param userids 需要删除的app用户主键集合
     * @return 结果
     */
    public int deleteAppUserByUserids(Long[] userids);

    /**
     * 删除app用户信息
     *
     * @param userid app用户主键
     * @return 结果
     */
    public int deleteAppUserByUserid(Long userid);

    public int getCount(Long pid,String beginTime,String endTime);

    boolean getMobileCount(String mobile);

    /**
     * 根据用户id集合查询用户列表
     * */
    public List<AppUser> selectListByIds(List<Long> ids);

    Long nextId();

    /**
     * 更新用户余额、插入流水
     * */
    int updateUserAmount(FinTranRecord finTranRecord)  throws Exception;

    ApiUserInfoVo getUserInfo(Long userId);

    Map<String, BigDecimal> getUserCount(Long userId);
}