package com.uas.platform.b2b.dao;

import com.uas.platform.b2b.model.DeputyOrder;
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 DeputyOrderDao extends JpaRepository<DeputyOrder, Long>, JpaSpecificationExecutor<DeputyOrder> {

	/**
	 * 通过代采企业uu和下载状态及录入状态查询代采订单
	 * 
	 * @param enuu
	 * @param entryStatus
	 * @param downloadStatus
	 * @return
	 */
	List<DeputyOrder> getByDeputyuuAndEntrystatusAndDownloadstatus(Long enuu, String entryStatus,
			String downloadStatus);

	/**
	 * 通过单据流水号、下载状态（存在重复单号的问题）查询代采订单信息
	 * 
	 * @param code
	 * @param deputyuu
	 * @param status
	 * @return
	 */
	DeputyOrder findByCodeAndDeputyuuAndDownloadstatus(String code, Long deputyuu, String status);

}
