/** * 转换为Map对象 * * @param dayList * @param totalCountDay * @param pageIndex * @return */ public Map getPagination2(List stList, int totalCount, String pageIndex) { List mapList = new ArrayList(); Map mapData = new LinkedHashMap(); for (int i = 0; i < stList.size(); i++) { StudentInfo s = (StudentInfo) stList.get(i); Map cellMap = new LinkedHashMap(); cellMap.put("id", s.getStu_id()); cellMap.put( "cell", new Object[] { s.getStu_id(), s.getStu_code(), s.getStu_name(), s.getStu_school(), s.getStu_class() }); mapList.add(cellMap); } // if (null == oilManage) { // oilManage = new OilManage(); // } mapData.put("page", pageIndex); // 从前台获取当前第page页 mapData.put("total", totalCount); // 从数据库获取总记录数 mapData.put("rows", mapList); return mapData; }