package com.hzs.activity.draw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.activity.draw.param.AcDrawRewardNumParam;
import com.hzs.common.domain.activity.draw.AcDrawRewardNum;
import com.hzs.common.domain.activity.draw.ext.AcDrawRewardNumExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 会员可抽奖次数记录 Mapper 接口
 */
public interface AcDrawRewardNumMapper extends BaseMapper<AcDrawRewardNum> {

    /*
     *  查询
     **/
    AcDrawRewardNumExt queryDrawRewardNumByCondition(AcDrawRewardNumParam acDrawRewardNumParam);

    /*
     *  会员后台查询抽奖次数
     **/
    List<AcDrawRewardNumExt> queryDrawRewardExtNumByCondition(AcDrawRewardNumParam acDrawRewardNumParam);

    /**
     * 修改已购买次数 （更新）
     *
     * @param pkMember
     * @param num
     * @param pkBaseId
     */
    void updatePurchasedTimesByBaseId(@Param("pkMember") Long pkMember, @Param("num") Integer num, @Param("pkBaseId") Long pkBaseId);

    /**
     * 修改未购买次数
     *
     * @param pkMember 会员主键
     * @param num      数量
     * @param pkBaseId 活动主键
     */
    void updateUnpurchasedTimesByPkbaseId(@Param("pkMember") Long pkMember, @Param("num") Integer num, @Param("pkBaseId") Long pkBaseId);
}
