/* * 保存/修改角色 * @see com.cxstock.biz.power.RoleBiz#saveOrUpdateRole(com.cxstock.biz.power.dto.RoleDTO) */ public void saveOrUpdateRole(RoleDTO dto) { Role role = new Role(); if (dto.getRoleid() != null) { role = (Role) baseDao.loadById(Role.class, dto.getRoleid()); } role.setRolename(dto.getRolename()); role.setBz(dto.getBz()); baseDao.saveOrUpdate(role); }
/* * 分页查询角色列表 * @see com.cxstock.biz.power.RoleBiz#findPageRole(com.cxstock.utils.system.Page) */ public void findPageRole(Page page) { String hql = "from Role order by roleid"; List list = baseDao.findByHql(hql, page.getStart(), page.getLimit()); List dtoList = RoleDTO.createDtos(list); int total = baseDao.countAll("Role"); page.setRoot(dtoList); page.setTotal(total); }