コード例 #1
0
 @SuppressWarnings("unchecked")
 public Page<Member> list(Page<Member> page, Map map) {
   Integer state = (Integer) map.get("state");
   Integer type = (Integer) map.get("type");
   Long checkuser = (Long) map.get("checkuser");
   String username = (String) map.get("username");
   String hql = " from Member a   where a.state>0";
   if (state != null) {
     hql += " and a.state=" + state;
   }
   if (type != null) {
     hql += " and a.type=" + type;
   }
   if (checkuser != null) {
     hql +=
         " and a.id not in (select b.member.id from MemberCheck b where b.user.id= "
             + checkuser
             + ")";
   }
   if (username != null && !username.equals("")) {
     hql += " and a.username like '%" + username + "%'";
   }
   page = this.find(page, "select a" + hql);
   Long totalCount = this.findLong("select count(a) " + hql);
   page.setTotalCount(totalCount);
   return page;
 }
コード例 #2
0
  @SuppressWarnings("unchecked")
  public String list() {
    Map map = new HashMap();
    Page page = new Page();
    page.setPageNo(pageNo);
    page.setPageSize(pageSize);
    map.put("title", title);
    map.put("typeId", typeId);
    map.put("startDate", startDate);
    map.put("endDate", endDate);
    page = this.contentManager.list(page, map);
    request.setAttribute("page", page);

    map.put("startDate", DateManager.formatDate(startDate));
    map.put("endDate", DateManager.formatDate(endDate));
    String pageUtils =
        PageUtils.pageTag(request.getContextPath() + "/admin/content!list.action", map, page);
    request.setAttribute("pageUtils", pageUtils);
    List<ContentType> types = this.typeManager.findList();
    request.setAttribute("types", types);
    return "list";
  }