PageHelper 分页
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; public PageInfo queryList(@RequestBody A a) { PageHelper.startPage(a.getCurrentPage(),a.getPageSize());//设置分页参数, return new PageInfo<>(aService.getAll(a));//设置参数后需要直接执行查询 }
<configuration> <plugins> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql"/> plugin> plugins> configuration>