修复分页时order by截断问题

This commit is contained in:
Looly
2022-10-23 13:25:11 +08:00
parent 59e1c64467
commit 5c835ef888
2 changed files with 3 additions and 2 deletions

View File

@@ -272,7 +272,7 @@ public class DialectRunner implements Serializable {
String selectSql = sqlBuilder.build();
// 去除order by 子句
final int orderByIndex = StrUtil.indexOfIgnoreCase(selectSql, " order by");
final int orderByIndex = StrUtil.lastIndexOfIgnoreCase(selectSql, " order by");
if (orderByIndex > 0) {
selectSql = StrUtil.subPre(selectSql, orderByIndex);
}