package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.lease.dto.*;
import com.m2pool.lease.dto.v2.PayWithdrawSellerRecordDto;
import com.m2pool.lease.entity.LeasePayWithdrawMessage;
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 LeasePayWithdrawMessageMapper extends BaseMapper<LeasePayWithdrawMessage> {

   /**
    * 获取提现记录列表
    *
    * @param walletList 钱包集合
    * @param status
    * @return
    */
   @Deprecated
   List<PayWithdrawMessageDto> balanceWithdrawList(@Param("walletList") List<LeaseUserWalletData> walletList,
                                                   @Param("status") Integer  status);


   /**
    * 检查用户半年内是否有提现操作
    * @param fromAddress
    * @return
    */
   boolean checkWithdrawOperator(@Param("fromAddress") String  fromAddress);


   /**
    * 检查用户半年内是否有提现操作
    * @param fromAddressList
    * @return
    */
   @MapKey("fromAddress")
   Map<String, CheckAddressDto> checkWithdrawOperatorBatch(@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 fromAddress
    * @return
    */
   Integer getRecentlyOneData(@Param("fromAddress") String  fromAddress,@Param("chain")String chain);


   /**
    * 获取商户提现记录
    *
    * @param shopId
    * @return
    */
   List<PayWithdrawSellerRecordDto> getSellerWithdrawRecord(@Param("shopId") Long shopId);
}
