package com.zfire.mall.manager.commonmapper;

import com.baomidou.mybatisplus.annotation.SqlParser;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zfire.mall.manager.bean.CommonCountBean;
import com.zfire.mall.manager.bean.PoySaleCountBean;
import com.zfire.mall.manager.bean.listV2.LogisticsConfigurationVO;
import com.zfire.mall.manager.bean.listV2.OrderPlanCustomerVO;
import com.zfire.mall.manager.bean.retail.RetailOrderList;
import com.zfire.mall.manager.bean.supplier.KingDeeSupplierVO;
import com.zfire.mall.manager.plus.entity.KingDeeCustomer;
import com.zfire.mall.manager.zfire.bean.ZfireParamBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface CommonCountMapper {

    /**
     * 经销商提货列表统计
     * @return
     */
    @SqlParser(filter = true)
    PoySaleCountBean pickCount(
            @Param("takerId") String takerId,
            @Param("invoiceId") String invoiceId,
            @Param("createBy") String createBy,
            @Param("correspondId") String correspondId,
            @Param("pickStartTime") String pickStartTime,
            @Param("pickEndTime") String pickEndTime,
            @Param("id") String id,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("customerNumber") String customerNumber,
            @Param("customerName") String customerName,
            @Param("customerId") String customerId,
            @Param("serviceIds") List<String> serviceIds,
            @Param("status") Integer status,
            @Param("k3CategoryIds") List<String> k3CategoryIds);



    @SqlParser(filter = true)
    PoySaleCountBean saleOrderlistCount(
                              @Param("correspondName") String correspondName,
                              @Param("materialNumber") String materialNumber,
                              @Param("orderNo") String orderNo,
                              @Param("customerName")String customerName,
                              @Param("correspondId")String correspondId,
                              @Param("specification")String specification,
                              @Param("materialName")String materialName,
                              @Param("customerNumber")String customerNumber,
                              @Param("examineStatus")String examineStatus,
                              @Param("startTime")String startTime,
                              @Param("endTime")String endTime,
                              @Param("customerId") String customerId,
                              @Param("serviceIds") List<String> serviceIds,
                              @Param("k3CategoryIds") List<String> k3CategoryIds);



    PoySaleCountBean retailOrderListCount(
            @Param("id") String id,
            @Param("serviceId") String serviceId,
            @Param("examineStatus") String examineStatus,
            @Param("type") Integer type,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("customer") String customer,
            @Param("customerId") String customerId,
            @Param("serviceIds") List<String> serviceIds,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("createBy") String createBy,
            @Param("examineBy") String examineBy,
            @Param("adminCompanyIds")List<String> adminCompanyIds,
            @Param("isDirectTransfer") Boolean isDirectTransfer,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("materialCode") String materialCode
    );

    PoySaleCountBean enginOrderCount(String customerKeyword, List<String> enginOrderNo, String enginOrderType, String refEnginRecordNo,
                                       String refProjectName, String refUseUnit, String startCreateTime, String endCreateTime, String saleTypeId,
                                       String createName, String confirmName, List<String> examineStatus, String serviceId, List<String> adminCompanyIds,
                                       List<String> serviceIds, String customerId);



    IPage<KingDeeCustomer> queryKingDeeCustomer(IPage page,
                                                @Param("keyword") String keyword,
                                                @Param("region") String region,
                                                @Param("bindUser") Boolean bindUser,
                                                @Param("isGroupCompany") Boolean isGroupCompany,
                                                @Param("customerId") String customerId,
                                                @Param("websitNumber") String websitNumber,
                                                @Param("notFilterCustomerId") String notFilterCustomerId,
                                                @Param("jianXianType") String jianXianType);


    IPage<KingDeeSupplierVO> listV2(Page page, @Param("ex")  ZfireParamBean zfireParamBean);


    /**
     * 经销商采购计划汇总
     * @return
     */
    @SqlParser(filter = true)
    IPage<OrderPlanCustomerVO> listCustomerV2(Page page,@Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 物流配置列表
     * @return
     */
    @SqlParser(filter = true)
    IPage<LogisticsConfigurationVO> listLogisticsConfigurationV2(Page page,@Param("ex") ZfireParamBean zfireParamBean);
}
