
package com.tmerclub.cloud.order.mapper;

import com.tmerclub.cloud.order.bo.mongo.MongoPurchaseOrderBO;
import com.tmerclub.cloud.order.dto.PurchaseOrderDTO;
import com.tmerclub.cloud.order.model.PurchaseOrder;
import com.tmerclub.cloud.order.vo.PurchaseOrderExcelVO;
import com.tmerclub.cloud.order.vo.PurchaseOrderVO;
import com.tmerclub.cloud.order.vo.UnDeliveryPurchaseOrderExcelVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购订单
 *
 * @author lhd
 * @date 2022-06-22 17:12:02
 */
public interface PurchaseOrderMapper {

    /**
     * 根据id获取采购订单列表
     * @param purchaseOrderIds 采购订单id
     * @return 采购订单列表
     */
    List<PurchaseOrderVO> listByPurchaseOrderIds(@Param("purchaseOrderIds") List<Long> purchaseOrderIds);

    /**
     * 根据采购订单id获取采购订单
     *
     * @param purchaseOrderId 采购订单id
     * @return 采购订单
     */
    PurchaseOrder getByPurchaseOrderId(@Param("purchaseOrderId") Long purchaseOrderId);

    /**
     * 保存采购订单
     *
     * @param purchaseOrder 采购订单
     */
    void save(@Param("purchaseOrder") PurchaseOrder purchaseOrder);

    /**
     * 更新采购订单
     *
     * @param purchaseOrder 采购订单
     */
    void updateByPurchaseId(@Param("purchaseOrder") PurchaseOrder purchaseOrder);

    /**
     * 采购订单信息
     *
     * @param purchaseOrderId 采购订单号
     * @param supplierId
     * @param lang
     * @return
     */
    PurchaseOrderVO info(@Param("purchaseOrderId") Long purchaseOrderId, @Param("supplierId") Long supplierId, @Param("lang") Integer lang);

    /**
     * 获取
     *
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    List<UnDeliveryPurchaseOrderExcelVO> listUnDeliveryPurchaseOrder(@Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 分页
     *
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    List<PurchaseOrderExcelVO> listPurchaseOrderDetail(@Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 获取采购订单及订单项的信息
     *
     * @param purchaseOrderId 采购订单id
     * @return 采购订单信息
     */
    MongoPurchaseOrderBO getMongoPruchaseOrderInfo(@Param("purchaseOrderId") Long purchaseOrderId);
}
