当前位置 : 主页 > 编程语言 > c++ >

NutzWk Datatables 插件分页查询数据组装

来源:互联网 收集:自由互联 发布时间:2021-06-30
datatables 插件分页查询 public NutMap data(int length, int start, int draw, List orders, List columns, Cnd cnd, String linkName, Cnd subCnd) { NutMap re = new NutMap(); if (orders != null orders.size() 0) { for (DataTableOrder order :
datatables 插件分页查询
public NutMap data(int length, int start, int draw, List
 
   orders, List
  
    columns, Cnd cnd, String linkName, Cnd subCnd) { NutMap re = new NutMap(); if (orders != null && orders.size() > 0) { for (DataTableOrder order : orders) { DataTableColumn col = columns.get(order.getColumn()); cnd.orderBy(Sqls.escapeSqlFieldValue(col.getData()).toString(), order.getDir()); } } Pager pager = new OffsetPager(start, length); re.put("recordsFiltered", this.dao().count(this.getEntityClass(), cnd)); List
    list = this.dao().query(this.getEntityClass(), cnd, pager); if (!Strings.isBlank(linkName)) { if (subCnd != null) this.dao().fetchLinks(list, linkName, subCnd); else this.dao().fetchLinks(list, linkName); } re.put("data", list); re.put("draw", draw); re.put("recordsTotal", length); return re; }
  
 
网友评论