ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfPetNoteController.java
@@ -54,7 +54,9 @@ */ @GetMapping public AjaxResult getByPetId(@PathParam("pid")String pid){ return zfPetNoteService.getAllPetNoteByPetId(pid); Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); return zfPetNoteService.getAllPetNoteByPetId(pageNum,pageSize,pid); } zhang-content/src/main/java/com/ruoyi/service/ZfPetNoteService.java
@@ -21,7 +21,7 @@ List<ZfPetNote> selectByCondition(ZfPetNote zfPetNote); AjaxResult getAllPetNoteByPetId(String pid); AjaxResult getAllPetNoteByPetId(Integer pageNum,Integer pageSize,String pid); AjaxResult mySave(ZfPetNote zfPetNote); } zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetNoteServiceImpl.java
@@ -36,7 +36,9 @@ lqw.orderByDesc(ZfPetNote::getCreateTime); Page<ZfPetNote> ZfPetNotePage = new Page<>(pageNum,pageSize); Page<ZfPetNote> pageResult = page(ZfPetNotePage, lqw); System.out.println(pageResult); HashMap<String, Object> data = MapUtils.getResult(pageResult); System.out.println(data); return AjaxResult.success(data); } @@ -50,12 +52,16 @@ } @Override public AjaxResult getAllPetNoteByPetId(String pid) { public AjaxResult getAllPetNoteByPetId(Integer pageNum,Integer pageSize,String pid) { LambdaQueryWrapper<ZfPetNote> lqw = new LambdaQueryWrapper<>(); lqw.eq(ZfPetNote::getPid,pid); lqw.orderByDesc(ZfPetNote::getCreateTime); List<ZfPetNote> list = list(lqw); return AjaxResult.success(list); Page<ZfPetNote> zfPetNotePage = new Page<>(pageNum, pageSize); Page<ZfPetNote> pageResult = page(zfPetNotePage, lqw); HashMap<String, Object> result = MapUtils.getResult(pageResult); return AjaxResult.success(result); } @Override