From e6c4ff41f4b65dd1d925215f3019164ad31021b4 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 06 十月 2023 15:16:20 +0800 Subject: [PATCH] 添加 总行数 --- src/main/java/com/smartearth/poiexcel/controller/EntController.java | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/smartearth/poiexcel/controller/EntController.java b/src/main/java/com/smartearth/poiexcel/controller/EntController.java index 025ac18..e5838d6 100644 --- a/src/main/java/com/smartearth/poiexcel/controller/EntController.java +++ b/src/main/java/com/smartearth/poiexcel/controller/EntController.java @@ -130,6 +130,29 @@ } } + @ApiOperation(value = "鍒嗛〉鏌ヨ") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), + @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") + }) + @GetMapping(value = "/selectByPage") + public ResponseMsg<Object> selectByPage(Integer pageSize, Integer pageIndex) { + try { + if (null == pageSize || pageSize < 1) { + pageSize = 10; + } + if (null == pageIndex || pageIndex < 1) { + pageIndex = 1; + } + int count = qiYeMapper.selectCount(); + List<EntEntity> list = qiYeMapper.selectByPage(pageSize, StaticData.I100 * (pageIndex - 1)); + + return success(count, list); + } catch (Exception ex) { + return fail(ex, -1); + } + } + @ApiOperation(value = "鎵归噺鏇存柊浼佷笟鍧愭爣") @GetMapping({"/updateCoords"}) public ResponseMsg<Object> updateCoords() { @@ -141,7 +164,7 @@ } int pages = (count - 1) / StaticData.I100 + 1; - for (int i = 0; i < pages; i++) { + for (int i = 1; i <= pages; i++) { List<EntEntity> list = qiYeMapper.selectByPage(StaticData.I100, StaticData.I100 * (i - 1)); if (null == list || list.isEmpty()) { continue; -- Gitblit v1.9.3