diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java index d19a0619..5eaa4a89 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/BaseMapper.java @@ -685,6 +685,11 @@ public interface BaseMapper { MapperUtil.queryFields(this, records, consumers); page.setRecords(records); } + + // 将之前设置的 limit 清除掉 + CPI.setLimitRows(queryWrapper, null); + CPI.setLimitOffset(queryWrapper, null); + return page; } diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowMapper.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowMapper.java index 989a41e1..fc8bb921 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowMapper.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/row/RowMapper.java @@ -464,6 +464,11 @@ public interface RowMapper { List records = selectListByQuery(schema,tableName, queryWrapper); page.setRecords(records); + + // 将之前设置的 limit 清除掉 + CPI.setLimitRows(queryWrapper, null); + CPI.setLimitOffset(queryWrapper, null); + return page; }