package com.ff.game.service.impl;

import java.util.Collections;
import java.util.List;
import com.ff.base.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ff.game.mapper.GameBettingDetailsMapper;
import com.ff.game.domain.GameBettingDetails;
import com.ff.game.service.IGameBettingDetailsService;

/**
 * 会员投注细目Service业务层处理
 *
 * @author shi
 * @date 2025-02-10
 */
@Service
public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService
{
    @Autowired
    private GameBettingDetailsMapper gameBettingDetailsMapper;

    /**
     * 查询会员投注细目
     *
     * @param id 会员投注细目主键
     * @return 会员投注细目
     */
    @Override
    public GameBettingDetails selectGameBettingDetailsById(Long id)
    {
        return gameBettingDetailsMapper.selectGameBettingDetailsById(id);
    }

    /**
     * 按投注id选择游戏投注详细信息
     *
     * @param wagersIds 投注ID
     * @return {@link List }<{@link Long }>
     */
    @Override
    public List<Long> selectGameBettingDetailsByWagersId(List<Long> wagersIds) {
        return gameBettingDetailsMapper.selectGameBettingDetailsByWagersId(wagersIds);
    }

    /**
     * 查询会员投注细目列表
     *
     * @param gameBettingDetails 会员投注细目
     * @return 会员投注细目
     */
    @Override
    public List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetails gameBettingDetails)
    {
        return gameBettingDetailsMapper.selectGameBettingDetailsList(gameBettingDetails);
    }

    /**
     * 新增会员投注细目
     *
     * @param gameBettingDetails 会员投注细目
     * @return 结果
     */
    @Override
    public int insertGameBettingDetails(GameBettingDetails gameBettingDetails)
    {
        gameBettingDetails.setCreateTime(DateUtils.getNowDate());
        return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
    }

    /**
     * 批量插入
     *
     * @param bettingDetails 投注详情
     * @return int
     */
    @Override
    public int batchInsert(List<GameBettingDetails> bettingDetails) {
        return gameBettingDetailsMapper.batchInsert(bettingDetails);
    }

    /**
     * 修改会员投注细目
     *
     * @param gameBettingDetails 会员投注细目
     * @return 结果
     */
    @Override
    public int updateGameBettingDetails(GameBettingDetails gameBettingDetails)
    {
        gameBettingDetails.setUpdateTime(DateUtils.getNowDate());
        return gameBettingDetailsMapper.updateGameBettingDetails(gameBettingDetails);
    }

    /**
     * 批量删除会员投注细目
     *
     * @param ids 需要删除的会员投注细目主键
     * @return 结果
     */
    @Override
    public int deleteGameBettingDetailsByIds(Long[] ids)
    {
        return gameBettingDetailsMapper.deleteGameBettingDetailsByIds(ids);
    }

    /**
     * 删除会员投注细目信息
     *
     * @param id 会员投注细目主键
     * @return 结果
     */
    @Override
    public int deleteGameBettingDetailsById(Long id)
    {
        return gameBettingDetailsMapper.deleteGameBettingDetailsById(id);
    }
}
