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.k3.StockPositionStock;
import com.zfire.mall.manager.bean.listV2.dto.InvoiceProjectDTO;
import com.zfire.mall.manager.bean.pick.PickManagerBean;
import com.zfire.mall.manager.bean.pick.PickManagerBeanVO;
import com.zfire.mall.manager.bean.pick.PickManagerDetailBean;
import com.zfire.mall.manager.bean.ship.*;
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;

/**
 * @author chang
 */
@Mapper
public interface ShipMapper {

    @SqlParser(filter = true)
    IPage<ShipDocumentBean> list(IPage page,
                                 @Param("k3serviceId") String k3serviceId,
                                 @Param("id") String id,
                                 @Param("mainOrderId") String mainOrderId,
                                 @Param("customerName") String customerName,
                                 @Param("materialName") String materialName,
                                 @Param("specification") String specification,
                                 @Param("startTime") String startTime,
                                 @Param("endTime") String endTime,
                                 @Param("customerNumber") String customerNumber,
                                 @Param("customerId") String customerId,
                                 @Param("serviceIds") List<String> serviceIds,
                                 @Param("categoryName") String categoryName,
                                 @Param("serviceId") String serviceId,
                                 @Param("k3CategoryIds") List<String> k3CategoryIds);


    @SqlParser(filter = true)
    IPage<RetreatDocumentBean> listRetreat(IPage page,
                                           @Param("retreatOrderNo") String retreatOrderNo,
                                           @Param("customerName") String customerName,
                                           @Param("materialName") String materialName,
                                           @Param("specification") String specification,
                                           @Param("startTime") String startTime,
                                           @Param("endTime") String endTime,
                                           @Param("customerNumber") String customerNumber,
                                           @Param("customerId") String customerId,
                                           @Param("serviceIds") List<String> serviceIds,
                                           @Param("k3CategoryIds") List<String> k3CategoryIds);



  /*  @SqlParser(filter = true)
    IPage<PickManagerBean> listPick(IPage page,
                                    @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
                                    );*/

    IPage<PickManagerBean> listPick(IPage page,
                                    @Param("logisticsId") String logisticsId,
                                    @Param("printStartTime") String printStartTime,
                                    @Param("printEndTime") String printEndTime,
                                    @Param("salesOrderId") String salesOrderId,
                                    @Param("customerIds") String customerIds,
                                    @Param("takerPhone") String takerPhone,
                                    @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("correspondIds") List<String> correspondIds,
                                    @Param("k3CategoryIds") List<String> k3CategoryIds);




    @SqlParser(filter = true)
    void printAdd(@Param("ids") List<String> ids);

    RetreatDocumentDetail detail(String id);

    ShipDocumentDetail detailShip(String id);


    @SqlParser(filter = true)
    IPage<ShipDocumentProjectBean> listProject(IPage page,
                                               @Param("refRegionWork") String refRegionWork,
                                               @Param("mainOrderId") String mainOrderId,
                                               @Param("id") String id,
                                               @Param("enginOrderNo") String enginOrderNo,
                                               @Param("categoryName") String categoryName,
                                               @Param("refEnginRecordNo") String refEnginRecordNo,
                                               @Param("customerName") String customerName,
                                               @Param("materialName") String materialName,
                                               @Param("specification") String specification,
                                               @Param("startTime") String startTime,
                                               @Param("endTime") String endTime,
                                               @Param("customerNumber") String customerNumber,
                                               @Param("orderType") String orderType,
                                               @Param("customerId") String customerId,
                                               @Param("serviceIds") List<String> serviceIds,
                                               @Param("serviceId") String serviceId);

    ShipDocumentProjectDetail detailProject(@Param("id") String id);

    IPage<RetreatInvoiceBean> listInvoice(IPage page, @Param("id") String id,
                                          @Param("customerId") String customerId,
                                          @Param("serviceIds") List<String> serviceIds);

    PickManagerDetailBean detailPick(String id);

    IPage<PickManagerBean> listPrint(IPage page,
                                     @Param("takerPhone") String takerPhone,
                                     @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);

    IPage<KingDeeCustomer> listCustomer(IPage page,
                                        @Param("phone")String phone,
                                        @Param("keyword")String keyword,
                                        @Param("region")String region);


    @SqlParser(filter = true)
    void printAddInvoice(@Param("ids") List<String> ids);

    @SqlParser(filter = true)
    IPage<PickManagerBeanVO> listV2(Page page, @Param("ex") ZfireParamBean zfireParamBean,
                                    @Param("customerId") String customerId,
                                    @Param("serviceIds")  List<String> serviceIds,
                                    @Param("correspondIds")  List<String> collect,
                                    @Param("k3CategoryIds") List<String> k3CategoryIds);
}
