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">


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM