Skip to content

Commit

Permalink
DEAR-131: fix count of happiness days
Browse files Browse the repository at this point in the history
  • Loading branch information
baurnick committed Aug 6, 2024
1 parent a1d62a4 commit e332a14
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface HappinessSurveyRepository extends JpaRepository<HappinessSurvey
@Query("SELECT MAX(h.submitted) FROM HappinessSurvey h WHERE h.userId = :userId")
LocalDateTime findLastSubmissionDateByUserId(Integer userId);

@Query("SELECT COUNT(DISTINCT(h.submitted)) FROM HappinessSurvey h WHERE h.userId = :userId")
@Query("SELECT COUNT(DISTINCT(CAST(h.submitted AS date))) FROM HappinessSurvey h WHERE h.userId = :userId")
int countDaysWithHappinessSurveyThisYear(@Param("userId") Integer userId);

@Query("SELECT COUNT(h) FROM HappinessSurvey h WHERE h.userId = :userId AND CAST(h.submitted AS date) = CURRENT_DATE")
Expand Down

0 comments on commit e332a14

Please sign in to comment.