public List searchChildMenu(String parentMenu) { Map params = new HashMap(); params.put("parentMenu", parentMenu); List<DmMenu> children = dmMenuMapper.searchMenus(params); for (DmMenu dmMenu : children) { dmMenu.setChildren(searchChildMenu(String.valueOf(dmMenu.getParentMenu()))); } return children; }
public List searchAdminMenus(Map params) { List<DmMenu> dmMenus = dmMenuMapper.searchMenus(params); for (DmMenu dmMenu : dmMenus) { Map m = new HashMap(); m.put("parentMenu", dmMenu.getMenuId()); dmMenu.setChildren(searchAdminMenus(m)); } return dmMenus; }
public List searchAllMenus(Map params) { List<DmMenu> dmMenus = dmMenuMapper.searchMenusByPriv(params); for (DmMenu dmMenu : dmMenus) { Map m = new HashMap(); m.put("parentMenu", dmMenu.getMenuId()); m.put("privIds", params.get("privIds")); m.put("staffId", params.get("staffId")); dmMenu.setChildren(searchAllMenus(m)); } return dmMenus; }
public boolean updateMenu(Map params) { DmMenu dmMenu = new DmMenu(); dmMenu.loadFromMap(params); dmMenuMapper.updateByPrimaryKeySelective(dmMenu); return true; }