package com.bizzan.bitrade.dao;

import com.bizzan.bitrade.dao.base.BaseDao;
import com.bizzan.bitrade.entity.ExperienceGiftWithdraw;
import com.bizzan.bitrade.entity.ExperienceGiftWithdrawStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ExperienceGiftWithdrawDao extends BaseDao<ExperienceGiftWithdraw>, ExperienceGiftWithdrawDaoCustom {

    /** 统计某用户指定状态的提现申请数量（用于防重复提交校验） */
    int countByMemberIdAndStatus(Long memberId, ExperienceGiftWithdrawStatus status);

    /** 查询用户自己的提现记录（按申请时间倒序） */
    List<ExperienceGiftWithdraw> findByMemberIdOrderByApplyAtDesc(Long memberId);

    /** 分页查询用户自己的提现记录 */
    Page<ExperienceGiftWithdraw> findByMemberIdOrderByApplyAtDesc(Long memberId, Pageable pageable);
}
