/** * * 获取角色列表信息 * * @param map * @param userids * @return */ public List getRoleList(Map map, String userids) { if (StringUtils.isNotEmpty(userids)) { String[] ids = userids.split(","); if (ids.length == 1) { map.put("userid", userids); return roleMapper.getRoleListByUserid(map); } else { return roleMapper.getRoleList(map); } } else { return roleMapper.getRoleList(map); } }
/** * * 修改角色信息 * * @param role * @param menus */ @Transactional public void updateRole(IpavroleEntity role, String[] menus) { roleMapper.updateRole(role); roleMapper.delRoleMenu(role.getRoleno()); if (menus != null && menus.length > 0) { for (int i = 0; i < menus.length; i++) { String menuid = menus[i]; Map parm = new HashMap(); parm.put("menuid", menuid); parm.put("roleno", role.getRoleno()); roleMapper.addRoleMenu(parm); } } }
/** * * 新增角色 * * @param role * @param menus */ @Transactional public void addRole(IpavroleEntity role, String[] menus) { role.setValflg(ContentUtil.DEFUAL_VALDLF_YES); roleMapper.addRole(role); if (menus != null) { for (int i = 0; i < menus.length; i++) { String menuid = menus[i]; Map parm = new HashMap(); parm.put("menuid", menuid); parm.put("roleno", role.getRoleno()); roleMapper.addRoleMenu(parm); } } }
/** * 单一查询角色信息 * * @param map * @return */ @Transactional public IpavroleEntity queryRole(Map map) { return roleMapper.queryRole(map); }
public void delRole(String roleno) { roleMapper.delRole(roleno); }