Skip to content

Commit

Permalink
feat: add status condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Sep 26, 2024
1 parent 31587a9 commit 2c6ea55
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public interface OrderRepository extends JpaRepository<Order, String> {
@Query("SELECT o from Order o where o.buyer = :user AND o.status <>'ORDER_PENDING'")
List<Order> findByBuyerAndStatus(User user);

@Query("SELECT o FROM Order o WHERE o.item = :item ORDER BY o.createdAt DESC LIMIT 1")
Optional<Order> findLatestOrderByItem(@Param("item") Item item);

Integer countAllByBuyer(User user);
@Query("SELECT o FROM Order o WHERE o.item = :item AND o.status <> 'ORDER_PENDING'")
Optional<Order> findByItemAnAndStatus(@Param("item") Item item);

@Query("SELECT o FROM Order o WHERE o.status = :orderStatus AND o.updatedAt <= :dateTime")
List<Order> findOverLimitTimeOrders(OrderStatus orderStatus, LocalDateTime dateTime);
Expand Down

0 comments on commit 2c6ea55

Please sign in to comment.