From 9494e563d5d7ae50e74ee91e08dcbe0c3e784c58 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Tue, 2 Jun 2020 12:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/share/help/dao/ActivityMapper.java | 2 +- src/main/java/com/share/help/dao/ManagerMapper.java | 2 +- src/main/java/com/share/help/service/ManagerService.java | 8 +++++--- src/main/resources/mapping/ActivityMapper.xml | 2 +- src/main/resources/mapping/UserMapper.xml | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/share/help/dao/ActivityMapper.java b/src/main/java/com/share/help/dao/ActivityMapper.java index 980c4b2..8c2e282 100644 --- a/src/main/java/com/share/help/dao/ActivityMapper.java +++ b/src/main/java/com/share/help/dao/ActivityMapper.java @@ -68,7 +68,7 @@ public interface ActivityMapper { //统计分页信息 Page> seekHelpCount(@Param("pageSize") Integer pageSize,@Param("userId") String userId); - //查找管理员信息 + //管理员查找活动信息 List queryActivity(@Param("start") Integer start, @Param("count") Integer count); //分页信息 diff --git a/src/main/java/com/share/help/dao/ManagerMapper.java b/src/main/java/com/share/help/dao/ManagerMapper.java index 8a11d19..0172c50 100644 --- a/src/main/java/com/share/help/dao/ManagerMapper.java +++ b/src/main/java/com/share/help/dao/ManagerMapper.java @@ -41,7 +41,7 @@ public interface ManagerMapper { * @param pageSize 分页大小 * @return 返回分页结果 */ - @Select("select count(*) as count,ceil(count(*)/#{pageSize}) as totalPage from manager") + @Select("select count(*) as count,ceil(count(*)/#{pageSize}) as totalPage,#{pageSize} as pageSize from manager") Page> count(@Param("pageSize") int pageSize); /** diff --git a/src/main/java/com/share/help/service/ManagerService.java b/src/main/java/com/share/help/service/ManagerService.java index f4f0db0..af1391c 100644 --- a/src/main/java/com/share/help/service/ManagerService.java +++ b/src/main/java/com/share/help/service/ManagerService.java @@ -32,7 +32,7 @@ public class ManagerService { private int pageSize; //用户分页配置 - @Value("${page-size.user.page-size}") + @Value("${page-size.manager}") private int userPageSize; @Autowired @@ -93,7 +93,7 @@ public class ManagerService { Page> page=managerMapper.count(pageSize); List list=managerMapper.list((queryManager.getCurrentPage()-1)*pageSize,pageSize); page.setBody(list); - + page.setCurrentPage(queryManager.getCurrentPage()); return new JSONResponse>>(DefaultRes.ok,Result.OK).setBody(page); } @@ -133,6 +133,7 @@ public class ManagerService { */ public JSONResponse>> find(FindUserForm findUserForm){ Page> page=userMapper.countUserByManager(userPageSize,findUserForm.getUserTypes(),findUserForm.getInfo(),findUserForm.getServiceAddress()); + page.setCurrentPage(findUserForm.getCurrentPage()); List userEntityList=userMapper.getPage((findUserForm.getCurrentPage()-1)* userPageSize, userPageSize,findUserForm.getUserTypes(), findUserForm.getInfo(),findUserForm.getServiceAddress()); page.setBody(userEntityList); @@ -146,7 +147,8 @@ public class ManagerService { */ public JSONResponse>> findActivity(FindActivityForm findActivityForm) { Page> page=activityMapper.countActivity(pageSize); - page.setBody(activityMapper.queryActivity((findActivityForm.getCurrentPage()-1),pageSize)); + page.setCurrentPage(findActivityForm.getCurrentPage()); + page.setBody(activityMapper.queryActivity((findActivityForm.getCurrentPage()-1)*pageSize,pageSize)); return new JSONResponse>>(DefaultRes.ok,Result.OK).setBody(page); } diff --git a/src/main/resources/mapping/ActivityMapper.xml b/src/main/resources/mapping/ActivityMapper.xml index e2be0ad..b89bc83 100644 --- a/src/main/resources/mapping/ActivityMapper.xml +++ b/src/main/resources/mapping/ActivityMapper.xml @@ -68,7 +68,7 @@ diff --git a/src/main/resources/mapping/UserMapper.xml b/src/main/resources/mapping/UserMapper.xml index 5bf32b9..bc411ca 100644 --- a/src/main/resources/mapping/UserMapper.xml +++ b/src/main/resources/mapping/UserMapper.xml @@ -33,7 +33,7 @@ - select count(*) as count,ceil(count(*)/#{pageSize}) as totalPage from user + select count(*) as count,ceil(count(*)/#{pageSize}) as totalPage,#{pageSize} as pageSize from user and user_type in