int l_Page = l_course.getInteger("Page");
int l_PageSize = l_course.getInteger("Rows");
//第一个参数的意思为:当前页数,第二个参数的意思为:每页显示多少条记录
PageHelper.startPage(l_Page, l_PageSize);
List<BWsCustAuth> bStationAuths = _bStationAuthService.selectBstationAuth(v_custId);
PageInfo l_pageinfo = new PageInfo(bStationAuths);
Page l_page = new Page();
l_page.setResults(bStationAuths);//返回的结果
l_page.setTotalRecord((int)l_pageinfo.getTotal());
l_page.setPageSize(l_PageSize);
l_page.setPageNo(l_Page);
l_page.setTotalPage(l_pageinfo.getPages());
模糊查询,分页要加order by “字段”
/*根据条件查询*/
select * from B_WsUserLoginAuth,B_CustInfo
<where>
B_WsUserLoginAuth.CustID= B_CustInfo.CustID
<iftest="custid!=null">
and B_WsUserLoginAuth.CustID=#{custid}
</if><iftest="custBrief!=null and custBrief!=''">
and B_CustInfo.CustBrief like '%${custBrief}%'
</if><iftest="telNo!=null and telNo!=''">
and B_WsUserLoginAuth.TelNo = #{telNo}
</if></where>
order by CustID,TelNo