jeecg查询分页
Posted xueblvip
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jeecg查询分页相关的知识,希望对你有一定的参考价值。
后台
@RequestMapping(params = "datagrid3") public void datagrid3(LdcOrderTaxEntity decOrder,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { String invoiceno = request.getParameter("invoiceno"); String wheresql = ""; if(!"".equals(invoiceno)&&invoiceno!=null){ wheresql = " and invoiceno = ‘"+invoiceno+"‘"; } String hql = "from LdcOrderTaxEntity where 1=1 " +wheresql; List<LdcOrderTaxEntity> ldcOrdertaxList = decOrderService.findHql(hql); List<Object> arrayList = new ArrayList<>(); for (int i = (dataGrid.getPage()-1)*dataGrid.getRows(); i < dataGrid.getRows()*dataGrid.getPage(); i++) { if(StringUtil.isNotEmpty(ldcOrdertaxList)) { if(i<=(ldcOrdertaxList.size()-1)){ arrayList.add(ldcOrdertaxList.get(i)); } dataGrid.setTotal(ldcOrdertaxList.size()); } } dataGrid.setResults(arrayList); TagUtil.datagrid(response, dataGrid); }
前台
添加属性:pagination="true"
<t:datagrid name="decOrderList" checkbox="true" fitColumns="true" title="业务订单表" sortName="createDate" actionUrl="decOrderController.do?datagrid3"
pagination="true" idField="id" fit="true" queryMode="group">
以上是关于jeecg查询分页的主要内容,如果未能解决你的问题,请参考以下文章