| | |
| | | |
| | | /** |
| | | * 保存实体 |
| | | * |
| | | * @param po 实体 |
| | | * @return 影响记录数量 |
| | | */ |
| | | @Transactional |
| | | public int save(BaUser po) { |
| | | return this.dao.insert(po); |
| | | public int save(BaUser po){ |
| | | return this.dao.putin(po) ; |
| | | } |
| | | |
| | | /** |
| | | * 保存修改实体 |
| | | * |
| | | * @param po 实体 |
| | | * @return 影响记录数量 |
| | | */ |
| | |
| | | count += this.urDao.insertSelective(new BaUserRole(userId, roleId)); |
| | | } |
| | | } |
| | | return count; |
| | | return count ; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param roleIds 选择的角色id集合 |
| | | * @return 插入用户与角色关联记录数量 |
| | | */ |
| | | public int setRoles(String userId, String[] roleIds) { |
| | | this.urDao.deleteByUserId(Long.parseLong(userId)); |
| | | public int setRoles(Long userId, String[] roleIds) { |
| | | this.urDao.deleteByUserId(userId); |
| | | int count = 0; |
| | | if (roleIds != null && roleIds.length > 0) { |
| | | for (String roleId : roleIds) { |
| | | count += this.urDao.insertSelective(new BaUserRole(Long.parseLong(userId), Long.parseLong(roleId))); |
| | | count += this.urDao.insertSelective(new BaUserRole(userId, Long.parseLong(roleId))); |
| | | } |
| | | } |
| | | return count; |
| | |
| | | |
| | | /** |
| | | * 保存修改实体 |
| | | * |
| | | * @param id 实体ID |
| | | * @return 影响记录数量 |
| | | */ |