package com.uas.platform.b2b.dao;

import com.uas.platform.b2b.model.SaleQuotation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SaleQuotationDao extends JpaSpecificationExecutor<SaleQuotation>, JpaRepository<SaleQuotation, Long> {

	/**
	 * @param enUU
	 *            报价方企业ID
	 * @param code
	 *            流水号
	 * @return
	 */
	public List<SaleQuotation> findByEnUUAndCode(long enUU, String code);

	/**
	 * 按客户UU和传到客户ERP的状态查找
	 * 
	 * @param custUU
	 * @param sendStatus
	 * @return
	 */
	public List<SaleQuotation> findByCustUUAndSendStatus(long custUU, short sendStatus);
	
	/**
	 * 按供应商UU和传到供应商ERP的状态查找
	 * 
	 * @param enUU
	 * @param backStatus
	 * @return
	 */
	public List<SaleQuotation> findByEnUUAndStatusAndBackStatus(long enUU, short status, short backStatus);

	/**
	 *  按供应商UU和作废上传SAAS状态查找
	 * @param enUU
	 * @param invalidSendStatus
	 */
	List<SaleQuotation> findByEnUUAndInvalidSendStatus(Long enUU, short invalidSendStatus);
}
