Explorar o código

平均环境温度,批量

malijun hai 5 meses
pai
achega
25b9fc1311
Modificáronse 1 ficheiros con 14 adicións e 2 borrados
  1. 14 2
      ruoyi-admin/src/test/java/com/ruoyi/Test.java

+ 14 - 2
ruoyi-admin/src/test/java/com/ruoyi/Test.java

@@ -56,6 +56,11 @@ public class Test {
 
         List<PointInfo> pointInfos = javaFunctionJobHandler.getEntity("AI072", "turbine");
 
+        //插入集合
+        List<TurbineInfoDay > interest = new ArrayList<>();
+        //更新集合
+        List<TurbineInfoDay > update = new ArrayList<>();
+
 
         //遍历pointInfos
         for (PointInfo turbine : pointInfos) {
@@ -82,18 +87,25 @@ public class Test {
                 turbineInfoDay.setRecordDate(timeBegin.toJdkDate());
                 turbineInfoDay.setHjwd(avgCutInWindSpeed);
                 System.out.println(turbineInfoDay);
+                interest.add(turbineInfoDay);
 //                turbineInfoDayService.save(turbineInfoDay);
             } else {
                 one.setHjwd(avgCutInWindSpeed);
                 System.out.println(one);
+                update.add(one);
 //                turbineInfoDayService.updateById(one);
             }
 
-
         }
+//        //批量插入
+//        turbineInfoDayService.saveBatch(interest);
+//        //批量更新
+//        turbineInfoDayService.updateBatchById(update);
+//        //批量插入或更新
+//        turbineInfoDayService.saveOrUpdateBatch(interest);
+//        turbineInfoDayService.saveOrUpdateBatch(update);
 
 
     }
 }
 
-}