Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

feat: builder的where map支持传入_and前缀的key&&Comparable的value,以支持aop场景(软删除等)#154

Open
int8259 wants to merge1 commit intodidi:master
base:master
Choose a base branch
Loading
fromint8259:feat-add

Conversation

int8259
Copy link

@int8259int8259 commentedOct 14, 2024
edited
Loading

feat: builder的where map支持传入_and前缀的key&&Comparable的value,以支持aop场景(软删除等)

@caibirdme
Copy link
Contributor

不好意思回复晚了,这里的描述能更清晰一些吗? 具体的用例是什么

@int8259
Copy link
Author

现在业务系统有两类需求,都涉及到aop场景,本质上都是动态条件 × 固定业务条件

假设动态条件解析后是one_col='a',实际执行的sql:
select * from table_x where one_col='a' And (固定业务条件)

目前由于builder不能直接通过_and,来拼接,就只能要求都写成select * from table_x 固定业务条件
然后再替换字符串,得到实际执行的sql。
后续如果数据规模变得很大(尤其部分查询频率还不好控制),select * from table_x 可能就不合时宜了,
可能需要正则表达式来替换。

具体到用例场景,有如下两种:
一类需求是软删除约束(is_del=1为删除),业务查询的时候不管多复杂的条件,都要加上is_del=0。
一类需求是多个不同业务方的权限要求不一致,可以查不出来,但是不能多查(数据泄漏);目前只能解析成动态条件one_col='a'。

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@int8259@caibirdme

[8]ページ先頭

©2009-2025 Movatter.jp