Commit 36bdc8c3 authored by wuxiaokai's avatar wuxiaokai

路口管理-pagehelper分页查询

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