老师,查询出来的数据还是所有的数据 控制台sql没有输出 limit阿 你看配置代码吧
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor(){
return new PaginationInterceptor();
}
}
@Test public void selectPyLambdaWrappersix13 () { //LambdaQueryWrapper<User> lambdaQuery = Wrappers.<User>lambdaQuery(); //lambdaQuery.ge(User::getAge,"26"); QueryWrapper<User> queryWrapper = new QueryWrapper<User>(); queryWrapper.ge("age","26"); IPage<User> iPage = userMapper.selectPage(new Page<User>(1,2),queryWrapper); List<User> userList = iPage.getRecords(); for (User user : userList) { System.out.println("--"+user.getName()); } }