package com.bonus.canteen.core.supply.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.supply.domain.DrpQuote;
import com.bonus.canteen.core.supply.po.DrpFinalBidsQuotePageModel;
import com.bonus.canteen.core.supply.vo.DrpExcelQuoteDetailVO;
import com.bonus.canteen.core.supply.vo.DrpQuerySupplierQuoteDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DrpQuoteMapper extends BaseMapper<DrpQuote> {
   List<DrpExcelQuoteDetailVO> listExcelDetail(String inquirySupplierId);

   @Select({"select c.supplier_id,d.supplier_name,a.quote_num,a.single_price,a.total_price,c.arrival_time from drp_quote a LEFT JOIN drp_inquiry_detail b on a.inquiry_detail_id = b.inquiry_detail_id LEFT JOIN drp_inquiry_supplier c on c.inquiry_supplier_id = a.inquiry_supplier_id LEFT JOIN drp_supplier d on d.supplier_id = c.supplier_id\nwhere c.bid_status <> 2 and  a.inquiry_detail_id = #{inquiryDetailId}"})
   List<DrpFinalBidsQuotePageModel> listSupplierQuote(Long inquiryDetailId);

   List<DrpQuerySupplierQuoteDetailVO> querySupplierQuoteDetail(@Param("inquirySupplierId") Long inquirySupplierId);
}
