Commit 92cb1375 authored by yanzg's avatar yanzg

处理分页重复提示BUG

parent 8bd709bb
...@@ -529,11 +529,11 @@ public abstract class BaseDaoSql { ...@@ -529,11 +529,11 @@ public abstract class BaseDaoSql {
if (fromPageSize != null) { if (fromPageSize != null) {
sqlTo = getQueryPara(new ArrayList<>(), fromPageSize, model); sqlTo = getQueryPara(new ArrayList<>(), fromPageSize, model);
} }
sqlTo = sqlTo.trim();
// 查询总数据量 // 查询总数据量
String sqlSize = "SELECT COUNT(1) FROM (" + String sqlSize = "SELECT COUNT(1) FROM (" +
sqlTo.replaceAll("(?i)(ORDER\\s+BY\\s+[^)]+){0,1}(limit\\s+\\d+,\\d+\\s*){0,1}$", "") sqlTo.replaceAll("(?i)(ORDER\\s+BY\\s+[^)]+){0,1}(limit\\s+\\d+,\\d+\\s*){0,1}$", "")
.replaceAll("a.*", "1 AS __id") .replaceAll("(^SELECT)\\s+a.*", "$1 1 AS __id")
+ ") t"; + ") t";
data.setPageTotal(StringHelper.toInt(queryCellWithCache(String.format("%s.Size", sqlName), sqlSize, paras.toArray()))); data.setPageTotal(StringHelper.toInt(queryCellWithCache(String.format("%s.Size", sqlName), sqlSize, paras.toArray())));
......
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