Woody il y a 1 mois
Parent
commit
84da3257d1

+ 43 - 2
framework-database/src/main/java/com/chelvc/framework/database/config/MybatisConfigurer.java

@@ -1,16 +1,35 @@
 package com.chelvc.framework.database.config;
 
+import java.io.InputStream;
+import java.io.Reader;
 import java.lang.reflect.Constructor;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.Month;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZonedDateTime;
+import java.time.chrono.JapaneseDate;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.config.GlobalConfig;
 import com.baomidou.mybatisplus.core.metadata.TableInfo;
 import com.chelvc.framework.base.context.ApplicationContextHolder;
 import com.chelvc.framework.base.util.SpringUtils;
+import com.chelvc.framework.common.model.File;
+import com.chelvc.framework.common.model.Modification;
+import com.chelvc.framework.common.model.Period;
+import com.chelvc.framework.common.model.Region;
 import com.chelvc.framework.common.util.ObjectUtils;
-import com.chelvc.framework.database.context.DatabaseContextHolder;
 import com.google.common.collect.Lists;
 import javassist.ClassPool;
 import javassist.CtClass;
@@ -60,6 +79,28 @@ public abstract class MybatisConfigurer {
         }
     }
 
+    /**
+     * 判断对象类型处理器是否已注册
+     *
+     * @param type 对象类型
+     * @return true/false
+     */
+    public static boolean isTypeHandlerRegistered(Class<?> type) {
+        return type == byte.class || type == Byte.class || type == byte[].class || type == Byte[].class
+                || type == char.class || type == Character.class || type == short.class || type == Short.class
+                || type == int.class || type == Integer.class || type == long.class || type == Long.class
+                || type == float.class || type == Float.class || type == double.class || type == Double.class
+                || type == boolean.class || type == Boolean.class || type == String.class || type == Object.class
+                || type == BigInteger.class || type == BigDecimal.class || type == Reader.class
+                || type == InputStream.class || type == Date.class || type == java.sql.Date.class
+                || type == java.sql.Time.class || type == java.sql.Timestamp.class || type == Instant.class
+                || type == LocalDate.class || type == LocalTime.class || type == LocalDateTime.class
+                || type == OffsetTime.class || type == OffsetDateTime.class || type == ZonedDateTime.class
+                || type == Year.class || type == Month.class || type == YearMonth.class || type == JapaneseDate.class
+                || (type != null && Enum.class.isAssignableFrom(type)) || type == File.class || type == Period.class
+                || type == Region.class || type == Modification.class;
+    }
+
     /**
      * 初始化Mapper解析监听器
      *
@@ -139,7 +180,7 @@ public abstract class MybatisConfigurer {
                 "}\n " +
                 "this.validate();\n" +
                 "return this.parameterMapping;\n" +
-                "}", DatabaseContextHolder.class.getName(), UnknownTypeHandler.class.getName()));
+                "}", MybatisConfigurer.class.getName(), UnknownTypeHandler.class.getName()));
         inner.toClass();
         clazz.toClass();
     }

+ 5 - 43
framework-database/src/main/java/com/chelvc/framework/database/config/TypeHandlerConfigurer.java

@@ -1,30 +1,14 @@
 package com.chelvc.framework.database.config;
 
-import java.io.InputStream;
-import java.io.Reader;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
-import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.sql.CallableStatement;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.Month;
-import java.time.OffsetDateTime;
-import java.time.OffsetTime;
-import java.time.Year;
-import java.time.YearMonth;
-import java.time.ZonedDateTime;
-import java.time.chrono.JapaneseDate;
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -95,8 +79,8 @@ import com.chelvc.framework.database.handler.StringSetTypeHandler;
 import com.chelvc.framework.database.handler.StringsTypeHandler;
 import com.chelvc.framework.database.sql.CallableStringDecrypter;
 import com.chelvc.framework.database.sql.ResultStringDecrypter;
-import com.chelvc.framework.database.sql.SQLUtils;
 import com.chelvc.framework.database.sql.WriteStringEncryptor;
+import com.chelvc.framework.database.support.MyBatisUtils;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import javassist.CannotCompileException;
@@ -179,32 +163,10 @@ public class TypeHandlerConfigurer extends MybatisConfigurer {
      * @return true/false
      */
     private boolean isMetaType(Class<?> type) {
-        return this.isTypeHandlerRegistered(type) || Map.class.isAssignableFrom(type)
+        return isTypeHandlerRegistered(type) || Map.class.isAssignableFrom(type)
                 || Collection.class.isAssignableFrom(type);
     }
 
-    /**
-     * 判断对象类型处理器是否已注册
-     *
-     * @param type 对象类型
-     * @return true/false
-     */
-    private boolean isTypeHandlerRegistered(Class<?> type) {
-        return type == byte.class || type == Byte.class || type == byte[].class || type == Byte[].class
-                || type == char.class || type == Character.class || type == short.class || type == Short.class
-                || type == int.class || type == Integer.class || type == long.class || type == Long.class
-                || type == float.class || type == Float.class || type == double.class || type == Double.class
-                || type == boolean.class || type == Boolean.class || type == String.class || type == Object.class
-                || type == BigInteger.class || type == BigDecimal.class || type == Reader.class
-                || type == InputStream.class || type == Date.class || type == java.sql.Date.class
-                || type == java.sql.Time.class || type == java.sql.Timestamp.class || type == Instant.class
-                || type == LocalDate.class || type == LocalTime.class || type == LocalDateTime.class
-                || type == OffsetTime.class || type == OffsetDateTime.class || type == ZonedDateTime.class
-                || type == Year.class || type == Month.class || type == YearMonth.class || type == JapaneseDate.class
-                || (type != null && Enum.class.isAssignableFrom(type)) || type == File.class || type == Period.class
-                || type == Region.class || type == Modification.class;
-    }
-
     /**
      * 判断对象是否可配置类型处理器
      *
@@ -223,7 +185,7 @@ public class TypeHandlerConfigurer extends MybatisConfigurer {
 
             // JSON字段
             Type type = TypeParameterResolver.resolveFieldType(field, clazz);
-            return !this.isTypeHandlerRegistered(ObjectUtils.type2class(type));
+            return !isTypeHandlerRegistered(ObjectUtils.type2class(type));
         }));
     }
 
@@ -384,7 +346,7 @@ public class TypeHandlerConfigurer extends MybatisConfigurer {
         if (((handler == null && (handler = (Class<? extends TypeHandler<?>>)
                 ObjectUtils.ifNull(annotation, TableField::typeHandler)) == null)
                 || handler == UnknownTypeHandler.class || handler == JacksonTypeHandler.class)
-                && !this.isTypeHandlerRegistered(model)) {
+                && !isTypeHandlerRegistered(model)) {
             handler = this.lookupJsonHandlerClass(type);
         }
 
@@ -529,7 +491,7 @@ public class TypeHandlerConfigurer extends MybatisConfigurer {
         aliases.add(StringUtils.hump2underscore(property));
         aliases.add(StringUtils.underscore2hump(property));
         String column = ObjectUtils.ifNull(field.getAnnotation(TableField.class), TableField::value);
-        if (StringUtils.notEmpty(column = SQLUtils.unquote(column))) {
+        if (StringUtils.notEmpty(column = MyBatisUtils.unquote(column))) {
             aliases.add(column);
             aliases.add(StringUtils.hump2underscore(column));
             aliases.add(StringUtils.underscore2hump(column));

+ 2 - 1
framework-database/src/main/java/com/chelvc/framework/database/interceptor/DeletedIsolateInterceptor.java

@@ -2,6 +2,7 @@ package com.chelvc.framework.database.interceptor;
 
 import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
 import com.chelvc.framework.database.entity.Deletable;
+import com.chelvc.framework.database.support.MyBatisUtils;
 import net.sf.jsqlparser.expression.Expression;
 
 /**
@@ -23,7 +24,7 @@ public class DeletedIsolateInterceptor implements TenantLineHandler {
 
     @Override
     public boolean ignoreTable(String table) {
-        Class<?> model = Expressions.getTableModel(table);
+        Class<?> model = MyBatisUtils.getTableModel(table);
         return model == null || !Deletable.class.isAssignableFrom(model);
     }
 }

+ 8 - 7
framework-database/src/main/java/com/chelvc/framework/database/interceptor/DynamicInvokeInterceptor.java

@@ -19,7 +19,8 @@ import com.chelvc.framework.database.entity.Creatable;
 import com.chelvc.framework.database.entity.Deletable;
 import com.chelvc.framework.database.entity.Environmental;
 import com.chelvc.framework.database.entity.Updatable;
-import com.chelvc.framework.database.sql.SQLUtils;
+import com.chelvc.framework.database.support.MyBatisUtils;
+import com.chelvc.framework.database.support.TableField;
 import com.google.common.collect.Lists;
 import lombok.RequiredArgsConstructor;
 import net.sf.jsqlparser.JSQLParserException;
@@ -631,7 +632,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
      * @param parameter 参数表达式
      */
     private void bindTypeHandler(BoundSql bound, Table table, Column column, JdbcParameter parameter) {
-        TableField field = Expressions.getTableField(table.getName(), column.getColumnName());
+        TableField field = MyBatisUtils.getTableField(table.getName(), column.getColumnName());
         TypeHandler<?> handler = ObjectUtils.ifNull(field, TableField::getHandler);
         if (handler != null) {
             ParameterMapping mapping = bound.getParameterMappings().get(parameter.getIndex() - 1);
@@ -788,7 +789,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
      */
     private boolean initializeDefaultValue(BoundSql bound, Update update, Table table, Pair<?, Expression> operator,
                                            Pair<?, Expression> datetime) {
-        Class<?> model = Expressions.getTableModel(table.getName());
+        Class<?> model = MyBatisUtils.getTableModel(table.getName());
         if (model == null) {
             return false;
         }
@@ -841,7 +842,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
         }
 
         // 获取字段上下文信息
-        TableField field = Expressions.getTableField(table.getName(), column.getColumnName());
+        TableField field = MyBatisUtils.getTableField(table.getName(), column.getColumnName());
         if (field == null || !field.isSensitive()) {
             return false;
         }
@@ -856,7 +857,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
         if (!this.properties.getCrypto().isWritable()) {
             value = DatabaseContextHolder.getDatabaseCipherHandler().encrypt((String) value, true);
         }
-        StringValue extra = new StringValue(SQLUtils.escape((String) value));
+        StringValue extra = new StringValue(MyBatisUtils.escape((String) value));
         if (condition instanceof InExpression) {
             InExpression in = (InExpression) condition;
             ((ExpressionList) in.getRightItemsList()).getExpressions().add(extra);
@@ -931,7 +932,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
         }
 
         // 初始化参数默认值
-        Class<?> model = Expressions.getTableModel(insert.getTable().getName());
+        Class<?> model = MyBatisUtils.getTableModel(insert.getTable().getName());
         if (model == null) {
             return rebuild;
         }
@@ -1050,7 +1051,7 @@ public class DynamicInvokeInterceptor implements Interceptor {
         Map<String, Map<String, ExpressionList>> additional = Expressions.getSelectAdditionalConditions();
         if (ObjectUtils.notEmpty(additional)) {
             rebuild |= this.prepareSelectCondition(select, (table, condition, changing) -> {
-                Map<String, ExpressionList> conditions = additional.get(SQLUtils.unquote(table.getName()));
+                Map<String, ExpressionList> conditions = additional.get(MyBatisUtils.unquote(table.getName()));
                 if (ObjectUtils.isEmpty(conditions)) {
                     return false;
                 }

+ 2 - 1
framework-database/src/main/java/com/chelvc/framework/database/interceptor/EnvIsolateInterceptor.java

@@ -2,6 +2,7 @@ package com.chelvc.framework.database.interceptor;
 
 import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
 import com.chelvc.framework.database.entity.Environmental;
+import com.chelvc.framework.database.support.MyBatisUtils;
 import net.sf.jsqlparser.expression.Expression;
 
 /**
@@ -26,7 +27,7 @@ public class EnvIsolateInterceptor implements TenantLineHandler {
         if (Expressions.env().getLeft() == null) {
             return true;
         }
-        Class<?> model = Expressions.getTableModel(table);
+        Class<?> model = MyBatisUtils.getTableModel(table);
         return model == null || !Environmental.class.isAssignableFrom(model);
     }
 }

+ 4 - 53
framework-database/src/main/java/com/chelvc/framework/database/interceptor/Expressions.java

@@ -9,18 +9,16 @@ import java.util.Date;
 import java.util.Map;
 import java.util.Set;
 
-import com.baomidou.mybatisplus.core.metadata.TableInfo;
-import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
 import com.chelvc.framework.base.context.ApplicationContextHolder;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.common.util.DateUtils;
 import com.chelvc.framework.common.util.ObjectUtils;
 import com.chelvc.framework.common.util.StringUtils;
-import com.chelvc.framework.database.sql.SQLUtils;
+import com.chelvc.framework.database.support.MyBatisUtils;
+import com.chelvc.framework.database.support.TableField;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-import lombok.NonNull;
 import lombok.extern.slf4j.Slf4j;
 import net.sf.jsqlparser.expression.Expression;
 import net.sf.jsqlparser.expression.LongValue;
@@ -42,11 +40,6 @@ final class Expressions {
      */
     private static final String ENUM_OPTION_LIMIT_PROPERTY = "enum.option.limit";
 
-    /**
-     * 表名称/对象映射表
-     */
-    private static final Map<String, Table> TABLE_NAME_MAPPING = Maps.newConcurrentMap();
-
     private Expressions() {
     }
 
@@ -142,9 +135,9 @@ final class Expressions {
             }
 
             // 获取表字段上下文信息
-            TableField field = getTableField(table, column);
+            TableField field = MyBatisUtils.getTableField(table, column);
             if (field != null && Enum.class.isAssignableFrom(field.getType())) {
-                tables.computeIfAbsent(SQLUtils.unquote(table), k -> Sets.newHashSet()).add(field);
+                tables.computeIfAbsent(MyBatisUtils.unquote(table), k -> Sets.newHashSet()).add(field);
             }
         }
         if (ObjectUtils.isEmpty(tables)) {
@@ -216,48 +209,6 @@ final class Expressions {
         return Pair.of(datetime, new StringValue(value));
     }
 
-    /**
-     * 获取表上下文
-     *
-     * @param name 表名称
-     * @return 表上下文
-     */
-    public static Table getTable(@NonNull String name) {
-        String unquote = SQLUtils.unquote(name);
-        Table table = TABLE_NAME_MAPPING.get(unquote);
-        if (table == null) {
-            table = TABLE_NAME_MAPPING.computeIfAbsent(unquote, k -> {
-                TableInfo info = TableInfoHelper.getTableInfo(name);
-                if (info == null && SQLUtils.isQuoted(name)) {
-                    info = TableInfoHelper.getTableInfo(unquote);
-                }
-                return ObjectUtils.ifNull(info, Table::new);
-            });
-        }
-        return table;
-    }
-
-    /**
-     * 获取表数据模型
-     *
-     * @param table 表名
-     * @return 数据模型对象
-     */
-    public static Class<?> getTableModel(@NonNull String table) {
-        return ObjectUtils.ifNull(getTable(table), Table::getModel);
-    }
-
-    /**
-     * 获取表字段上下文
-     *
-     * @param table 表名称
-     * @param field 字段名称
-     * @return 表字段上下文
-     */
-    public static TableField getTableField(@NonNull String table, @NonNull String field) {
-        return ObjectUtils.ifNull(getTable(table), context -> context.getField(field));
-    }
-
     /**
      * 获取数据查询附加条件
      *

+ 54 - 4
framework-database/src/main/java/com/chelvc/framework/database/sql/SQLUtils.java → framework-database/src/main/java/com/chelvc/framework/database/support/MyBatisUtils.java

@@ -1,7 +1,9 @@
-package com.chelvc.framework.database.sql;
+package com.chelvc.framework.database.support;
 
 import java.util.Map;
 
+import com.baomidou.mybatisplus.core.metadata.TableInfo;
+import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
 import com.baomidou.mybatisplus.core.toolkit.LambdaUtils;
 import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache;
 import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
@@ -9,17 +11,23 @@ import com.baomidou.mybatisplus.core.toolkit.support.SerializedLambda;
 import com.chelvc.framework.common.util.AssertUtils;
 import com.chelvc.framework.common.util.ObjectUtils;
 import com.chelvc.framework.common.util.StringUtils;
+import com.google.common.collect.Maps;
 import lombok.NonNull;
 import org.apache.ibatis.reflection.property.PropertyNamer;
 
 /**
- * SQL处理工具类
+ * MyBatis工具类
  *
  * @author Woody
  * @date 2025/3/14
  */
-public final class SQLUtils {
-    private SQLUtils() {
+public final class MyBatisUtils {
+    /**
+     * 表名称/对象映射表
+     */
+    private static final Map<String, Table> TABLE_NAME_MAPPING = Maps.newConcurrentMap();
+
+    private MyBatisUtils() {
     }
 
     /**
@@ -139,4 +147,46 @@ public final class SQLUtils {
         AssertUtils.nonnull(column, () -> "Column not found for property: " + clazz.getName() + "." + property);
         return column.getColumn();
     }
+
+    /**
+     * 获取表上下文
+     *
+     * @param name 表名称
+     * @return 表上下文
+     */
+    public static Table getTable(@NonNull String name) {
+        String unquote = MyBatisUtils.unquote(name);
+        Table table = TABLE_NAME_MAPPING.get(unquote);
+        if (table == null) {
+            table = TABLE_NAME_MAPPING.computeIfAbsent(unquote, k -> {
+                TableInfo info = TableInfoHelper.getTableInfo(name);
+                if (info == null && MyBatisUtils.isQuoted(name)) {
+                    info = TableInfoHelper.getTableInfo(unquote);
+                }
+                return ObjectUtils.ifNull(info, Table::new);
+            });
+        }
+        return table;
+    }
+
+    /**
+     * 获取表数据模型
+     *
+     * @param table 表名
+     * @return 数据模型对象
+     */
+    public static Class<?> getTableModel(@NonNull String table) {
+        return ObjectUtils.ifNull(getTable(table), Table::getModel);
+    }
+
+    /**
+     * 获取表字段上下文
+     *
+     * @param table 表名称
+     * @param field 字段名称
+     * @return 表字段上下文
+     */
+    public static TableField getTableField(@NonNull String table, @NonNull String field) {
+        return ObjectUtils.ifNull(getTable(table), context -> context.getField(field));
+    }
 }

+ 3 - 4
framework-database/src/main/java/com/chelvc/framework/database/interceptor/Table.java → framework-database/src/main/java/com/chelvc/framework/database/support/Table.java

@@ -1,4 +1,4 @@
-package com.chelvc.framework.database.interceptor;
+package com.chelvc.framework.database.support;
 
 import java.io.Serializable;
 import java.util.Collections;
@@ -7,7 +7,6 @@ import java.util.stream.Collectors;
 
 import com.baomidou.mybatisplus.core.metadata.TableInfo;
 import com.chelvc.framework.common.util.ObjectUtils;
-import com.chelvc.framework.database.sql.SQLUtils;
 import lombok.Getter;
 import lombok.NonNull;
 
@@ -28,7 +27,7 @@ public class Table implements Serializable {
             this.fields = Collections.emptyMap();
         } else {
             this.fields = Collections.unmodifiableMap(info.getFieldList().stream().collect(Collectors.toMap(
-                    field -> SQLUtils.unquote(field.getColumn()), TableField::new
+                    field -> MyBatisUtils.unquote(field.getColumn()), TableField::new
             )));
         }
     }
@@ -49,6 +48,6 @@ public class Table implements Serializable {
      * @return 表字段信息
      */
     public TableField getField(@NonNull String field) {
-        return this.fields.get(SQLUtils.unquote(field));
+        return this.fields.get(MyBatisUtils.unquote(field));
     }
 }

+ 1 - 1
framework-database/src/main/java/com/chelvc/framework/database/interceptor/TableField.java → framework-database/src/main/java/com/chelvc/framework/database/support/TableField.java

@@ -1,4 +1,4 @@
-package com.chelvc.framework.database.interceptor;
+package com.chelvc.framework.database.support;
 
 import java.io.Serializable;
 import java.lang.reflect.Field;

+ 8 - 9
framework-database/src/main/java/com/chelvc/framework/database/support/Updates.java

@@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache;
 import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
 import com.chelvc.framework.common.util.ObjectUtils;
 import com.chelvc.framework.common.util.StringUtils;
-import com.chelvc.framework.database.sql.SQLUtils;
 import com.google.common.collect.Maps;
 import lombok.NonNull;
 
@@ -426,7 +425,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> use(Condition condition, @NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.use(condition, SQLUtils.getter2column(getter));
+                this.use(condition, MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -453,7 +452,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> add(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.add(SQLUtils.getter2column(getter));
+                this.add(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -480,7 +479,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> clear(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.clear(SQLUtils.getter2column(getter));
+                this.clear(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -507,7 +506,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> subtract(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.subtract(SQLUtils.getter2column(getter));
+                this.subtract(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -534,7 +533,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> multiply(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.multiply(SQLUtils.getter2column(getter));
+                this.multiply(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -561,7 +560,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> divide(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.divide(SQLUtils.getter2column(getter));
+                this.divide(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -588,7 +587,7 @@ public final class Updates {
         @SafeVarargs
         public final Update<T> jsonMerge(@NonNull SFunction<T, ?>... getters) {
             for (SFunction<T, ?> getter : getters) {
-                this.jsonMerge(SQLUtils.getter2column(getter));
+                this.jsonMerge(MyBatisUtils.getter2column(getter));
             }
             return this;
         }
@@ -612,7 +611,7 @@ public final class Updates {
          * @return 字段更新对象实例
          */
         public final Update<T> jsonLength(@NonNull SFunction<T, ?> getter, @NonNull SFunction<T, ?> target) {
-            return this.jsonLength(SQLUtils.getter2column(getter), SQLUtils.getter2column(target));
+            return this.jsonLength(MyBatisUtils.getter2column(getter), MyBatisUtils.getter2column(target));
         }
 
         /**