Пример #1
0
  /**
   * 转换为Map对象
   *
   * @param dayList
   * @param totalCountDay
   * @param pageIndex
   * @return
   */
  public Map getPagination(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();

      String flag = findStudent(s.getStu_id());
      String html = initcheckBoxHtml(s.getStu_id(), s.getStu_name(), flag);

      cellMap.put("id", s.getStu_id());

      cellMap.put(
          "cell",
          new Object[] {
            html, s.getStu_code(), s.getStu_name(), s.getStu_school(), s.getStu_class(), flag
          });
      mapList.add(cellMap);
    }

    // if (null == oilManage) {
    // oilManage = new OilManage();
    // }

    mapData.put("page", pageIndex); // 从前台获取当前第page页
    mapData.put("total", totalCount); // 从数据库获取总记录数
    mapData.put("rows", mapList);

    return mapData;
  }