package com.hzs.sale.ticket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.sale.ticket.ext.SaTicketExt;
import com.hzs.common.domain.sale.ticket.SaTicket;
import com.hzs.sale.ticket.param.SaTicketParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 门票主表 Mapper 接口
 *
 * @author hzs
 * @since 2025-01-09
 */
public interface SaTicketMapper extends BaseMapper<SaTicket> {

    /*
     * @description: 查询购票记录
     * @author: sui q
     * @date: 2025/1/10 11:29
     * @param: null null
     **/
    List<SaTicketExt> querySaTicketByParam(@Param("saTicketParam") SaTicketParam saTicketParam);

    /*
     * @description: 查询销售门票数量
     * @author: sui q
     * @date: 2025/1/13 11:36
     * @param: null null
     **/
    Integer queryBuySaTicketNum(Long pkTicket);

    /**
     * 查询会员购买票数
     *
     * @param pkTicket 门票活动
     * @param pkMember 会员ID
     * @return
     */
    Integer sumQuantity(@Param("pkTicket") Long pkTicket,
                        @Param("pkMember") Long pkMember);
}
