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

@Repository
public interface PurchaseOrderChangeItemDao extends JpaSpecificationExecutor<PurchaseOrderChangeItem>,
		JpaRepository<PurchaseOrderChangeItem, Long> {

	/**
	 * 按变更单的企业UU号来统计明细条数
	 * 
	 * @param vendUU
	 * @param status
	 * @return
	 */
	@Query("select count(o) from PurchaseOrderChangeItem o where o.orderChange.enUU = :enUU")
	 public Long getChangeItemByEnUU(@Param("enUU")  Long enUU);
}
