Commit 80f64cb8 by 丁伟峰

for test

1 parent bbf8fe8c
package com.dituhui.pea.order.dao;
import com.dituhui.pea.order.entity.OrderEventEntity;
import org.hibernate.annotations.Where;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.data.repository.query.Param;
import java.time.LocalDate;
@Repository
@Where(clause = "status = 1")
public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> {
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgClusterId = :clusterId and Date(a.createTime) = :date")
Page<OrderEventEntity> findAllByClusterId(String clusterId, LocalDate date, Pageable pageable);
@Query("SELECT a FROM OrderEventEntity a JOIN OrderRequestEntity b ON a.orderId = b.orderId WHERE b.orgClusterId = :clusterId AND function('date', a.createTime) = :date")
Page<OrderEventEntity> findAllByClusterId(String clusterId, @Param("date") LocalDate date, Pageable pageable);
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgBranchId = :branchId and Date(a.createTime) = :date")
Page<OrderEventEntity> findAllByBranchId(String branchId, LocalDate date, Pageable pageable);
@Query("SELECT a FROM OrderEventEntity a JOIN OrderRequestEntity b ON a.orderId = b.orderId WHERE b.orgBranchId = :branchId AND function('date', a.createTime) = :date")
Page<OrderEventEntity> findAllByBranchId(String branchId, @Param("date") LocalDate date, Pageable pageable);
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgGroupId = :groupId and Date(a.createTime) = :date")
Page<OrderEventEntity> findAllByGroupId(String groupId, LocalDate date, Pageable pageable);
@Query("SELECT a FROM OrderEventEntity a JOIN OrderRequestEntity b ON a.orderId = b.orderId WHERE b.orgGroupId = :groupId AND function('date', a.createTime) = :date")
Page<OrderEventEntity> findAllByGroupId(String groupId, @Param("date") LocalDate date, Pageable pageable);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!