package com.game.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.game.business.mapper.AppUsersCashAccountMapper;
import com.game.business.domain.AppUsersCashAccount;
import com.game.business.service.IAppUsersCashAccountService;
import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;

/**
 * 用户提现账号Service业务层处理
 *
 * @author game
 * @date 2024-09-07
 */
@Service
public class AppUsersCashAccountServiceImpl extends ServiceImpl<AppUsersCashAccountMapper, AppUsersCashAccount> implements IAppUsersCashAccountService {
    @Autowired
    private AppUsersCashAccountMapper appUsersCashAccountMapper;

    /**
     * 查询用户提现账号
     *
     * @param id 用户提现账号主键
     * @return 用户提现账号
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public AppUsersCashAccount selectAppUsersCashAccountById(Long id) {
        return appUsersCashAccountMapper.selectAppUsersCashAccountById(id);
    }

    /**
     * 查询用户提现账号列表
     *
     * @param appUsersCashAccount 用户提现账号
     * @return 用户提现账号
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<AppUsersCashAccount> selectAppUsersCashAccountList(AppUsersCashAccount appUsersCashAccount) {
        return appUsersCashAccountMapper.selectAppUsersCashAccountList(appUsersCashAccount);
    }

    /**
     * 新增用户提现账号
     *
     * @param appUsersCashAccount 用户提现账号
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertAppUsersCashAccount(AppUsersCashAccount appUsersCashAccount) {
            return appUsersCashAccountMapper.insertAppUsersCashAccount(appUsersCashAccount);
    }

    /**
     * 修改用户提现账号
     *
     * @param appUsersCashAccount 用户提现账号
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateAppUsersCashAccount(AppUsersCashAccount appUsersCashAccount) {
        return appUsersCashAccountMapper.updateAppUsersCashAccount(appUsersCashAccount);
    }

    /**
     * 批量删除用户提现账号
     *
     * @param ids 需要删除的用户提现账号主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUsersCashAccountByIds(Long[] ids) {
        return appUsersCashAccountMapper.deleteAppUsersCashAccountByIds(ids);
    }

    /**
     * 删除用户提现账号信息
     *
     * @param id 用户提现账号主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteAppUsersCashAccountById(Long id) {
        return appUsersCashAccountMapper.deleteAppUsersCashAccountById(id);
    }
}