package com.gree.mall.manager.commonmapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.bean.activity.fullpiece.PromotionFullPieceListVO;
import com.gree.mall.manager.bean.activity.fullpiece.PromotionFullPieceOrderVO;
import com.gree.mall.manager.bean.order.OrderDeliveryVO;
import com.gree.mall.manager.bean.order.OrderDetailBean;
import com.gree.mall.manager.bean.order.OrderDetailListBean;
import com.gree.mall.manager.plus.entity.OrderInfo;
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {

    /*通过查询信息查询下载的报表信息*/
    List<OrderDetailListBean> selectByQueryMsg(
            @Param("userId") String userId,  @Param("orderId")String orderId,  @Param("productName")String productName,  @Param("userName")String userName,
            @Param("phone")String phone,  @Param("exchangeCode")String exchangeCode,  @Param("orderStatus")String orderStatus,
            @Param("startCreateTime")String startCreateTime,  @Param("endCreateTime")String endCreateTime,
            @Param("startPayTime")String startPayTime,  @Param("endPayTime")String endPayTime,  @Param("promotionGroupUserName")String promotionGroupUserName,
            @Param("promotionGroupId")String promotionGroupId,@Param("promotionGroupUserId") String promotionGroupUserId,
            @Param("promotionFullPieceId") String promotionFullPieceId,@Param("websitId") String websitId,@Param("goodsId") String goodsId,
            @Param("companyWechatIds") List<String> companyWechatIds,@Param("websitIds") List<String> websitIds
    );

    //查询派工异常订单
    IPage<OrderInfo> abnormalDispatchOrder(IPage<OrderInfo> page, @Param("userId") String userId, @Param("orderId")String orderId, @Param("productName")String productName,
                                           @Param("userName")String userName, @Param("phone")String phone, @Param("exchangeCode")String exchangeCode,
                                           @Param("orderStatus")String orderStatus, @Param("startCreateTime")String startCreateTime,
                                           @Param("endCreateTime")String endCreateTime, @Param("startPayTime")String startPayTime,
                                           @Param("endPayTime")String endPayTime, @Param("websitId")String websitId,
                                           @Param("isNegative")String isNegative, @Param("abnormalDispatch")String abnormalDispatch,
                                           @Param("companyWechatIds") List<String> companyWechatIds,@Param("websitIds") List<String> websitIds);


    /**
     * 查询满件打折的订单总金额以及订单数量
     */
    PromotionFullPieceListVO queryTotalAmountCount(@Param("promotionFullPieceId") String promotionFullPieceId);

    /**
     * 查询满件打折活动的订单详情
     */
    IPage<PromotionFullPieceOrderVO> queryPromotionFullPieceOrder(IPage page, @Param("promotionFullPieceId") String promotionFullPieceId);

    IPage<OrderDeliveryVO> orderDelivery(Page page,  @Param("ex") ZfireParamBean zfireParam,@Param("companyWechatIds") List<String> companyWechatIds);
}
