diff --git a/src/main/java/com/swp/PodBookingSystem/PodBookingSystemServerApplication.java b/src/main/java/com/swp/PodBookingSystem/PodBookingSystemServerApplication.java index 2ad1b899..d469a0a3 100644 --- a/src/main/java/com/swp/PodBookingSystem/PodBookingSystemServerApplication.java +++ b/src/main/java/com/swp/PodBookingSystem/PodBookingSystemServerApplication.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication +@EnableScheduling public class PodBookingSystemServerApplication { public static void main(String[] args) { diff --git a/src/main/java/com/swp/PodBookingSystem/repository/OrderDetailRepository.java b/src/main/java/com/swp/PodBookingSystem/repository/OrderDetailRepository.java index cf33f830..c509606c 100644 --- a/src/main/java/com/swp/PodBookingSystem/repository/OrderDetailRepository.java +++ b/src/main/java/com/swp/PodBookingSystem/repository/OrderDetailRepository.java @@ -14,6 +14,6 @@ public interface OrderDetailRepository extends JpaRepository { List findByCustomer_Id(String customerId); - @Query("SELECT o FROM OrderDetail o WHERE FUNCTION('DATE', o.startTime) BETWEEN FUNCTION('DATE', :startOfDay) AND FUNCTION('DATE', :endOfDay)") + @Query("SELECT o FROM OrderDetail o WHERE FUNCTION('DATE', o.startTime) BETWEEN FUNCTION('DATE', :startOfDay) AND FUNCTION('DATE', :endOfDay) AND o.status = 'Successfully'") List findAllOrderDetailsByDay(@Param("startOfDay") LocalDateTime startOfDay, @Param("endOfDay") LocalDateTime endOfDay); } \ No newline at end of file