diff --git a/src/main/java/com/lq/code/util/HttpKit.java b/src/main/java/com/lq/code/util/HttpKit.java index 8b8d21a..dcdfd0a 100755 --- a/src/main/java/com/lq/code/util/HttpKit.java +++ b/src/main/java/com/lq/code/util/HttpKit.java @@ -23,6 +23,10 @@ import java.util.Map.Entry; * @author */ public class HttpKit { + /** + * 问号 + */ + public static final String QUESTION_MARK = "?"; private static final String DEFAULT_CHARSET = "UTF-8"; private static final Logger LOGGER = Logger.getLogger(HttpKit.class); @@ -158,8 +162,8 @@ public class HttpKit { return url; } StringBuilder sb = new StringBuilder(url); - if (url.indexOf("?") == -1) { - sb.append("?"); + if (url.indexOf(QUESTION_MARK) == -1) { + sb.append(QUESTION_MARK); } else { sb.append("&"); } diff --git a/src/main/java/com/lq/code/util/sql/AbstractDbBuiler.java b/src/main/java/com/lq/code/util/sql/AbstractDbBuiler.java index bdccd29..ea5ebd6 100755 --- a/src/main/java/com/lq/code/util/sql/AbstractDbBuiler.java +++ b/src/main/java/com/lq/code/util/sql/AbstractDbBuiler.java @@ -10,6 +10,11 @@ import java.util.Set; */ public abstract class AbstractDbBuiler { + /** + * 括号 + */ + public static final String BRACKETS = ")"; + /** * 自动同步表结构 * @param classSet @@ -47,7 +52,7 @@ public abstract class AbstractDbBuiler { //SQL 转成大写适 String upperCaseSql = sql.toUpperCase(); //统计SQL排除排序SQL代码 - if (sql.lastIndexOf(SqlConstant.ORDER_SQL)>sql.lastIndexOf(")")){ + if (sql.lastIndexOf(SqlConstant.ORDER_SQL)>sql.lastIndexOf(BRACKETS)){ sb.append(sql.substring(upperCaseSql.indexOf(SqlConstant.FROM_SQL)+SqlConstant.FROM_SQL.length(),upperCaseSql.lastIndexOf(SqlConstant.ORDER_SQL))); }else{ sb.append(sql.substring(upperCaseSql.indexOf(SqlConstant.FROM_SQL)+SqlConstant.FROM_SQL.length()));