Commit 36bdc8c3 authored by wuxiaokai's avatar wuxiaokai

路口管理-pagehelper分页查询

parent 9ca3a927
......@@ -3,6 +3,8 @@ 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;
......@@ -48,14 +50,17 @@ public class TBaseCrossInfoService extends ServiceImpl<TBaseCrossInfoMapper, TBa
* @return {@link Result}<{@link PageResultPO}<{@link CrossInfoPO}>>
*/
public Result<PageResultPO<CrossInfoPO>> selectAll(CrossInfoVO crossInfoVO) {
PageResultPO<CrossInfoPO> pageResult = new PageResultPO<>();
Integer count = crossInfoMapper.countSelectAll(crossInfoVO);
PageResultPO<CrossInfoPO> page = new PageResultPO<>();
PageHelper.startPage(crossInfoVO.getPageNum(), crossInfoVO.getPageSize());
//Integer count = crossInfoMapper.countSelectAll(crossInfoVO);
List<CrossInfoPO> list = crossInfoMapper.selectAll(crossInfoVO);
pageResult.setPageNum(crossInfoVO.getPageNum());
pageResult.setPageSize(crossInfoVO.getPageSize());
pageResult.setTotal(count);
pageResult.setData(list);
return Result.success(pageResult);
PageInfo<CrossInfoPO> borrowPOPageInfo = new PageInfo<>(list);
page.setPageNum(crossInfoVO.getPageNum());
page.setPageSize(crossInfoVO.getPageSize());
page.setTotal((int)borrowPOPageInfo.getTotal());
page.setData(list);
return Result.success(page);
}
/**
......
......@@ -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