Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MybatisTraning
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
zero
MybatisTraning
Commits
3e634363
Commit
3e634363
authored
Dec 11, 2019
by
Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
3cb945bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
UserMapper.java
...Mybatis1/src/main/java/com/mybatis/mapper/UserMapper.java
+27
-0
No files found.
张志墙_Mybatis1/src/main/java/com/mybatis/mapper/UserMapper.java
0 → 100644
View file @
3e634363
package
com
.
mybatis
.
mapper
;
package
com
.
mybatis
.
mapper
;
import
com.mybatis.handle.ContentTypeHandler
;
import
com.mybatis.model.User
;
import
org.apache.ibatis.annotations.*
;
import
java.util.List
;
@Mapper
public
interface
UserMapper
{
@Insert
(
"INSERT INTO USERTEST(NAME,SEX,HOBBY) VALUES (#{name},#{sex},"
+
"#{hobby,typeHandler=com.mybatis.handle.ContentTypeHandler})"
)
int
insert
(
User
user
);
@Insert
({
"<script>"
,
"insert into USERTEST(name, sex, hobby) values "
,
"<foreach collection='list' item='item' separator=','>"
,
"(#{item.name}, #{item.sex}, #{item.hobby,typeHandler=com.mybatis.handle.ContentTypeHandler})"
,
"</foreach>"
,
"</script>"
})
boolean
batchInsert
(
@Param
(
value
=
"list"
)
List
<
User
>
list
);
}
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