Commit d64d9923 authored by yanzg's avatar yanzg

常规BUG的修改

parent e3c61cf8
...@@ -122,4 +122,8 @@ public class DaoConst { ...@@ -122,4 +122,8 @@ public class DaoConst {
* 集合初始化大小 * 集合初始化大小
*/ */
public static final int COLLECTION_INIT_SIZE = 15; public static final int COLLECTION_INIT_SIZE = 15;
/**
* 查询条件默认代码片段
*/
public static final String[] LAST = new String[]{"{WHERE}", "{GROUP}", "{HAVING}", "{ORDER}", "{LIMIT}"};
} }
...@@ -412,12 +412,10 @@ public abstract class BaseDaoSql { ...@@ -412,12 +412,10 @@ public abstract class BaseDaoSql {
* @return SQL条件 * @return SQL条件
*/ */
protected String getQueryPara(List<Object> paras, SqlData sqlData, Object model) { protected String getQueryPara(List<Object> paras, SqlData sqlData, Object model) {
// 定义可替换片段
String[] lastCode = new String[]{"{WHERE}", "{GROUP}", "{HAVING}", "{ORDER}", "{LIMIT}"};
// 将SQL语句进行代码片段追加 // 将SQL语句进行代码片段追加
StringBuilder sb = new StringBuilder(sqlData.getSql()); StringBuilder sb = new StringBuilder(sqlData.getSql());
for (String code : lastCode) { for (String code : DaoConst.LAST) {
if (sb.indexOf(code) == -1) { if (sb.indexOf(code) == -1) {
sb.append(code); sb.append(code);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment