码迷,mamicode.com
首页 > 其他好文 > 详细

jeecg查询分页

时间:2019-12-25 15:46:18      阅读:350      评论:0      收藏:0      [点我收藏+]

标签:HERE   ams   als   属性   div   mode   page   ted   tps   

后台

@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查询分页

标签:HERE   ams   als   属性   div   mode   page   ted   tps   

原文地址:https://www.cnblogs.com/xueblvip/p/12096988.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!