Commit 43b9150d authored by wuxiaokai's avatar wuxiaokai

路口管理-pagehelper分页配置参数

parent 1313ff28
...@@ -3,8 +3,6 @@ package net.wanji.web.service; ...@@ -3,8 +3,6 @@ package net.wanji.web.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.wanji.web.common.Result; import net.wanji.web.common.Result;
import net.wanji.web.entity.TBaseAreaInfo; import net.wanji.web.entity.TBaseAreaInfo;
import net.wanji.web.entity.TBaseCrossInfo; import net.wanji.web.entity.TBaseCrossInfo;
...@@ -51,14 +49,11 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa ...@@ -51,14 +49,11 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
*/ */
public Result<PageResultPO<CrossInfoPO>> selectAll(CrossInfoVO crossInfoVO) { public Result<PageResultPO<CrossInfoPO>> selectAll(CrossInfoVO crossInfoVO) {
PageResultPO<CrossInfoPO> page = new PageResultPO<>(); PageResultPO<CrossInfoPO> page = new PageResultPO<>();
PageHelper.startPage(crossInfoVO.getPageNum(), crossInfoVO.getPageSize()); Integer count = crossInfoMapper.countSelectAll(crossInfoVO);
//Integer count = crossInfoMapper.countSelectAll(crossInfoVO);
List<CrossInfoPO> list = crossInfoMapper.selectAll(crossInfoVO); List<CrossInfoPO> list = crossInfoMapper.selectAll(crossInfoVO);
PageInfo<CrossInfoPO> borrowPOPageInfo = new PageInfo<>(list);
page.setPageNum(crossInfoVO.getPageNum()); page.setPageNum(crossInfoVO.getPageNum());
page.setPageSize(crossInfoVO.getPageSize()); page.setPageSize(crossInfoVO.getPageSize());
page.setTotal(count);
page.setTotal((int)borrowPOPageInfo.getTotal());
page.setData(list); page.setData(list);
return Result.success(page); return Result.success(page);
} }
......
...@@ -27,7 +27,9 @@ mapper: ...@@ -27,7 +27,9 @@ mapper:
pagehelper: pagehelper:
helper-dialect: mysql helper-dialect: mysql
reasonable: false reasonable: false
support-methods-arguments: true # pagehelper分页 配置参数 supportMethodsArguments 建议不要全局设置
# https://www.cnblogs.com/liran123/p/12889093.html
support-methods-arguments: false
params: count=countSql params: count=countSql
jasypt: jasypt:
......
...@@ -207,9 +207,9 @@ ...@@ -207,9 +207,9 @@
and c.is_send = #{isSend} and c.is_send = #{isSend}
</if> </if>
</where> </where>
<!--<if test="pageNum != null and pageSize != null"> <if test="pageNum != null and pageSize != null">
limit #{startNum}, #{pageSize} limit #{startNum}, #{pageSize}
</if>--> </if>
</select> </select>
<select id="countSelectAll" parameterType="net.wanji.web.vo.CrossInfoVO" resultType="integer"> <select id="countSelectAll" parameterType="net.wanji.web.vo.CrossInfoVO" resultType="integer">
select count(1) select count(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment