wanglang преди 2 седмици
родител
ревизия
d1604680ca
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 9 1
      trade-common/src/main/java/com/trade/common/config/mybatis/plugin/I18nSqlProcessInterceptor.java

+ 9 - 1
trade-common/src/main/java/com/trade/common/config/mybatis/plugin/I18nSqlProcessInterceptor.java

@@ -256,7 +256,15 @@ public class I18nSqlProcessInterceptor implements Interceptor {
                 if (methodSupported(SqlCommandType.SELECT, baseMethodStr) && classSupported) {
                     if (Map.class.isAssignableFrom(parameterClass)) {
                         BoundSql boundSql = ms.getSqlSource().getBoundSql(parameter);
-                        MapperMethod.ParamMap parameterMap = (MapperMethod.ParamMap) boundSql.getParameterObject();
+                        MapperMethod.ParamMap parameterMap;
+                        if (boundSql.getParameterObject() instanceof HashMap) {
+                            HashMap<String, Object> hashMap = (HashMap<String, Object>) boundSql.getParameterObject();
+                            parameterMap = new MapperMethod.ParamMap();
+                            parameterMap.putAll(hashMap);
+                        } else {
+                             parameterMap = (MapperMethod.ParamMap) boundSql.getParameterObject();
+                        }
+
                         Object ew = parameterMap.get("ew");
                         if (ew instanceof Non18nWrapper) {
                             return baseResult;