package com.qs.mp.admin.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.qs.mp.admin.domain.Ticket;
import com.qs.mp.admin.domain.excel.TicketExcel;
import com.qs.mp.admin.domain.vo.TicketCntVO;
import com.qs.mp.channel.domain.ChannelOrderDetail;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 盲票 服务类
 * </p>
 *
 * @author quanshu
 * @since 2022-03-08
 */
public interface ITicketService extends IService<Ticket> {

  /**
   * 随机取一条
   * @param boxId
   * @return
   */
  Ticket getRandOne(String boxId);


  /**
   * 盲票导入
   * 导入就是只根据盲票序号更新幸运数字和抽奖数字两个字段
   * @param ticketExcelList
   * @return 导入的条数
   */
  int importTicket(List<TicketExcel> ticketExcelList);

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