Forráskód Böngészése

!162 调整 pulls/161
Merge pull request !162 from 青苗/3.0

青苗 4 éve
szülő
commit
0e7508b6ad

+ 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-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