miemie 3 lat temu
rodzic
commit
303e50e020

+ 4 - 2
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/IllegalSQLInnerInterceptor.java

@@ -186,8 +186,10 @@ public class IllegalSQLInnerInterceptor extends JsqlParserSupport implements Inn
         if (joins != null) {
             for (Join join : joins) {
                 Table rightTable = (Table) join.getRightItem();
-                Expression expression = join.getOnExpression();
-                validWhere(expression, table, rightTable, connection);
+                Collection<Expression> onExpressions = join.getOnExpressions();
+                for (Expression expression : onExpressions) {
+                    validWhere(expression, table, rightTable, connection);
+                }
             }
         }
     }

+ 1 - 1
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/OptimisticLockerInnerInterceptor.java

@@ -169,7 +169,7 @@ public class OptimisticLockerInnerInterceptor implements InnerInterceptor {
 
     private void setVersionByWrapper(Map<String, Object> map, String msId) {
         Object ew = map.get(Constants.WRAPPER);
-        if (null != ew && ew instanceof AbstractWrapper && ew instanceof Update) {
+        if (ew instanceof AbstractWrapper && ew instanceof Update) {
             Class<?> entityClass = ENTITY_CLASS_CACHE.get(msId);
             if (null == entityClass) {
                 try {