Exemplo n.º 1
0
 /** 重写父类的index方法,实现分页检索风险评估信息 */
 @Override
 public String index() {
   StringBuffer hql = new StringBuffer();
   hql.append("from ExpertCategory ec where 1=1 ");
   List<Object> args = new ArrayList<Object>();
   if (StringUtils.isNotBlank(getModel().getName())) {
     hql.append(" and ec.name like ?");
     args.add(MatchMode.ANYWHERE.toMatchString(getModel().getName()));
   }
   Page page = PageUtil.getPage(getPageNo(), getPageSize());
   getManager().pageQuery(page, hql.toString(), args.toArray());
   items = page.getData();
   restorePageData(page);
   return INDEX;
 }
Exemplo n.º 2
0
  /** 出版社查询列表 */
  @Override
  public String index() {
    Page page = PageUtil.getPage(getPageNo(), getPageSize());
    StringBuffer hql = new StringBuffer("from Press p where 1=1 ");
    List args = new ArrayList();

    // 按出版社名称查询
    if (StringUtils.isNotBlank(getModel().getName())) {
      hql.append(" and p.name like ?");
      args.add(MatchMode.ANYWHERE.toMatchString(getModel().getName()));
    }

    hql.append(" order by p.charName");
    page = getManager().pageQuery(page, hql.toString(), args.toArray());
    restorePageData(page);
    return INDEX;
  }