后台操作:
List dataAll= getJdbcTemplate().queryForList(sql);
List data = new ArrayList();
int start = pageIndex * pageSize;
int end = start + pageSize;
int i = 0;
for (int l = dataAll.size(); i < l; ++i) {
HashMap recode = (HashMap) dataAll.get(i);
if (recode == null)
continue;
if ((start <= i) && (i < end)) {
data.add(recode);
}
}
HashMap request = new HashMap();
request.put("data", data);
request.put("total", Integer.valueOf(dataAll.size()));