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

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.wrapper.StatGroupWrapper;
import org.apache.ibatis.annotations.Param;
import com.yonge.cooleshow.biz.dal.entity.ActivityReward;
import com.yonge.cooleshow.biz.dal.vo.ActivityRewardVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityRewardSearch;


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

    ActivityRewardVo detailByActivityId(@Param("id") Long id);

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

    /**
     * 列表查询
     *
     * @param activityReward
     * @return
     */
    List<ActivityRewardVo> selectAll(@Param("param") ActivityRewardSearch activityReward);

    /**
     * 活动奖品
     *
     * @param activityPlanId 活动id
     * @return
     */
    List<ActivityReward> getActivityReward(@Param("activityPlanId") Long activityPlanId);

    /**
     * 判断用户是否发过奖
     *
     * @param userId
     * @param activityId
     * @return
     */
    Boolean userRewarded(@Param("userId") Long userId, @Param("activityId") Long activityId);

    /**
     * 奖品关联活动统计
     * @param rewardIds 奖品ID
     * @return List<StatGroupWrapper>
     */
    List<StatGroupWrapper> selectRewardActivityStatInfo(@Param("rewardIds") List<Long> rewardIds);
}