package com.uas.platform.b2b.dao;

import java.util.List;

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.MakeOrderItem;

@Repository
public interface MakeOrderItemDao extends JpaSpecificationExecutor<MakeOrderItem>,
		JpaRepository<MakeOrderItem, Long> {
	/**
	 * 按订单单号和序号查找订单明细
	 * 
	 * @param enUU
	 * @param orderCode
	 * @param number
	 * @return
	 */
	@Query("from MakeOrderItem d where d.make.enUU = :enUU and d.make.code = :orderCode and d.number = :number")
	public List<MakeOrderItem> findByEnUUAndOrderCodeAndNumber(@Param("enUU") long enUU, @Param("orderCode") String orderCode,
			@Param("number") Short number);
	
}
