Skip to content

Commit

Permalink
Merge pull request #230 from EFUB4-Jukebox/deploy
Browse files Browse the repository at this point in the history
[Deploy] 올해 등록된 핀 갯수 변수 수정 배포
  • Loading branch information
seohyun-lee authored Oct 1, 2024
2 parents e53d24b + 525fe9d commit 931a20b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public interface PinRepository extends JpaRepository <Pin, Long> {
@Query("SELECT p FROM Pin p WHERE p.creator = :creator AND YEAR(p.listenedDate) = :year AND MONTH(p.listenedDate) = :month")
List<Pin> findAllByCreatorAndDate(@Param("creator") Member creator, @Param("year") int year, @Param("month") int month);

@Query("SELECT COUNT(p) FROM Pin p WHERE YEAR(p.listenedDate) = :currentYear")
long countByListenedDateYear(@Param("currentYear") int currentYear);
@Query("SELECT COUNT(p) FROM Pin p WHERE YEAR(p.createdTime) = :currentYear")
long countByCreatedTimeYear(@Param("currentYear") int currentYear);

@Query("SELECT p.genre.genreName, COUNT(p) FROM Pin p GROUP BY p.genre ORDER BY COUNT(p) DESC")
List<Object[]> findMostPopularGenreName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public StatsOverallResponseDto getOverallStats() {
}

public long getTotalPinCount() {
return pinRepository.countByListenedDateYear(LocalDate.now().getYear());
return pinRepository.countByCreatedTimeYear(LocalDate.now().getYear());
}

@Transactional(readOnly = true)
Expand Down

0 comments on commit 931a20b

Please sign in to comment.