package com.jwipc.inquiry.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.inquiry.entity.InquiryMaterialSupplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jwipc.inquiry.model.po.AssistantSupplierPO;
import com.jwipc.inquiry.model.po.InquiryMaterialSupplierPO;
import com.jwipc.inquiry.model.po.InquiryMaterialSupplierQuotaJobPO;
import com.jwipc.inquiry.model.query.InquiryQuoteQuery;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 询价供应商表 Mapper 接口
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-21
 */
public interface InquiryMaterialSupplierMapper extends BaseMapper<InquiryMaterialSupplier> {

    List<InquiryMaterialSupplierPO> getGroupListByInquiryId(@Param("inquiryId") Long inquiryId,@Param("bidFlag") Integer bidFlag);

    List<InquiryMaterialSupplierPO> getListByInquiryIdAndInquiryMaterialId(@Param("inquiryId") Long inquiryId, @Param("inquiryMaterialId") Long inquiryMaterialId);

    List<InquiryMaterialSupplierPO> quoteList(@Param("query") InquiryQuoteQuery query);

    List<AssistantSupplierPO> getAssistantSupplierByInquiryId(@Param("inquiryId") Long inquiryId);

    List<AssistantSupplierPO> getAssistantSupplierByInquiryIdAndInquiryMaterialIdAndSupplierCodeList(@Param("inquiryId") Long inquiryId,@Param("inquiryMaterialId") Long inquiryMaterialId, @Param("supplierCodeList") Set<String> supplierCodeList);

    List<InquiryMaterialSupplierQuotaJobPO> getSupplierQuotaJob(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<InquiryMaterialSupplierPO> quoteListPage(Page<InquiryMaterialSupplier> dbPage, @Param("query") InquiryQuoteQuery query);
    List<InquiryMaterialSupplierQuotaJobPO> getQuotationEndNoticeJob();

    List<InquiryMaterialSupplierPO> getBidInquiryListByPurchaseApplyCode(@Param("purchaseApplyCode") String purchaseApplyCode, @Param("itemNo") String itemNo);
}
