package com.kxs.product.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kxs.product.api.model.KxsTicket;
import com.kxs.product.api.vo.kxsapp.ticket.TicketListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 客小爽券码表(KxsTicket)表数据库访问层
 *
 * @author 系统
 * @since 2023-12-20 10:09:35
 */
@Mapper
public interface KxsTicketMapper extends BaseMapper<KxsTicket> {

    /**
     * 兑换券列表
     *
     * @param page       页
     * @param userId     用户 ID
     * @param ticketType
     * @return {@link IPage}<{@link TicketListVO}>
     */
    IPage<TicketListVO> getByPage(Page<TicketListVO> page, @Param("userId") Long userId, @Param("ticketType") Integer ticketType);

    /**
     * 划拨记录分页列表
     *
     * @param ticketCodes 码
     * @param userId      用户 ID
     */
    void updateBatchTransfer(@Param("ticketCodes") List<String> ticketCodes, @Param("userId") Integer userId);


}

