wangqifan 2 سال پیش
والد
کامیت
449525b90b

+ 3 - 0
src/main/java/com/izouma/zhirongip/repo/resource/IntellectualPropertyRepo.java

@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.List;
 
 public interface IntellectualPropertyRepo extends JpaRepository<IntellectualProperty, Long>, JpaSpecificationExecutor<IntellectualProperty> {
@@ -16,4 +17,6 @@ public interface IntellectualPropertyRepo extends JpaRepository<IntellectualProp
     void softDelete(Long id);
 
     List<IntellectualProperty> findAllByNameLike(String name);
+
+    Long countAllByCreatedAtAfter(LocalDateTime localDateTime);
 }

+ 1 - 1
src/main/java/com/izouma/zhirongip/service/StatisticService.java

@@ -53,7 +53,7 @@ public class StatisticService {
         long policy = policyLawRepo.countByCategory(ResourceCategory.POLICY);
         long law = policyLawRepo.countByCategory(ResourceCategory.LAW);
         long intellectualProperty = intellectualPropertyRepo
-                .countAllByCreatedAtBefore(LocalDateTime.of(2022, 10, 1, 0, 0));
+                .countAllByCreatedAtAfter(LocalDateTime.of(2022, 10, 1, 0, 0));
         long technology = digitalRepo.countByType(DigitalType.TECHNOLOGY);
         long product = digitalRepo.countByType(DigitalType.PRODUCT);
         long company = companyRepo.count();