Skip to content

Commit

Permalink
Merge pull request #49 from UMC-Blism/fix-48-donggu
Browse files Browse the repository at this point in the history
[Fix] count refactor
  • Loading branch information
dyk-im authored Dec 22, 2024
2 parents d96096e + 5eeb45b commit 1691c37
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface MailboxRepository extends JpaRepository<Mailbox, Long> {
@Query("SELECT m FROM Mailbox m WHERE m.owner.id = :memberId AND YEAR(m.createdAt) < :year")
List<Mailbox> findByMemberIdAndPastYear(@Param("memberId") Long memberId, @Param("year") String year);

@Query("SELECT COUNT(m) FROM Mailbox m WHERE m.id = :memberId")
@Query("SELECT COUNT(m) FROM Mailbox m WHERE m.owner.id = :memberId AND YEAR(m.createdAt) < YEAR(CURRENT_DATE)")
Integer countByMemberId(@Param("memberId") Long memberId);

}

0 comments on commit 1691c37

Please sign in to comment.