Skip to content

feat:支持多列in的查询/更新 #6826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 3.0
Choose a base branch
from
Open

Conversation

xxx-tea
Copy link

@xxx-tea xxx-tea commented May 30, 2025

已完成in和notIn的功能,支持普通和Chain的查询和更新,已完成测试用例的覆盖。
#6825

@milo-xiaomeng
Copy link

这里存在多余的转化 可以不需要 .collect(Collectors.toList())

    protected List<ISqlSegment> inMulExpression(List<List<?>> value) {
        if (CollectionUtils.isEmpty(value)) {
            return Collections.singletonList(() -> "()");
        }
        List<ISqlSegment> sqlSegments = new ArrayList<>();
        sqlSegments.add(0, LEFT_BRACKET);
        // 不需要 .collect(Collectors.toList())
        value.stream().map(this::inExpression).collect(Collectors.toList()).forEach(e -> {
            sqlSegments.add(e);
            sqlSegments.add(COMMA);
        });
        sqlSegments.remove(sqlSegments.size() - 1);
        sqlSegments.add(RIGHT_BRACKET);
        return sqlSegments;
    }

@xxx-tea
Copy link
Author

xxx-tea commented Jun 2, 2025

这里存在多余的转化 可以不需要 .collect(Collectors.toList())

    protected List<ISqlSegment> inMulExpression(List<List<?>> value) {
        if (CollectionUtils.isEmpty(value)) {
            return Collections.singletonList(() -> "()");
        }
        List<ISqlSegment> sqlSegments = new ArrayList<>();
        sqlSegments.add(0, LEFT_BRACKET);
        // 不需要 .collect(Collectors.toList())
        value.stream().map(this::inExpression).collect(Collectors.toList()).forEach(e -> {
            sqlSegments.add(e);
            sqlSegments.add(COMMA);
        });
        sqlSegments.remove(sqlSegments.size() - 1);
        sqlSegments.add(RIGHT_BRACKET);
        return sqlSegments;
    }

是的,疏漏了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants