package com.ruoyi.frequency.wallerecord.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.controller.req.WalletPageReq;
import com.ruoyi.controller.resp.WalletPageResp;
import com.ruoyi.frequency.wallerecord.entity.WalletRecord;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * 钱包记录Mapper接口
 *
 * @author liwenlong
 * @date 2023-07-20
 */
public interface WalletRecordMapper  extends BaseMapper<WalletRecord>
{
    /**
     * 查询钱包记录
     *
     * @param id 钱包记录主键
     * @return 钱包记录
     */
    WalletRecord selectWalletRecordById(Long id);


    /**
     * 新增钱包记录
     *
     * @param walletRecord 钱包记录
     * @return 结果
     */
    int insertWalletRecord(WalletRecord walletRecord);

    /**
     * 修改钱包记录
     *
     * @param walletRecord 钱包记录
     * @return 结果
     */
    int updateWalletRecord(WalletRecord walletRecord);

    /**
     * 删除钱包记录
     *
     * @param id 钱包记录主键
     * @return 结果
     */
    int deleteWalletRecordById(Long id);

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

    Page<WalletPageResp> walletPage(@Param("page") Page<Object> objectPage, @Param("req") WalletPageReq req, @Param("userVo") UserVo userVo);

    Page<WalletPageResp> walletStorePage(@Param("page") Page<Object> objectPage, @Param("req") WalletPageReq req, @Param("userVo") UserVo userVo);

    Page<WalletPageResp> walletSalePage(@Param("page") Page<Object> objectPage, @Param("req") WalletPageReq req, @Param("userVo") UserVo userVo);

    BigDecimal selectMonthBeforeAmount(@Param("beginOfMonth") Date beginOfMonth, @Param("userVo") UserVo userVo);

    WalletRecord walletDetail(@Param("id") Long id);

    List<WalletRecord> selectWalletRecordList(WalletRecord walletRecord);
}
