package com.game.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.game.business.domain.AppGameBetting;
import com.game.business.dto.FinTranRecordDTO;
import com.game.business.vo.AppGameBettingDetailsCountVO;
import com.game.business.vo.AppUserGameBettingCountVO;
import com.game.business.vo.AppUserGameBettingDetailsCountVO;
import com.game.business.vo.AppUserGameBettingWebCountVO;

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

public interface IAppGameBettingService extends IService<AppGameBetting> {

    List<AppGameBetting> getIsWinning(Long classId, Long gameId, String gameDate, Integer isWinning);

    boolean updateById(AppGameBetting appGameBetting);

    boolean save(AppGameBetting appGameBetting);

    List<AppGameBettingDetailsCountVO> getCount(String strDate, Long userId, Integer bettingType);

    List<AppUserGameBettingCountVO> getUserCount(Long gameId, Long userId, Integer bettingType);

    List<AppUserGameBettingWebCountVO> getUserWebCount(Long gameId, Long userId, Integer bettingType,String beginTime,String endTime);

    List<AppUserGameBettingDetailsCountVO> getUserBettingItemCount(Long gameId, String gameDate, Long userId, Integer bettingType);

    List<AppGameBetting> getUserBettingItem(Long gameId, String gameDate, Long userId, Integer bettingType);

    List<AppGameBetting> selectListByGameId(Long gameId, Long userId, Integer isWinning, String strDate, Integer bettingType);

    List<AppGameBetting> getNotLottery(Integer isWinning);

    /**
     * 根据日期查询投注情况
     * */
    List<AppGameBetting> selectListByDate( Long userId, String beginTime, String endTime,Long gameId,String gameDate,Integer isWinner,Integer bettingType);

    /**
     * 根据日期查询余额已开奖投注
     * */
    List<AppGameBetting> selectListIsWinByDate( Long userId, String beginTime, String endTime,Long gameId,String gameDate);

    Map<String, BigDecimal> getBettingAmountSum(Long userId);

    Map<String, Double> getBettingAmountByDate(Long gameId, String dateStr);

    List<AppUserGameBettingDetailsCountVO> getBettingAmountByGameDate(Long gameId, String gameDate, Integer bettingType);

    Map<String, BigDecimal> getBettingAmountByDateSum(FinTranRecordDTO finTranRecordDTO);

    Integer getBettingCount(Long userId, Long gameId, String gameDate, String bettingItem);

    Integer getBettingItemCount(Long userId, Long gameId, String gameDate, String bettingItem);

    BigDecimal getBettingAmount(Long userId, Long gameId, String gameDate, String bettingItem);

    List<String> getBettingItem(Long userId, Long gameId, String gameDate);

    /**
     * 查询用户下注记录
     *
     * @param id 用户下注记录主键
     * @return 用户下注记录
     */
    public AppGameBetting selectAppGameBettingById(Long id);

    /**
     * 查询用户下注记录列表
     *
     * @param appGameBetting 用户下注记录
     * @return 用户下注记录集合
     */
    public List<AppGameBetting> selectAppGameBettingList(AppGameBetting appGameBetting);

    /**
     * 新增用户下注记录
     *
     * @param appGameBetting 用户下注记录
     * @return 结果
     */
    public int insertAppGameBetting(AppGameBetting appGameBetting);

    /**
     * 修改用户下注记录
     *
     * @param appGameBetting 用户下注记录
     * @return 结果
     */
    public int updateAppGameBetting(AppGameBetting appGameBetting);

    /**
     * 批量删除用户下注记录
     *
     * @param ids 需要删除的用户下注记录主键集合
     * @return 结果
     */
    public int deleteAppGameBettingByIds(Long[] ids);

    /**
     * 删除用户下注记录信息
     *
     * @param id 用户下注记录主键
     * @return 结果
     */
    public int deleteAppGameBettingById(Long id);

    public Double sumBettingAmount(Long userId,Integer bettingType,String beginTime,String endTime,Long gameId);

    /**
     * 查询在当前时间断内投注是否有大于结束时间的开奖
     * */
    public int selectBettingCount(Long userId,Date beginTime,Date endTime);
}
