PageUtils.limit support offset 0

This commit is contained in:
高铁
2019-08-28 10:38:43 +08:00
parent a33fe5bc81
commit 0a4625e9ff
@@ -400,8 +400,12 @@ public class PagerUtils {
private static boolean limitMySqlQueryBlock(SQLSelectQueryBlock queryBlock, String dbType, int offset, int count, boolean check) {
SQLLimit limit = queryBlock.getLimit();
if (limit != null) {
if (offset >= 0) {
if (offset > 0) {
limit.setOffset(new SQLIntegerExpr(offset));
} else if (offset == 0) {
if (limit.getOffset() != null) {
limit.setOffset(new SQLIntegerExpr(offset));
}
}
if (check && limit.getRowCount() instanceof SQLNumericLiteralExpr) {