package com.zfire.mall.manager.commonmapper.retail;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zfire.mall.manager.bean.direct.DirectTransferList;
import com.zfire.mall.manager.bean.retail.ProductPriceBean;
import com.zfire.mall.manager.bean.retail.RetailOrderList;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface RetailOrderCommonMapper {

    public IPage<RetailOrderList> queryRetailOrderList(
            IPage page,
            @Param("customerWalletId") String customerWalletId,
            @Param("saleTypeId") String saleTypeId,
            @Param("id") String id,
            @Param("policyCode") String policyCode,
            @Param("policyRemark") String policyRemark,
            @Param("serviceId") String serviceId,
            @Param("k3ServiceId") String k3ServiceId,
            @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,
            @Param("k3CategoryNumber") String k3CategoryNumber,
            @Param("k3CategoryIds") List<String> k3CategoryIds
    );

    public Integer queryRetailOrderCount(
                                         @Param("customerWalletId") String customerWalletId,
                                         @Param("saleTypeId") String saleTypeId,
                                         @Param("id") String id,
                                         @Param("policyCode") String policyCode,
                                         @Param("policyRemark") String policyRemark,
                                         @Param("serviceId") String serviceId,
                                         @Param("k3ServiceId") String k3ServiceId,
                                         @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,
                                         @Param("k3CategoryNumber") String k3CategoryNumber,
                                         @Param("k3CategoryIds") List<String> k3CategoryIds);

    public IPage<ProductPriceBean> queryProductList(
            IPage page,
            @Param("mainId") String mainId,
            @Param("saleId") String saleId,
            @Param("materialNumber") String materialNumber,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("price1") BigDecimal price1,
            @Param("price2") BigDecimal price2,
            @Param("oldNumbers") List<String> oldNumbers,
            @Param("billType") String billType);

    public IPage<DirectTransferList> queryDirectTransfer(
            IPage page,
            @Param("deliverNo") String deliverNo,
            @Param("orderNo") String orderNo,
            @Param("enginRecordNo") String enginRecordNo,
            @Param("orderType") String orderType,
            @Param("customerName") String customerName,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime
    );

    /**
     * 获取经销商审核通过的政策单的某机型数量
     */
    public Integer queryPolicyOrderNums(@Param("customerId") String customerId,
                                        @Param("materialId") String materialId,
                                        @Param("policyId") String policyId,
                                        @Param("examineStatus") String examineStatus);


}
