package com.uas.platform.b2b.dao;

import java.util.List;

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.Vendor;
import com.uas.platform.core.data.repository.GenericRepository;

@Repository
public interface VendorDao extends JpaSpecificationExecutor<Vendor>, GenericRepository<Vendor, Long> {

	/**
	 * @param myEnUU
	 *            我的企业ID
	 * @param vendUU
	 *            供应商企业ID
	 * @return
	 */
	@Query("from Vendor v where v.myEnUU = :myEnUU and v.vendorEnterprise.uu = :vendUU")
	public List<Vendor> findByMyEnUUAndVendUU(@Param("myEnUU") long myEnUU, @Param("vendUU") long vendUU);

}
