Pārlūkot izejas kodu

!84 全量保存或更新之前判断addList长度和updateList长度
Merge pull request !84 from 抓蛙师/dev

疯狂的狮子Li 3 gadi atpakaļ
vecāks
revīzija
bfeca2cd7c

+ 4 - 2
ruoyi-common/src/main/java/com/ruoyi/common/core/mybatisplus/core/ServicePlusImpl.java

@@ -149,10 +149,12 @@ public class ServicePlusImpl<M extends BaseMapperPlus<T>, T, V> extends ServiceI
 				updateList.add(entity);
 			}
 		}
-		if (updateBatchById(updateList)) {
+		if (updateList.size()>0 && updateBatchById(updateList)) {
 			row += updateList.size();
 		}
-		row += baseMapper.insertAll(addList);
+        if (addList.size() > 0) {
+            row += baseMapper.insertAll(addList);
+        }
 		return row == entityList.size();
 	}