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 接口
 *
 * @author hzs
 * @since 2023-04-21
 */
public interface AcDrawRewardNumMapper extends BaseMapper<AcDrawRewardNum> {

    /*
     * @description: 查询
     * @author: sui q
     * @date: 2023/4/27 15:14
     * @param: null null
     **/
    AcDrawRewardNumExt queryDrawRewardNumByCondition(AcDrawRewardNumParam acDrawRewardNumParam);

    /*
     * @description: 会员后台查询抽奖次数
     * @author: sui q
     * @date: 2023/6/1 10:36
     * @param: null null
     **/
    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);
}
