Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mybatis-generator-plugin
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mybatis-generator-plugin
Commits
c062929a
Commit
c062929a
authored
Apr 21, 2017
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
逻辑删除插件增强
parent
a43ee154
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
README.md
README.md
+9
-3
No files found.
README.md
View file @
c062929a
...
...
@@ -349,6 +349,12 @@ public class Test {
.
andDelFlagEqualTo
(
Tb
.
DEL_FLAG
)
.
example
()
);
// 4. 逻辑删除和未删除常量
Tb
tb
=
new
Tb
.
Builder
()
.
delFlag
(
Tb
.
DEL_FLAG_OFF
)
// 删除
.
delFlag
(
Tb
.
DEL_FLAG_ON
)
// 未删除
.
build
();
}
}
```
...
...
@@ -437,7 +443,7 @@ public class Test {
Tb
tb
=
new
Tb
.
Builder
()
.
field1
(
1
)
.
field2
(
"xx0"
)
.
delFlag
(
(
short
)
0
)
.
delFlag
(
Tb
.
DEL_FLAG_ON
)
.
build
();
int
k0
=
this
.
tbMapper
.
upsert
(
tb
);
// 2. 已入库数据再次入库,执行update(!!需要注意如触发update其返回的受影响行数为2)
...
...
@@ -458,7 +464,7 @@ public class Test {
.
field1
(
1
)
.
field2
(
"xx0"
)
.
field3
(
1003
)
.
delFlag
(
(
short
)
0
)
.
delFlag
(
Tb
.
DEL_FLAG_ON
)
.
build
();
int
k4
=
this
.
tbMapper
.
upsertByExample
(
tb2
,
new
TbExample
()
...
...
@@ -499,7 +505,7 @@ public class Test {
.
field3
(
1
)
.
field4
(
new
Date
())
.
createTime
(
new
Date
())
.
delFlag
(
Tb
.
DEL_FLAG
)
.
delFlag
(
Tb
.
DEL_FLAG
_ON
)
.
build
();
// 只插入或者更新field1,field2字段
this
.
tbMapper
.
insertSelective
(
tb
.
selective
(
Tb
.
Column
.
field1
,
Tb
.
Column
.
field2
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment