package com.qmth.qrzk.dao.repositories;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.qmth.qrzk.repository.user.model.PaperBatch;

public interface BatchRepo extends JpaRepository<PaperBatch, Integer>{

	/**
	 * 查找当前批次
	 * @return
	 */
	@Query("select b from PaperBatch b where b.createdTime = (select max(t.createdTime) from PaperBatch t WHERE t.batchType='SUPPLY')")
	List<PaperBatch> findLastest();
	
	List<PaperBatch> findByAdmin(String admin);
}
