class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
    private final SysUserMapper sysUserMapper;
    private final SysUserRoleMapper sysUserRoleMapper;
    private final PasswordEncoder passwordEncoder;


    @Override
    @Transactional
    public void saveUserRole(SysUser user) {
        user.setCreateTime(new Date());
        user.setPassword(passwordEncoder.encode(user.getPassword()));
        sysUserMapper.insert(user);
        sysUserRoleMapper.delete(Wrappers.<SysUserRole>update().lambda().eq(SysUserRole::getUserId, user.getUserId()));
        //保存用户与角色关系
        saveUserRoleList(user);
    }

    @Override
    @Transactional
    public void updateUserRole(SysUser user) {
        if (StringUtils.isBlank(user.getPassword())) {
            user.setPassword(null);
        } else {
            user.setPassword(passwordEncoder.encode(user.getPassword()));
        }
        baseMapper.updateById(user);
        sysUserRoleMapper.delete(Wrappers.<SysUserRole>update().lambda().eq(SysUserRole::getUserId, user.getUserId()));
        //保存用户与角色关系
        saveUserRoleList(user);
    }


    @Override
    public int updatePassword(String userId, String password, String newPassword) {<FILL_FUNCTION_BODY>}

    public void saveUserRoleList(SysUser user) {
        if (CollUtil.isNotEmpty(user.getRoleIdList())) {
            user.getRoleIdList().forEach(roleId -> {
                SysUserRole userRole = new SysUserRole();
                userRole.setUserId(user.getUserId());
                userRole.setRoleId(roleId);
                sysUserRoleMapper.insert(userRole);
            });
        }
    }
}

        SysUser sysUser = new SysUser();
        sysUser.setUserId(userId);
        sysUser.setPassword(newPassword);
        return sysUserMapper.updateById(sysUser);
    
<methods>public void <init>() ,public com.suke.czx.modules.sys.mapper.SysUserMapper getBaseMapper() ,public Class<com.suke.czx.modules.sys.entity.SysUser> getEntityClass() ,public Map<java.lang.String,java.lang.Object> getMap(Wrapper<com.suke.czx.modules.sys.entity.SysUser>) ,public V getObj(Wrapper<com.suke.czx.modules.sys.entity.SysUser>, Function<? super java.lang.Object,V>) ,public com.suke.czx.modules.sys.entity.SysUser getOne(Wrapper<com.suke.czx.modules.sys.entity.SysUser>, boolean) ,public Optional<com.suke.czx.modules.sys.entity.SysUser> getOneOpt(Wrapper<com.suke.czx.modules.sys.entity.SysUser>, boolean) ,public boolean removeBatchByIds(Collection<?>, int) ,public boolean removeBatchByIds(Collection<?>, int, boolean) ,public boolean removeById(java.io.Serializable) ,public boolean removeById(java.io.Serializable, boolean) ,public boolean removeByIds(Collection<?>) ,public boolean saveBatch(Collection<com.suke.czx.modules.sys.entity.SysUser>, int) ,public boolean saveOrUpdate(com.suke.czx.modules.sys.entity.SysUser) ,public boolean saveOrUpdateBatch(Collection<com.suke.czx.modules.sys.entity.SysUser>, int) ,public boolean updateBatchById(Collection<com.suke.czx.modules.sys.entity.SysUser>, int) <variables>protected com.suke.czx.modules.sys.mapper.SysUserMapper baseMapper,protected Class<com.suke.czx.modules.sys.entity.SysUser> entityClass,protected org.apache.ibatis.logging.Log log,protected Class<com.suke.czx.modules.sys.mapper.SysUserMapper> mapperClass,protected org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory,protected final Class<?>[] typeArguments