package com.jwipc.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.order.entity.DeliveryOrderDetail;
import com.jwipc.order.model.po.DeliveryOrderDetailPO;
import com.jwipc.order.model.query.DeliveryOrderDetailQuery;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 送货单明细 Mapper 接口
 * </p>
 *
 * @author zhangjie
 * @since 2024-03-06
 */
public interface DeliveryOrderDetailMapper extends BaseMapper<DeliveryOrderDetail> {

    List<DeliveryOrderDetailPO> findForList(Page<DeliveryOrderDetailPO> orderDetailPOPage,
                                            @Param("query") DeliveryOrderDetailQuery query);

    List<DeliveryOrderDetailPO> findForList(@Param("query") DeliveryOrderDetailQuery query);

    BigDecimal findCountByMaterialCodeAndFactory(@Param("materialCode") String materialCode,
                                                 @Param("factory") String factory,
                                                 @Param("status") Integer status, @Param("delFlag") int delFlag);

    BigDecimal findCountByPurchaseDetail(@Param("purchaseOrderCode") String purchaseOrderCode,
                                         @Param("purchaseOrderRow") String purchaseOrderRow,
                                         @Param("status") int status,
                                         @Param("delFlag")  int delFlag);

    BigDecimal findSendNumBySuplierCodeAndMaterialCode(@Param("effectiveDate") String effectiveDate, @Param("supplierCode") String supplierCode,
                                         @Param("materialCode") String materialCode,@Param("delFlag")  int delFlag);

    BigDecimal findSendNumByOrderId(@Param("orderId") String orderId);
}
