diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java index a228ac9..0dfabfe 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java @@ -19,22 +19,22 @@ public interface StatsRepository extends CrudRepository { Iterable> viewsByTopics(); - @Query("select new map(r.domain as label, count(r.language) as y) from Research r group by r.domain") + @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain") Iterable> languageByTopics(); - @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')") + @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')") Iterable> languageByYears(); - @Query("select new map(to_char(r.releaseDate, 'month') as label, count(r.language) as y) from Research r group by to_char(r.releaseDate, 'month')") + @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate, 'month')") Iterable> languageByMonths(); - @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(r) as y) from Research r group by to_char(r.releaseDate,'YYYY')") + @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate,'YYYY')") Iterable> researchesByYears(); - @Query("select new map(r.domain as label, count(r) as y) from Research r group by r.domain") + @Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain") Iterable> researchesByTopics(); - @Query("select new map(to_char(r.releaseDate, 'month') as label, count(r) as y) from Research r group by to_char(r.releaseDate, 'month')") + @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate, 'month')") Iterable> researchesByMonth(); }