Skip to content
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

简单的逻辑删除实现 #78

Merged
merged 4 commits into from
Mar 21, 2023
Merged

Conversation

zoooooway
Copy link
Contributor

提供继承了BaseMapper, FnMapperLogicalMapper类,在其中覆写了父类的查、改、删方法
image
实现方式很简单,只是在原有拼接SQL的方法中附加一行对逻辑删除值的判断,比如:AND status = 0
image
逻辑删除的值由@LogicalColumn注解指定,支持null值。
只需要在实体类字段上添加@LogicalColumn,并且让业务表mapper类继承LogicalMapper即可使用。

@abel533 abel533 merged commit 7c04901 into mybatis-mapper:master Mar 21, 2023
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.

None yet

2 participants