class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    private final SysRoleMapper sysRoleMapper;
    private final SysRoleMenuService sysRoleMenuService;

    @Override
    @Transactional
    public void saveRoleMenu(SysRole role) {
        role.setCreateTime(new Date());
        sysRoleMapper.insert(role);
        if (CollUtil.isNotEmpty(role.getMenuIdList())) {
            List<SysRoleMenu> sysRoleMenus = role.getMenuIdList().stream().map(id -> {
                SysRoleMenu menu = new SysRoleMenu();
                menu.setMenuId(id);
                menu.setRoleId(role.getRoleId());
                return menu;
            }).collect(Collectors.toList());
            sysRoleMenuService.saveBatch(sysRoleMenus);
        }
    }

    @Override
    @Transactional
    public void updateRoleMenu(SysRole role) {<FILL_FUNCTION_BODY>}

    @Override
    public List<Long> queryRoleIdList(Long createUserId) {
        return sysRoleMapper.queryRoleIdList(createUserId);
    }


    @Override
    public void deleteBath(Long id) {
        baseMapper.deleteById(id);
        sysRoleMenuService.remove(Wrappers.<SysRoleMenu>query().lambda().eq(SysRoleMenu::getRoleId, id));
    }

}

        sysRoleMapper.updateById(role);
        if (CollUtil.isNotEmpty(role.getMenuIdList())) {
            sysRoleMenuService.remove(Wrappers.<SysRoleMenu>query().lambda().eq(SysRoleMenu::getRoleId, role.getRoleId()));
            List<SysRoleMenu> sysRoleMenus = role.getMenuIdList().stream().map(id -> {
                SysRoleMenu menu = new SysRoleMenu();
                menu.setMenuId(id);
                menu.setRoleId(role.getRoleId());
                return menu;
            }).collect(Collectors.toList());
            sysRoleMenuService.saveBatch(sysRoleMenus);
        }
    
<methods>public void <init>() ,public com.suke.czx.modules.sys.mapper.SysRoleMapper getBaseMapper() ,public Class<com.suke.czx.modules.sys.entity.SysRole> getEntityClass() ,public Map<java.lang.String,java.lang.Object> getMap(Wrapper<com.suke.czx.modules.sys.entity.SysRole>) ,public V getObj(Wrapper<com.suke.czx.modules.sys.entity.SysRole>, Function<? super java.lang.Object,V>) ,public com.suke.czx.modules.sys.entity.SysRole getOne(Wrapper<com.suke.czx.modules.sys.entity.SysRole>, boolean) ,public Optional<com.suke.czx.modules.sys.entity.SysRole> getOneOpt(Wrapper<com.suke.czx.modules.sys.entity.SysRole>, 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.SysRole>, int) ,public boolean saveOrUpdate(com.suke.czx.modules.sys.entity.SysRole) ,public boolean saveOrUpdateBatch(Collection<com.suke.czx.modules.sys.entity.SysRole>, int) ,public boolean updateBatchById(Collection<com.suke.czx.modules.sys.entity.SysRole>, int) <variables>protected com.suke.czx.modules.sys.mapper.SysRoleMapper baseMapper,protected Class<com.suke.czx.modules.sys.entity.SysRole> entityClass,protected org.apache.ibatis.logging.Log log,protected Class<com.suke.czx.modules.sys.mapper.SysRoleMapper> mapperClass,protected org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory,protected final Class<?>[] typeArguments