package com.qs.mp.user.mapper;

import com.qs.mp.user.domain.UserHitPrize;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.mp.user.domain.vo.TicketHitPrizeBarrageVO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @auther quanshu
 * @create 2022-03-07 20:45:43
 * @describe 用户中奖记录mapper类
 */
public interface UserHitPrizeMapper extends BaseMapper<UserHitPrize> {

    /**
     * 获取除该用户外的近 20 条中奖弹幕
     *
     * @param userId 用户 id
     * @return
     */
    List<TicketHitPrizeBarrageVO> selectTicketHitPrizeBarrageNotByUserId(@Param("userId") Long userId);

    /**
     * 获取用户当天中奖的 2 条弹幕
     *
     * @param userId
     * @return
     */
    List<TicketHitPrizeBarrageVO> selectTicketHitPrizeBarrageByUserId(@Param("userId") Long userId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);


    /**
     * 获取除当前用户外，6 个月内 5 条大奖弹幕
     * @param userId
     * @param startTime
     * @param endTime
     * @return
     */
    List<TicketHitPrizeBarrageVO> selectTicketExpensiveHitPrizeBarrageNotByUserId(@Param("userId") Long userId,@Param("startTime") LocalDateTime startTime,@Param("endTime") LocalDateTime endTime);

}
