package com.qs.mp.admin.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.qs.mp.admin.domain.Ticket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.mp.admin.domain.vo.TicketCntVO;
import com.qs.mp.channel.domain.ChannelOrderDetail;

import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * @auther quanshu
 * @create 2022-03-08 11:35:25
 * @describe 盲票mapper类
 */
public interface TicketMapper extends BaseMapper<Ticket> {
  Ticket getRandOne(@Param("boxId") String boxId, @Param("status") int status);

  List<Ticket> listTicket(@Param(Constants.WRAPPER) Wrapper<Ticket> queryWrapper);
  
  /**
   * 统计经销商盲票销量，库存
   * @param channelId
   * @return
   */
  int getTicketQtyCnt(@Param("channelId") Long channelId);
  
  /**
   * 查询统计数据
   * @param queryWrapper
   * @return
   */
  List<TicketCntVO> listTicketQtyCnt(@Param(Constants.WRAPPER) Wrapper<ChannelOrderDetail> queryWrapper);
}
