package com.ruoyi.ss.withdraw.mapper;

import com.ruoyi.ss.withdraw.domain.Withdraw;
import com.ruoyi.ss.withdraw.domain.WithdrawQuery;
import com.ruoyi.ss.withdraw.domain.WithdrawVO;

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

/**
 * 提现记录Mapper接口
 *
 * @author qzz
 * @date 2024-09-28
 */
public interface WithdrawMapper
{
    /**
     * 查询提现记录
     *
     * @param id 提现记录主键
     * @return 提现记录
     */
    public WithdrawVO selectRlWithdrawById(Long id);

    /**
     * 根据提现单号查询提现记录
     *
     * @param withdrawNo 提现单号
     * @return 提现记录
     */
    public WithdrawVO selectRlWithdrawByWithdrawNo(String withdrawNo);

    /**
     * 查询提现记录列表
     *
     * @param query 条件
     * @return 提现记录集合
     */
    public List<Withdraw> selectRlWithdrawList(WithdrawQuery query);

    /**
     * 新增提现记录
     *
     * @param rlWithdraw 提现记录
     * @return 结果
     */
    public int insertRlWithdraw(Withdraw rlWithdraw);

    /**
     * 修改提现记录
     *
     * @param rlWithdraw 提现记录
     * @return 结果
     */
    public int updateRlWithdraw(Withdraw rlWithdraw);

    /**
     * 删除提现记录
     *
     * @param id 提现记录主键
     * @return 结果
     */
    public int deleteRlWithdrawById(Long id);

    /**
     * 批量删除提现记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRlWithdrawByIds(Long[] ids);

    /**
     * 累计提现金额
     *
     * @param RlUserId 用户id
     * @return 结果
     */
    BigDecimal cumulativeWithdrawalAmount(Long RlUserId);

    /**
     * 获取用户提现中金额
     *
     * @param userId 用户id
     * @return 结果
     */
    BigDecimal selectWithdrawingAmountByUserId(Long userId);

    /**
     * 根据条件获取用户提现中金额
     *
     * @param query 查询参数
     * @return 结果
     */
    BigDecimal selectWithdrawAmount(WithdrawQuery query);

    /**
     * 根据条件查询提现服务费
     *
     * @param query 查询参数
     * @return 结果
     */
    BigDecimal selectHandlingCharge(WithdrawQuery query);


    int selectCount(WithdrawQuery query);
}
