@CacheEvict

    /**
     * 更新用户组
     */
    @CacheEvict(cacheNames = "MyBatisCache", key = "'SysUserGroup' + #groupId")
    public String updateById(long groupId, SysUserGroup group, Long roleId, int roleType) {
        group.setId(groupId);
        userGroupDao.updateSampleById(group);
        if (roleId != null) {
            userGroupRoleDao.replace(groupId, roleType, roleId);
        }
        return Result.success();
    }

    /**
     * 查询用户组
     */
    @Cacheable(cacheNames = "MyBatisCache", key = "'SysUserGroup' + #id")
    public SysUserGroup queryById(long id) {
        return userGroupDao.selectById(id);
    }
 

posted on 2018-11-07 11:22  疯狂的妞妞  阅读(2865)  评论(0编辑  收藏  举报

导航