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
1d2d2d1a
Commit
1d2d2d1a
authored
Jan 16, 2017
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README.md 修改
parent
638a6409
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
README.md
README.md
+15
-13
No files found.
README.md
View file @
1d2d2d1a
...
@@ -260,21 +260,23 @@ public class Test {
...
@@ -260,21 +260,23 @@ public class Test {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// 构建插入数据
// 构建插入数据
List
<
Tb
>
list
=
new
ArrayList
<>();
List
<
Tb
>
list
=
new
ArrayList
<>();
list
.
add
(
new
Tb
.
Builder
()
list
.
add
(
new
Tb
.
Builder
()
.
field1
(
0
)
.
field1
(
0
)
.
field2
(
"xx0"
)
.
field2
(
"xx0"
)
.
field3
(
0
)
.
field3
(
0
)
.
field4
(
new
Date
())
.
field4
(
new
Date
())
.
build
()
.
build
()
);
);
list
.
add
(
new
Tb
.
Builder
()
list
.
add
(
new
Tb
.
Builder
()
.
field1
(
1
)
.
field1
(
1
)
.
field2
(
"xx1"
)
.
field2
(
"xx1"
)
.
field3
(
1
)
.
field3
(
1
)
.
field4
(
new
Date
())
.
field4
(
new
Date
())
.
build
()
.
build
()
);
);
int
inserted
=
this
.
tbMapper
.
batchInsert
(
list
);
this
.
tbMapper
.
batchInsert
(
list
);
}
}
}
}
```
```
...
@@ -304,27 +306,27 @@ public class Test {
...
@@ -304,27 +306,27 @@ public class Test {
public
class
Test
{
public
class
Test
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// 1. 逻辑删除ByExample
// 1. 逻辑删除ByExample
TbExample
ex
=
new
TbExample
()
this
.
tbMapper
.
logicalDeleteByExample
(
new
TbExample
()
.
createCriteria
()
.
createCriteria
()
.
andField1EqualTo
(
1
)
.
andField1EqualTo
(
1
)
.
example
();
.
example
()
);
this
.
tbMapper
.
logicalDeleteByExample
(
ex
);
// 2. 逻辑删除ByPrimaryKey
// 2. 逻辑删除ByPrimaryKey
this
.
tbMapper
.
logicalDeleteByPrimaryKey
(
1L
);
this
.
tbMapper
.
logicalDeleteByPrimaryKey
(
1L
);
// 3. 同时Example中提供了一个快捷方法来过滤逻辑删除数据
// 3. 同时Example中提供了一个快捷方法来过滤逻辑删除数据
TbExample
selEx
=
new
TbExample
()
this
.
tbMapper
.
selectByExample
(
new
TbExample
()
.
createCriteria
()
.
createCriteria
()
.
andField1EqualTo
(
1
)
.
andField1EqualTo
(
1
)
// 新增了一个andDeleted方法过滤逻辑删除数据
// 新增了一个andDeleted方法过滤逻辑删除数据
.
andDeleted
(
true
)
.
andDeleted
(
true
)
// 当然也可直接使用逻辑删除列的查询方法,我们数据Model中定义了一个逻辑删除常量DEL_FLAG
// 当然也可直接使用逻辑删除列的查询方法,我们数据Model中定义了一个逻辑删除常量DEL_FLAG
.
andDelFlagEqualTo
(
Tb
.
DEL_FLAG
)
.
andDelFlagEqualTo
(
Tb
.
DEL_FLAG
)
.
example
();
.
example
()
);
List
<
Tb
>
list
=
this
.
tbMapper
.
selectByExample
(
selEx
);
}
}
}
}
```
```
\ No newline at end of file
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