Commit b46a2bcb by 丁伟峰

改用nativeQuery

1 parent 76922f51
......@@ -13,13 +13,13 @@ import java.time.LocalDate;
@Repository
public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> {
@Query(value = "SELECT a FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_clustet_id = :clusterId AND date(a.create_time) = :date", nativeQuery = true)
@Query(value = "SELECT a.* FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_clustet_id = :clusterId AND date(a.create_time) = :date", nativeQuery = true)
Page<OrderEventEntity> findAllByClusterId(String clusterId, String date, Pageable pageable);
@Query(value = "SELECT a FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_branch_id = :branchId AND date(a.create_time) = :date", nativeQuery = true)
@Query(value = "SELECT a.* FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_branch_id = :branchId AND date(a.create_time) = :date", nativeQuery = true)
Page<OrderEventEntity> findAllByBranchId(String branchId, String date, Pageable pageable);
@Query(value = "SELECT a FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_group_id = :groupId AND date(a.create_time) = :date", nativeQuery = true)
@Query(value = "SELECT a.* FROM order_event a JOIN order_request b ON a.order_id = b.order_id WHERE b.org_group_id = :groupId AND date(a.create_time) = :date", nativeQuery = true)
Page<OrderEventEntity> findAllByGroupId(String groupId, String date, Pageable pageable);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!