package com.yonge.cooleshow.biz.dal.dao;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.queryInfo.UserRewardQueryInfo;
import com.yonge.cooleshow.biz.dal.vo.UserRewardVo;
import com.yonge.cooleshow.biz.dal.vo.activity.UserRewardWrapper;
import org.apache.ibatis.annotations.Param;
import com.yonge.cooleshow.biz.dal.entity.ActivityUserReward;
import com.yonge.cooleshow.biz.dal.vo.ActivityUserRewardVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityUserRewardSearch;


public interface ActivityUserRewardDao extends BaseMapper<ActivityUserReward>{
	/**
	 * 查询详情
     * @author liweifan
     * @date 2022-08-04 10:19:49
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityUserRewardVo
	 */
	ActivityUserRewardVo detail(@Param("id") Long id);

	/**
	 * 分页查询
     * @author liweifan
     * @date 2022-08-04 10:19:49
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityUserRewardVo
	 */
	List<UserRewardVo> selectPage(@Param("page") IPage page, @Param("param") ActivityUserRewardSearch activityUserReward);

	/**
	 * 用户关联活动分享老师信息
	 * @param activityId 活动ID
	 * @param userIds 用户ID
	 * @return List<UserRewardVo>
	 */
	List<UserRewardVo> selectActivityShareTeacher(@Param("activityId") Long activityId, @Param("userIds") List<Long> userIds);

	/**
	 * 查询领取的奖品数
	 */
	int selectReceiveRewardCount(@Param("query") UserRewardQueryInfo query);

	/**
	 * 修改领奖状态
	 */
	int receiveReward(@Param("userId") Long userId, @Param("receiveRewardId") Long receiveRewardId, @Param(
			"receiveTime") Date receiveTime);


	IPage<UserRewardWrapper> selectReceiveRewardList(@Param("page") IPage<UserRewardWrapper> page, @Param(
			"query") UserRewardQueryInfo query);
}