package com.zyh.factory.repositories;

import org.springframework.data.repository.CrudRepository;

import com.zyh.factory.entity.OrderEntity;

public interface OrderRepository extends CrudRepository<OrderEntity, Long> {

	Iterable<OrderEntity> findByOrderStatus(String orderStatus);

}

@@ -32,16 +32,94 @@
 ories;%0A%0A
+import java.util.List;%0A%0Aimport org.springframework.data.jpa.repository.Query;%0A
 import o
@@ -353,12 +353,773 @@
 Status);
+%0A%09Long countByOrderStatus(String orderStatus);%0A%09@Query(%22select new map(count(v) as count, v.orderStatus as label) from OrderEntity v group by v.orderStatus%22)%0A%09public List%3C?%3E countGroupByOrderStatus();%0A//%09@Query(%22select new map(extract(year from expectDeliverDate) as yr, extract(month from expectDeliverDate) as mon, %22 +%0A//    %22 count(*) as count) %22 +%0A//    %22 from OrderEntity %22 +%0A//    %22 group by extract(year from expectDeliverDate), extract(month from expectDeliverDate) %22 +%0A//    %22 order by yr, mon%22)%0A%09@Query(%22select new map(to_char(expectDeliverDate, 'YYYY-MM') as label, %22 +%0A%09%09    %22 count(*) as count) %22 +%0A%09%09    %22 from OrderEntity %22 +%0A%09%09    %22 group by to_char(expectDeliverDate, 'YYYY-MM') %22 +%0A%09%09    %22 order by label%22)%0A%09public List%3C?%3E countGroupByMonth();
 %0A%0A%7D%0A

Update OrderRepository.java