fix: 循环分页查询时,count 语句带有 limit 子句。

This commit is contained in:
Suomm 2023-06-09 21:24:04 +08:00
parent 0a0c772848
commit dc3cf163ff
2 changed files with 10 additions and 0 deletions

View File

@ -685,6 +685,11 @@ public interface BaseMapper<T> {
MapperUtil.queryFields(this, records, consumers); MapperUtil.queryFields(this, records, consumers);
page.setRecords(records); page.setRecords(records);
} }
// 将之前设置的 limit 清除掉
CPI.setLimitRows(queryWrapper, null);
CPI.setLimitOffset(queryWrapper, null);
return page; return page;
} }

View File

@ -464,6 +464,11 @@ public interface RowMapper {
List<Row> records = selectListByQuery(schema,tableName, queryWrapper); List<Row> records = selectListByQuery(schema,tableName, queryWrapper);
page.setRecords(records); page.setRecords(records);
// 将之前设置的 limit 清除掉
CPI.setLimitRows(queryWrapper, null);
CPI.setLimitOffset(queryWrapper, null);
return page; return page;
} }