Commit 401efc91 authored by Matija Obreza's avatar Matija Obreza

Count them too

parent 0ea82abc
......@@ -110,7 +110,7 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> {
@Query("select a from Accession a inner join a.taxonomy t where a.instituteCode=:instCode and a.accessionName=:acceNumb and t.genus=:genus")
Accession findOne(@Param("instCode") String holdingInstitute, @Param("acceNumb") String accessionName, @Param("genus") String genus);
@Query("select count(a.id) from Accession a where a.id in ( ?1 ) and a.availability = true")
@Query("select count(a.id) from Accession a where a.id in ( ?1 ) and a.availability = true and a.institute.allowMaterialRequests = true")
long countAvailableForDistribution(Set<Long> accessionIds);
@Query("select a.id from Accession a where a.id in ( ?1 ) and a.availability = true and a.institute.allowMaterialRequests = true")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment