package com.ruoyi.ss.userWithdraw.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.userWithdraw.domain.UserWithdraw;
import com.ruoyi.ss.userWithdraw.domain.UserWithdrawQuery;
import com.ruoyi.ss.userWithdraw.domain.UserWithdrawVO;
import com.ruoyi.ss.userWithdraw.mapper.UserWithdrawMapper;
import com.ruoyi.ss.userWithdraw.service.IUserWithdrawService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户提现渠道Service业务层处理
 *
 * @author qzz
 * @date 2024-10-21
 */
@Service
public class UserWithdrawServiceImpl implements IUserWithdrawService
{
    @Resource
    private UserWithdrawMapper userWithdrawMapper;

    /**
     * 查询用户提现渠道
     *
     * @param userChannelId 用户提现渠道主键
     * @return 用户提现渠道
     */
    @Override
    public UserWithdraw selectRlUserWithdrawByUserChannelId(Long userChannelId)
    {
        return userWithdrawMapper.selectRlUserWithdrawByUserChannelId(userChannelId);
    }

    /**
     * 查询用户提现渠道列表
     *
     * @param rlUserWithdraw 用户提现渠道
     * @return 用户提现渠道
     */
    @Override
    public List<UserWithdrawVO> selectRlUserWithdrawList(UserWithdrawQuery rlUserWithdraw)
    {
        return userWithdrawMapper.selectRlUserWithdrawList(rlUserWithdraw);
    }

    /**
     * 根据userId查询用户提现渠道列表
     *
     * @param userId 用户id
     * @return 用户提现渠道集合
     */
    @Override
    public List<UserWithdraw> selectRlUserWithdrawListByUserId(Long userId) {
        return userWithdrawMapper.selectRlUserWithdrawListByUserId(userId);
    }

    /**
     * 新增用户提现渠道
     *
     * @param rlUserWithdraw 用户提现渠道
     * @return 结果
     */
    @Override
    public int insertRlUserWithdraw(UserWithdraw rlUserWithdraw)
    {
        rlUserWithdraw.setCreateTime(DateUtils.getNowDate());
        return userWithdrawMapper.insertRlUserWithdraw(rlUserWithdraw);
    }

    /**
     * 修改用户提现渠道
     *
     * @param rlUserWithdraw 用户提现渠道
     * @return 结果
     */
    @Override
    public int updateRlUserWithdraw(UserWithdraw rlUserWithdraw)
    {
        return userWithdrawMapper.updateRlUserWithdraw(rlUserWithdraw);
    }

    /**
     * 批量删除用户提现渠道
     *
     * @param userChannelIds 需要删除的用户提现渠道主键
     * @return 结果
     */
    @Override
    public int deleteRlUserWithdrawByUserChannelIds(Long[] userChannelIds)
    {
        return userWithdrawMapper.deleteRlUserWithdrawByUserChannelIds(userChannelIds);
    }

    /**
     * 删除用户提现渠道信息
     *
     * @param userChannelId 用户提现渠道主键
     * @return 结果
     */
    @Override
    public int deleteRlUserWithdrawByUserChannelId(Long userChannelId)
    {
        return userWithdrawMapper.deleteRlUserWithdrawByUserChannelId(userChannelId);
    }
}
