public ListInfo getCommentDictList(String sql, int offset, int maxItem)
     throws DocCommentManagerException {
   DBUtil db = new DBUtil();
   DBUtil db1 = new DBUtil();
   try {
     db.executeSelect(sql, offset, maxItem);
     List tempList = new ArrayList();
     ListInfo listInfo = new ListInfo();
     for (int i = 0; i < db.size(); i++) {
       DocCommentDict docCommentDict = new DocCommentDict();
       long siteid = db.getLong(i, "siteid");
       docCommentDict.setSiteId(siteid);
       docCommentDict.setWordId(db.getInt(i, "id"));
       docCommentDict.setWord(db.getString(i, "word"));
       docCommentDict.setDescription(db.getString(i, "description"));
       if (siteid != 0) {
         String sql1 = "select name from td_cms_site where site_id = " + siteid;
         db1.executeSelect(sql1);
         if (db1.size() > 0) docCommentDict.setSiteName(db1.getString(0, "name"));
         else docCommentDict.setSiteName("不详(可能站点已经删除)");
       } else {
         docCommentDict.setSiteName("各站点通用");
       }
       tempList.add(docCommentDict);
     }
     listInfo.setDatas(tempList);
     listInfo.setTotalSize(db.getTotalSize());
     return listInfo;
   } catch (SQLException e) {
     e.printStackTrace();
     throw new DocCommentManagerException("获取字典词汇失败!" + e.getMessage());
   }
 }
  public ListInfo getCommnetImpeachList(String sql, int offset, int maxItem)
      throws DocCommentManagerException {
    DBUtil db = new DBUtil();
    try {
      db.executeSelect(sql, offset, maxItem);
      List tempList = new ArrayList();
      ListInfo listInfo = new ListInfo();
      for (int i = 0; i < db.size(); i++) {
        CommentImpeach commentImpeach = new CommentImpeach();
        commentImpeach.setId(db.getInt(i, "id"));
        commentImpeach.setCommentId(db.getInt(i, "comment_id"));
        commentImpeach.setImpeacher(db.getString(i, "impeacher"));
        commentImpeach.setEmail(db.getString(i, "email"));
        commentImpeach.setReason(db.getInt(i, "reason"));
        commentImpeach.setDescription(db.getString(i, "descriptioninfo"));
        commentImpeach.setComtime(db.getDate(i, "comtime"));
        commentImpeach.setRepled(db.getInt(i, "replyed"));

        tempList.add(commentImpeach);
      }
      listInfo.setDatas(tempList);
      listInfo.setTotalSize(db.getTotalSize());
      return listInfo;
    } catch (SQLException e) {
      e.printStackTrace();
      throw new DocCommentManagerException("获取评论列表失败!" + e.getMessage());
    }
  }
  /** 得到通知列表 */
  public ListInfo getNoticList(String sql, int offset, int maxItem) throws ManagerException {

    DBUtil dbUtil = new DBUtil();
    try {

      dbUtil.executeSelect(sql, offset, maxItem);
      ListInfo listInfo = new ListInfo();
      List list = new ArrayList();
      for (int i = 0; i < dbUtil.size(); i++) {
        Notic notic = new Notic();

        notic.setNoticID(dbUtil.getInt(i, "NOTIC_ID"));
        notic.setBeginTime(dbUtil.getDate(i, "begintime"));
        notic.setEndTime(dbUtil.getDate(i, "endtime"));
        notic.setContent(dbUtil.getString(i, "content"));
        notic.setPlace(dbUtil.getString(i, "place"));
        notic.setExecutorID(dbUtil.getInt(i, "executor_id"));
        notic.setNoticPlannerName(dbUtil.getString(i, "user_name"));
        notic.setNoticPlannerRealName(dbUtil.getString(i, "user_realname"));
        notic.setSource(dbUtil.getString(i, "source"));
        notic.setStatus(dbUtil.getInt(i, "status"));
        notic.setTopic(dbUtil.getString(i, "topic"));
        list.add(notic);
      }
      listInfo.setDatas(list);
      listInfo.setTotalSize(dbUtil.getTotalSize());
      return listInfo;
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ManagerException(e.getMessage());
    }
  }
  /** 得到没有分页的日程列表 */
  public ListInfo getSchedularList(String sql) throws ManagerException {

    DBUtil dbUtil = new DBUtil();
    try {
      dbUtil.executeSelect(sql);
      ListInfo listInfo = new ListInfo();
      List list = new ArrayList();

      for (int i = 0; i < dbUtil.size(); i++) {
        Schedular sch = new Schedular();

        sch.setSchedularID(dbUtil.getInt(i, "SCHEDULAR_ID"));
        sch.setPlannerID(dbUtil.getInt(i, "PLANNER_ID"));
        sch.setExecutorID(dbUtil.getInt(i, "executor_id"));
        sch.setBeginTime(dbUtil.getDate(i, "BEGINTIME"));
        sch.setEndTime(dbUtil.getDate(i, "ENDTIME"));
        sch.setType(dbUtil.getString(i, "TYPE"));
        sch.setPlace(dbUtil.getString(i, "PLACE"));
        sch.setTopic(dbUtil.getString(i, "TOPIC"));
        sch.setEssentiality(dbUtil.getString(i, "essentiality"));
        sch.setContent(dbUtil.getString(i, "content"));
        sch.setIsOpen(dbUtil.getInt(i, "isopen"));
        sch.setIsPublicAffair(dbUtil.getInt(i, "ispublicaffair"));
        sch.setStatus(dbUtil.getInt(i, "status"));

        list.add(sch);
      }
      listInfo.setDatas(list);
      listInfo.setTotalSize(dbUtil.getTotalSize());
      return listInfo;
    } catch (SQLException e) {
      e.printStackTrace();
      throw new ManagerException(e.getMessage());
    }
  }
  /**
   * 查询文档评论列表
   *
   * @param sortKey 排序关键字
   * @param desc 排序方式
   * @param offset 偏移量
   * @param pagesize 页面数据大小
   * @param docId 文档ID
   * @param HttpServletRequest request
   * @param HttpServletResponse response
   * @return String
   * @throws Exception Exception
   */
  public String queryDocumentCommentList(
      @PagerParam(name = PagerParam.SORT, defaultvalue = "title") String sortKey,
      @PagerParam(name = PagerParam.DESC, defaultvalue = "false") boolean desc,
      @PagerParam(name = PagerParam.OFFSET) long offset,
      @PagerParam(name = PagerParam.PAGE_SIZE, defaultvalue = "10") int pagesize,
      int docId,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    ListInfo docCommentList = docCommentManager.getCommnetList(docId, (int) offset, pagesize);
    request.setAttribute("total", docCommentList.getTotalSize());
    request.setAttribute("docCommentList", docCommentList);
    request.setAttribute("docId", docId);

    return "path:queryDocumentCommentList";
  }
 public ListInfo getCommnetList(String sql, int offset, int maxItem)
     throws DocCommentManagerException {
   // TODO Auto-generated method stub
   DBUtil db = new DBUtil();
   DBUtil dbUtil = new DBUtil();
   try {
     db.executeSelect(sql, offset, maxItem);
     List tempList = new ArrayList();
     ListInfo listInfo = new ListInfo();
     for (int i = 0; i < db.size(); i++) {
       DocComment docComment = new DocComment();
       int comment_id = db.getInt(i, "comment_id");
       docComment.setCommentId(comment_id);
       docComment.setDocId(db.getInt(i, "doc_id"));
       String doc_comment = db.getString(i, "doc_comment");
       docComment.setDocComment(doc_comment);
       docComment.setUserName(db.getString(i, "user_name"));
       docComment.setSubTime(db.getDate(i, "comtime"));
       docComment.setUserIP(db.getString(i, "user_ip"));
       docComment.setSrcCommentId(db.getInt(i, "src_comment_id"));
       docComment.setDocTitle(db.getString(i, "docTitle"));
       docComment.setStatus(db.getInt(i, "status"));
       String sql1 = "select word from td_cms_doccomment_dict";
       dbUtil.executeSelect(sql1);
       if (dbUtil.size() > 0) {
         for (int j = 0; j < dbUtil.size(); j++) {
           if (doc_comment.indexOf(dbUtil.getString(j, "word")) >= 0) { // 判断是否报警
             docComment.setAlarm(1); // 设置报警
           }
         }
       }
       sql1 = "select id from td_cms_doccom_impeachinfo where comment_id =" + comment_id;
       dbUtil.executeSelect(sql1);
       if (dbUtil.size() > 0) { // 判断是否有举报信息
         docComment.setImpeachFlag(1); // 设置为有举报信息
       }
       tempList.add(docComment);
     }
     listInfo.setDatas(tempList);
     listInfo.setTotalSize(db.getTotalSize());
     return listInfo;
   } catch (SQLException e) {
     e.printStackTrace();
     throw new DocCommentManagerException("获取评论列表失败!" + e.getMessage());
   }
 }
 /** 得到某用户的便笺列表。 */
 public ListInfo getNotepaperList(int userID, int offset, int maxItem) throws ManagerException {
   DBUtil db = new DBUtil();
   String sql = "select * from td_sd_notepaper where USER_ID = " + userID + " order by time desc";
   try {
     db.executeSelect(sql, offset, maxItem);
     ListInfo listInfo = new ListInfo();
     List list = new ArrayList();
     for (int i = 0; i < db.size(); i++) {
       Notepaper notepaper = new Notepaper();
       notepaper.setNotepaparID(db.getInt(i, "NOTEPAPER_ID"));
       notepaper.setContent(db.getString(i, "CONTENT"));
       notepaper.setTime(db.getDate(i, "time"));
       notepaper.setUserID(db.getInt(i, "USER_ID"));
       list.add(notepaper);
     }
     listInfo.setDatas(list);
     listInfo.setTotalSize(db.getTotalSize());
     return listInfo;
   } catch (SQLException e) {
     e.printStackTrace();
     throw new ManagerException(e.getMessage());
   }
 }