package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.lease.dto.*;
import com.m2pool.lease.entity.LeasePayRechargeMessage;
import com.m2pool.lease.entity.LeaseUserWalletData;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 充值业务mapper层
 * </p>
 *
 * @author yyb
 * @since 2025-09-10
 */
@Mapper
public interface LeasePayRechargeMessageMapper extends BaseMapper<LeasePayRechargeMessage> {

    /**
     * 获取充值记录列表
     *
     * @param walletList 钱包集合
     * @param status
     * @return
     */
    @Deprecated
    List<PayRechargeMessageDto> balanceRechargeList(@Param("walletList") List<LeaseUserWalletData> walletList, @Param("status") Integer  status);

    /**
     * 获取近半年是否有充值记录
     *
     * @param fromAddress
     * @return
     */
    boolean checkRechargeOperator(@Param("fromAddress") String  fromAddress);

    /**
     * 批量获取近半年是否有充值记录
     *
     * @param fromAddressList
     * @return
     */
    @MapKey("fromAddress")
    Map<String, CheckAddressDto> checkRechargeOperatorBatch(@Param("list") List<LeaseUserWalletData> fromAddressList);

    /**
     * 交易流水---充值
     *
     * @param walletList
     * @return
     */
    List<TransactionRecordDto> transactionRecord(@Param("walletList") List<LeaseUserWalletData> walletList);


    /**
     * 最近交易
     *
     * @param walletList
     * @return
     */
    List<RecentlyTransactionDto> getRecentlyTransaction(@Param("walletList") List<LeaseUserWalletData> walletList);

    /**
     * 根据唯一索引修改或删除
     *
     * @param leasePayRechargeMessage
     * @return
     */
    int saveOrUpdateByIndex(@Param("leasePayRechargeMessage") LeasePayRechargeMessage leasePayRechargeMessage);
}
