package com.qs.mp.user.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qs.mp.admin.domain.param.IndexTicketBoxTopQueryParam;
import com.qs.mp.admin.domain.param.IndexTicketSiteTopQueryParam;
import com.qs.mp.admin.domain.vo.IndexVO;
import com.qs.mp.admin.domain.vo.TicketCntVO;
import com.qs.mp.admin.domain.vo.UserTicketOrderDetailVO;
import com.qs.mp.admin.domain.vo.UserTicketOrderListVO;
import com.qs.mp.channel.domain.ChannelOrder;
import com.qs.mp.user.domain.UserDeliverOrder;
import com.qs.mp.user.domain.UserTicketOrder;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;

/**
 * @auther quanshu
 * @create 2022-03-07 20:45:43
 * @describe 用户盲票订单mapper类
 */
public interface UserTicketOrderMapper extends BaseMapper<UserTicketOrder> {

	  /**
	   * 统计交易金额
	   * @param wrapper
	   * @return
	   */
	  List<IndexVO> selectIndexPayAmtList(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> wrapper);
	  
	  /**
	   * 统计交易用户数
	   * @param wrapper
	   * @return
	   */
	  List<IndexVO> selectIndexPayUserCntList(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> wrapper);
	  
	  /**
	   * 统计实时交易数据
	   * @param wrapper
	   * @return
	   */
	  List<IndexVO> selectIndexDailyInfoList(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> wrapper);
	  
	  /**
	   * 统计票组销售TOP10
	   * @param wrapper
	   * @return
	   */
	  List<IndexVO> selectIndexTicketBoxTop(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> wrapper);
	  
	  /**
	   * 统计经销商交易额TOP10
	   * @param wrapper
	   * @return
	   */
	  List<IndexVO> selectIndexTicketSiteTop(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> wrapper);
	  
	  /**
	   * 查询子渠道全部的盲票销售张数
	   * @param channelNo
	   * @return
	   */
	  int getChannelTotalTicketNumCnt(@Param("channelNo") String channelNo);
	  
	  /**
	   * 查询经销商的盲票销售张数
	   * @param channelNo
	   * @return
	   */
	  int getSaleSiteTotalTicketNumCnt(@Param("channelId") Long channelId);
	  
	  /**
	    * 统计经销商盲票销量，线下和线上
	    * @param channelId
	    * @return
	    */
	   TicketCntVO getTicketSaleCnt(@Param("channelId") Long channelId);
	   
	   /**
	    * 查询统计经销商盲票销量数据,线下和线上
	    * @param queryWrapper
	    * @return
	    */
	   List<TicketCntVO> listTicketSaleCnt(@Param(Constants.WRAPPER) Wrapper<UserTicketOrder> queryWrapper);

	/**
	 * 获取用户盲票订单列表
	 * @param queryWrapper
	 * @return
	 */
	List<UserTicketOrderListVO> listUserTicketOrder(@Param(Constants.WRAPPER) QueryWrapper<UserTicketOrder> queryWrapper);

	/**
	 * 查询用户盲票订单详情
	 * @param
	 * @return
	 */
	UserTicketOrderDetailVO selectUserTicketOrderDetail(@Param(Constants.WRAPPER) QueryWrapper<UserTicketOrder> queryWrapper);

	int countUserTicketOrder(@Param(Constants.WRAPPER) QueryWrapper<UserTicketOrder> queryWrapper);

	/**
	 * 统计盲票组销量
	 * @return
	 */
    List<IndexVO> selectIndexTicketBoxTopByTicketOrderAndChannelOrder(@Param("param") IndexTicketBoxTopQueryParam indexTicketBoxTopQueryParam );

	/**
	 * 统计经销商交易额
	 * @param indexTicketSiteTopQueryParam
	 * @return
	 */
    List<IndexVO> selectIndexTicketSiteTopByTicketOrderAndChannelOrder(@Param("param") IndexTicketSiteTopQueryParam indexTicketSiteTopQueryParam);

}
