package com.uas.platform.b2b.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.uas.platform.b2b.model.PurchaseAcceptItem;

@Repository
public interface PurchaseAcceptItemDao extends JpaSpecificationExecutor<PurchaseAcceptItem>,
		JpaRepository<PurchaseAcceptItem, Long> {

	/**
	 * 通过单号，序号查询验收单详情
	 * 
	 * @param enUU
	 * @param code
	 * @param number
	 * @return
	 */
	@Query("from PurchaseAcceptItem i where i.accept.enUU = :enUU and i.accept.code = :code and i.number = :number")
	PurchaseAcceptItem findByEnUUAndCodeAndNumber(@Param("enUU") Long enUU, @Param("code") String code,
			@Param("number") Short number);
}
