Skip to content

Commit

Permalink
Merge pull request #75 from Donut-DONationUTile/feature/mypage
Browse files Browse the repository at this point in the history
Feature/mypage
  • Loading branch information
Kang1221 authored Apr 30, 2024
2 parents 67f599c + dca6a25 commit f70a524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/zero/eight/donut/repository/GiftRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public interface GiftRepository extends JpaRepository<Gift, Long> {
@Query(value = "SELECT * FROM gift g WHERE g.auto_donation = true AND g.status = 'STORED' AND g.giver_id = :giverId AND g.due_date >= :today", nativeQuery = true)
List<Gift> findAllByGiverAndStatusAndDueDateAfterOrToday(@Param("giverId") Long giverId, @Param("today") LocalDateTime today);

@Query(value = "SELECT COUNT(g) FROM gift g WHERE g.giver_id = :giverId AND g.is_assigned = false", nativeQuery = true)
@Query(value = "SELECT COUNT(*) FROM gift g WHERE g.giver_id = :giverId AND g.is_assigned = false", nativeQuery = true)
int findNotAssignedByGiverIdAndIsAssigned(@Param("giverId") Long giverId);

@Query(value = "SELECT COUNT(g) FROM gift g WHERE g.giver_id = :giverId AND g.is_assigned = true", nativeQuery = true)
@Query(value = "SELECT COUNT(*) FROM gift g WHERE g.giver_id = :giverId AND g.is_assigned = true", nativeQuery = true)
int findIsAssignedByGiverIdAndIsAssigned(@Param("giverId") Long giverId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
public interface MessageRepository extends JpaRepository<Message,Long> {
Message findByGiftId(Long giftId);

@Query(value = "SELECT COUNT(m) FROM message m WHERE m.giver_id = :giverId", nativeQuery = true)
@Query(value = "SELECT COUNT(*) FROM message m WHERE m.giver_id = :giverId", nativeQuery = true)
int countByGiverId(@Param("giverId") Long giverId);
}

0 comments on commit f70a524

Please sign in to comment.