1. [追加]は、プラグインに依存しています
<依存性> <のgroupId> com.github.pagehelper </のgroupId> <たartifactId> pagehelper </たartifactId> <バージョン> 5.0。4 </バージョン> </依存> <依存性> <のgroupId> com.github.pagehelper </のgroupId> <たartifactId> pagehelper-スプリングブート自動設定</たartifactId> <バージョン> 1.2。5 </バージョン> </依存> <依存性> <のgroupId> com.github.pagehelper </のgroupId> <たartifactId> pagehelperスプリングブートスタータ</たartifactId> <バージョン> 1.2。
プロファイルを追加2.
pagehelper.helper-方言= mysqlの pagehelper。params =カウント= countSql pagehelper.reasonable = 真 pagehelper.supportの -methods-引数= 真
3.新しいテストクラスのテスト
@GetMapping(" /リスト" ) @ResponseBodyの 公共 PageInfo <ユーザ> getUserList(){ // タブページと始まるのも数 PageHelper.startPage(0、5。); // コールクエリメソッド、ときクエリメソッド戻りデータは、ページングされた 一覧<ユーザー>リスト= userService.selectAll(); // パッケージのページングパラメータは、フロントに戻っ PageInfo PageInfo = 新新PageInfo(一覧); リターンPageInfo; }
失敗は内部ポンポンAOP依存して裁判で添加することができる場合
<依存性> <のgroupId> org.springframework.boot </のgroupId> <たartifactId>ばねブートスタータAOP </たartifactId> </依存>