From b5b3013cf029f24459e22b2c6db0e8349ba43f4c Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 12 十二月 2022 17:28:58 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/extend/UpdateBatchMethod.java | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/lf/server/extend/UpdateBatchMethod.java b/src/main/java/com/lf/server/extend/UpdateBatchMethod.java index d3f0855..234d403 100644 --- a/src/main/java/com/lf/server/extend/UpdateBatchMethod.java +++ b/src/main/java/com/lf/server/extend/UpdateBatchMethod.java @@ -4,14 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.TableFieldInfo; import com.baomidou.mybatisplus.core.metadata.TableInfo; import com.baomidou.mybatisplus.core.toolkit.sql.SqlScriptUtils; +import com.lf.server.entity.all.StaticData; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.SqlSource; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; /** * 鎵归噺鏇存柊鏂规硶 @@ -19,8 +14,6 @@ */ @SuppressWarnings("ALL") public class UpdateBatchMethod extends AbstractMethod { - private static List<String> excludeFields = new ArrayList<>(Arrays.asList("objectid", "createuser", "createtime", "shape_leng", "shape_area")); - /** * update user set name = "a", age = 17 where id = 1; * update user set name = "b", age = 18 where id = 2; @@ -75,7 +68,7 @@ private String getSqlSet(TableInfo tableInfo) { StringBuilder sb = new StringBuilder(); for (TableFieldInfo f : tableInfo.getFieldList()) { - if (excludeFields.contains(f.getColumn())) { + if (StaticData.UPDATE_EXCLUDE_FIELDS.contains(f.getColumn())) { continue; } -- Gitblit v1.9.3