Commit d1ae14cb by 丁伟峰

Merge branch 'develop-dingwf-0714' into develop

# Conflicts:
#	project-order/src/main/java/com/dituhui/pea/order/dao/OrderEventDao.java
#	project-order/src/main/java/com/dituhui/pea/order/service/impl/WorkbenchServiceImpl.java
2 parents b46a2bcb 86528141
......@@ -6,21 +6,19 @@ 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
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)
Page<OrderEventEntity> findAllByClusterId(String clusterId, String date, Pageable pageable);
@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(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)
Page<OrderEventEntity> findAllByGroupId(String groupId, String 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.orgGroupId = :groupId and DATE(a.createTime) = :date")
Page<OrderEventEntity> findAllByGroupId(String groupId, LocalDate date, Pageable pageable);
}
......@@ -54,7 +54,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
Page<?> changes;
String levelType = reqDTO.getLevelType();
String levelValue = reqDTO.getLevelValue();
String date = reqDTO.getDate();
LocalDate date = LocalDate.parse(reqDTO.getDate());
if ("cluster".equals(levelType)) {
changes = orderEventDao.findAllByClusterId(levelValue, date, pageable);
} else if ("branch".equals(levelType)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!