Caratacus 8 лет назад
Родитель
Сommit
327acc48ae

+ 3 - 3
mybatis-plus/src/main/java/com/baomidou/framework/service/impl/ServiceImpl.java

@@ -114,7 +114,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 	}
 	}
 
 
 	public boolean insertBatch(List<T> entityList) {
 	public boolean insertBatch(List<T> entityList) {
-		if (null == entityList) {
+		if (CollectionUtil.isEmpty(entityList)) {
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		}
 		return retBool(baseMapper.insertBatch(entityList));
 		return retBool(baseMapper.insertBatch(entityList));
@@ -137,7 +137,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 	 * @return
 	 * @return
 	 */
 	 */
 	protected boolean insertBatch(List<T> entityList, int batchSize, boolean isSelective) {
 	protected boolean insertBatch(List<T> entityList, int batchSize, boolean isSelective) {
-		if (null == entityList) {
+		if (CollectionUtil.isEmpty(entityList)) {
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		}
 		TableInfo tableInfo = TableInfoHelper.getTableInfo(currentModleClass());
 		TableInfo tableInfo = TableInfoHelper.getTableInfo(currentModleClass());
@@ -172,7 +172,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 	}
 	}
 
 
 	public boolean insertBatchSelective(List<T> entityList) {
 	public boolean insertBatchSelective(List<T> entityList) {
-		if (null == entityList) {
+		if (CollectionUtil.isEmpty(entityList)) {
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		}
 		int result = 0;
 		int result = 0;