public void resetPassword(long userId) { User user = this.userDao.selectByPrimaryKey(userId); User record = new User(); record.setId(userId); record.setUpdateTime(new Date()); record.setPassword(PasswordEncoder.encode(user.getName())); this.userDao.updateByPrimaryKeySelective(record); }