浏览代码

Merge branch '3.0' into github3.0

hubin 4 年之前
父节点
当前提交
9efcb47c29

+ 4 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/AbstractMethod.java

@@ -118,8 +118,8 @@ public abstract class AbstractMethod implements Constants {
      * @return sql
      */
     protected String sqlComment() {
-        return SqlScriptUtils.convertChoose(String.format("%s != null and %s != null", WRAPPER, Q_WRAPPER_SQL_COMMENT),
-            SqlScriptUtils.unSafeParam(Q_WRAPPER_SQL_COMMENT), EMPTY);
+        return SqlScriptUtils.convertIf(String.format("%s != null and %s != null", WRAPPER, Q_WRAPPER_SQL_COMMENT),
+            SqlScriptUtils.unSafeParam(Q_WRAPPER_SQL_COMMENT), true);
     }
 
     /**
@@ -128,8 +128,8 @@ public abstract class AbstractMethod implements Constants {
      * @return sql
      */
     protected String sqlFirst() {
-        return SqlScriptUtils.convertChoose(String.format("%s != null and %s != null", WRAPPER, Q_WRAPPER_SQL_FIRST),
-            SqlScriptUtils.unSafeParam(Q_WRAPPER_SQL_FIRST), EMPTY);
+        return SqlScriptUtils.convertIf(String.format("%s != null and %s != null", WRAPPER, Q_WRAPPER_SQL_FIRST),
+            SqlScriptUtils.unSafeParam(Q_WRAPPER_SQL_FIRST), true);
     }
 
     /**

+ 2 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/AbstractSqlInjector.java

@@ -48,8 +48,8 @@ public abstract class AbstractSqlInjector implements ISqlInjector {
                 List<AbstractMethod> methodList = this.getMethodList(mapperClass);
                 if (CollectionUtils.isNotEmpty(methodList)) {
                     TableInfo tableInfo = TableInfoHelper.initTableInfo(builderAssistant, modelClass);
-                    // 并行循环注入自定义方法
-                    methodList.parallelStream().forEach(m -> m.inject(builderAssistant, mapperClass, modelClass, tableInfo));
+                    // 循环注入自定义方法
+                    methodList.forEach(m -> m.inject(builderAssistant, mapperClass, modelClass, tableInfo));
                 } else {
                     logger.debug(mapperClass.toString() + ", No effective injection method was found.");
                 }

+ 2 - 2
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/pagination/DialectFactory.java

@@ -47,13 +47,13 @@ public class DialectFactory {
                 || dbType == DbType.OCEAN_BASE) {
                 dialect = new MySqlDialect();
             }
-            // postgresql same type
+            // oracle same type
             else if (dbType == DbType.ORACLE
                 || dbType == DbType.DM
                 || dbType == DbType.GAUSS) {
                 dialect = new OracleDialect();
             }
-            // oracle same type
+            // postgresql same type
             else if (dbType == DbType.POSTGRE_SQL
                 || dbType == DbType.H2
                 || dbType == DbType.SQLITE