fix SQLProvider count and page
This commit is contained in:
@ -62,7 +62,7 @@ public class SQLProvider {
|
|||||||
// 处理模糊查询
|
// 处理模糊查询
|
||||||
if (TimiJava.isNotEmpty(page.getLikeMap())) {
|
if (TimiJava.isNotEmpty(page.getLikeMap())) {
|
||||||
for (Map.Entry<String, String> item : page.getLikeMap().entrySet()) {
|
for (Map.Entry<String, String> item : page.getLikeMap().entrySet()) {
|
||||||
sql.append(" AND `%s` LIKE CONCAT('%%', #{page.likeMap.%s}, '%%')".formatted(
|
sql.append(" AND `%s` LIKE CONCAT('%%', #{likeMap.%s}, '%%')".formatted(
|
||||||
Text.camelCase2underscore(item.getKey()),
|
Text.camelCase2underscore(item.getKey()),
|
||||||
item.getKey()
|
item.getKey()
|
||||||
));
|
));
|
||||||
@ -88,7 +88,7 @@ public class SQLProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 分页
|
// 分页
|
||||||
sql.append(" LIMIT #{page.offset}, #{page.limit}");
|
sql.append(" LIMIT #{offset}, #{limit}");
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ public class SQLProvider {
|
|||||||
// 处理模糊查询
|
// 处理模糊查询
|
||||||
if (TimiJava.isNotEmpty(page.getLikeMap())) {
|
if (TimiJava.isNotEmpty(page.getLikeMap())) {
|
||||||
for (Map.Entry<String, String> item : page.getLikeMap().entrySet()) {
|
for (Map.Entry<String, String> item : page.getLikeMap().entrySet()) {
|
||||||
sql.append(" AND `%s` LIKE CONCAT('%%', #{page.likeMap.%s}, '%%')".formatted(
|
sql.append(" AND `%s` LIKE CONCAT('%%', #{likeMap.%s}, '%%')".formatted(
|
||||||
Text.camelCase2underscore(item.getKey()),
|
Text.camelCase2underscore(item.getKey()),
|
||||||
item.getKey()
|
item.getKey()
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user