package com.ruoyi.bst.withdraw.mapper;

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

import org.apache.ibatis.annotations.Param;

import com.ruoyi.bst.withdraw.domain.Withdraw;
import com.ruoyi.bst.withdraw.domain.WithdrawQuery;
import com.ruoyi.bst.withdraw.domain.WithdrawVO;
import com.ruoyi.bst.withdraw.domain.vo.WithdrawDailyStatVO;

/**
 * 提现Mapper接口
 *
 * @author ruoyi
 * @date 2025-04-07
 */
public interface WithdrawMapper
{
    /**
     * 查询提现
     *
     * @param id 提现主键
     * @return 提现
     */
    WithdrawVO selectWithdrawById(Long id);

    /**
     * 查询提现列表
     *
     * @param query 提现
     * @return 提现集合
     */
    List<WithdrawVO> selectWithdrawList(@Param("query")WithdrawQuery query);

    /**
     * 新增提现
     *
     * @param withdraw 提现
     * @return 结果
     */
    int insertWithdraw(Withdraw withdraw);


    /**
     * 修改提现
     *
     * @param withdraw 提现
     * @return 结果
     */
    public int updateWithdraw(@Param("data") Withdraw withdraw);

    /**
     * 删除提现
     *
     * @param id 提现主键
     * @return 结果
     */
    int deleteWithdrawById(Long id);

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

    /**
     * 根据条件更新
     */
    int updateByQuery(@Param("data") Withdraw data, @Param("query") WithdrawQuery query);

    /**
     * 根据条件查询金额
     */
    BigDecimal selectSumOfAmount(@Param("query") WithdrawQuery query);

    /**
     * 根据条件查询数量
     */
    int selectCount(@Param("query") WithdrawQuery query);

    /**
     * 根据条件查询每日提现统计
     */
    List<WithdrawDailyStatVO> selectDailyStat(@Param("query") WithdrawQuery query, @Param("keys") List<String> keys);

    /** 
     * 根据条件查询到账金额
     */
    BigDecimal selectSumOfArrivalAmount(@Param("query") WithdrawQuery query);

    /**
     * 根据条件查询手续费
     */
    BigDecimal selectSumOfServiceCharge(@Param("query") WithdrawQuery query);
}
