Commit 43b9150d authored by wuxiaokai's avatar wuxiaokai

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

parent 1313ff28
......@@ -3,8 +3,6 @@ package net.wanji.web.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
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.entity.TBaseAreaInfo;
import net.wanji.web.entity.TBaseCrossInfo;
......@@ -51,14 +49,11 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
*/
public Result<PageResultPO<CrossInfoPO>> selectAll(CrossInfoVO crossInfoVO) {
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);
PageInfo<CrossInfoPO> borrowPOPageInfo = new PageInfo<>(list);
page.setPageNum(crossInfoVO.getPageNum());
page.setPageSize(crossInfoVO.getPageSize());
page.setTotal((int)borrowPOPageInfo.getTotal());
page.setTotal(count);
page.setData(list);
return Result.success(page);
}
......
......@@ -27,7 +27,9 @@ mapper:
pagehelper:
helper-dialect: mysql
reasonable: false
support-methods-arguments: true
# pagehelper分页 配置参数 supportMethodsArguments 建议不要全局设置
# https://www.cnblogs.com/liran123/p/12889093.html
support-methods-arguments: false
params: count=countSql
jasypt:
......
......@@ -207,9 +207,9 @@
and c.is_send = #{isSend}
</if>
</where>
<!--<if test="pageNum != null and pageSize != null">
<if test="pageNum != null and pageSize != null">
limit #{startNum}, #{pageSize}
</if>-->
</if>
</select>
<select id="countSelectAll" parameterType="net.wanji.web.vo.CrossInfoVO" resultType="integer">
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