Esempio n. 1
0
  /**
   * 获取所有的可用菜单
   *
   * @return
   */
  public MenuEntity getMenuTree() {
    MenuEntity rootMenu = menuMapper.selectEntity(MenuEntity.MENU_ROOT);

    MapEntity params = new MapEntity();
    params.put(
        "f_parent_ids",
        (HelpUtil.isEmptyString(rootMenu.getF_parent_ids()) ? "" : rootMenu.getF_parent_ids() + "/")
            + rootMenu.getF_id());
    params.put("f_is_show", 1);
    params.setPageSizeWithMax().setOrderBy("f_parent_ids, f_order");

    rootMenu.setChildren(TreeUtil.listToTree(menuMapper.selectEntityListPage(params)));

    return rootMenu;
  }