package com.uas.platform.b2b.history.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.history.model.PurchaseOrderReply;

@Repository("history.PurchaseOrderReplyDao")
public interface PurchaseOrderReplyDao extends JpaSpecificationExecutor<PurchaseOrderReply>, JpaRepository<PurchaseOrderReply, Long> {
	/**
	 * 按订单明细ID查找订单明细回复
	 * 
	 * @param orderItemId
	 * @return
	 */
	@Query("from PurchaseOrderReply r where r.orderItem.id = :orderItemId order by r.date desc")
	public List<PurchaseOrderReply> findByOrderItemId(@Param("orderItemId") long orderItemId);
}
