mybatis plus多条件分页查询

IPage typess = this.typeService.page(new Page<>(page,pagesize),
     new QueryWrapper().lambda()
         .eq(Type::getStatus,0)
         .like(!StringUtils.isEmpty(name), Type::getName , name)
         .like(!StringUtils.isEmpty(remark), Type::getRemark , remark)
     );

//total:总数,size:当前分页条数,current:当前页数,pages:有几页,searchCount:搜索计数?,records:数据

需要引入的包

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

Type为实体类

你可能感兴趣的:(mybatis plus多条件分页查询)