if(portalType.equals(1)){ LambdaQueryWrapper<SpacePortalComment> commentLambdaQueryWrapper = new LambdaQueryWrapper<>(); commentLambdaQueryWrapper.eq(SpacePortalComment::getParentId,spacePortalCommentId); childList = spacePortalCommentService.list(commentLambdaQueryWrapper); }else{ QueryWrapper<SpacePortalComment> queryWrapper=new QueryWrapper<>(); queryWrapper.lambda().apply(1 ==1,"FIND_IN_SET ('"+spacePortalCommentId+"',ancestors_id)"); childList = spacePortalCommentService.list(queryWrapper); }
数据库是这么存的: