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.dto.ActivityPlanRewardDto;
import org.apache.ibatis.annotations.Param;
import com.yonge.cooleshow.biz.dal.entity.ActivityPlanReward;
import com.yonge.cooleshow.biz.dal.vo.ActivityPlanRewardVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityPlanRewardSearch;


public interface ActivityPlanRewardDao extends BaseMapper<ActivityPlanReward>{
	/**
	 * 查询详情
     * @author liweifan
     * @date 2022-08-17 11:13:13
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityPlanRewardVo
	 */
	ActivityPlanRewardVo detail(@Param("id") Long id);
	/**
	 * 通过活动id和奖品id查询详情
	 * @author liweifan
	 * @date 2022-08-17 11:13:13
	 * @return: com.yonge.cooleshow.biz.dal.vo.ActivityPlanRewardVo
	 */
	ActivityPlanReward detailByActivityIdAndRewardId(@Param("activityId") Long activityId,@Param("rewardId") Long rewardId, @Param("group") String group);
	/**
	 * 分页查询
     * @author liweifan
     * @date 2022-08-17 11:13:13
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityPlanRewardVo
	 */
	List<ActivityPlanRewardVo> selectPage(@Param("page") IPage page, @Param("param") ActivityPlanRewardSearch activityPlanReward);

	/**
	 * 查询活动下的奖品
	 * @param activityId
	 * @return
	 */
    List<ActivityPlanRewardDto> queryActivityPlanReward(@Param("activityId")Long activityId);

	List<ActivityPlanReward> getDelRewardList(@Param("activityId")Long activityId,@Param("rewardIds")  List<Long> rewardIds);




	/**
	 * 减少库存
	 *
	 * @param activityId 活动id
	 * @param activityRewardId   活动关闻奖品id
	 */
	int reduceStock(@Param("activityId") Long activityId, @Param("activityRewardId") Long activityRewardId);
}