package com.ruoyi.frequency.withdrawalrecord.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.controller.req.WithdrawalRecordPageReq;
import com.ruoyi.controller.resp.WithdrawalRecordPageResp;
import com.ruoyi.controller.resp.WithdrawalRecordPageTimeResp;
import com.ruoyi.frequency.withdrawalrecord.entity.WithdrawalRecord;
import com.ruoyi.frequency.withdrawalrecord.model.result.WithdrawalRecordCount;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * 提现记录Mapper接口
 * 
 * @author liwenlong
 * @date 2023-07-20
 */
public interface WithdrawalRecordMapper  extends BaseMapper<WithdrawalRecord>
{
    /**
     * 查询提现记录
     * 
     * @param id 提现记录主键
     * @return 提现记录
     */
    WithdrawalRecord selectWithdrawalRecordById(Long id);

    /**
     * 查询提现记录列表
     * 
     * @param withdrawalRecord 提现记录
     * @return 提现记录集合
     */
    List<WithdrawalRecord> selectWithdrawalRecordList(WithdrawalRecord withdrawalRecord);

    /**
     * 新增提现记录
     * 
     * @param withdrawalRecord 提现记录
     * @return 结果
     */
    int insertWithdrawalRecord(WithdrawalRecord withdrawalRecord);

    /**
     * 修改提现记录
     * 
     * @param withdrawalRecord 提现记录
     * @return 结果
     */
    int updateWithdrawalRecord(WithdrawalRecord withdrawalRecord);

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

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


    Page<WithdrawalRecordPageTimeResp> withdrawalRecordTimePage(@Param("page") Page page, @Param("req") WithdrawalRecordPageReq req, @Param("userVo") UserVo userVo);

    WithdrawalRecordPageResp getDetail(@Param("id") Long id);

    BigDecimal withdrawnAmount(@Param("userVo") UserVo userVo);

    WithdrawalRecordCount statistics(@Param("list") List<Long> withdrawalRecordIdList);
}
