Home  >  Article  >  Database  >  mybatis中配置批量insert mysql,oracle_MySQL

mybatis中配置批量insert mysql,oracle_MySQL

WBOY
WBOYOriginal
2016-06-01 13:34:13995browse

bitsCN.com

mybatis中配置批量insert mysql,oracle

 

有时候需要传入一个list(或集合),通过mybatis进行批量Insert的,语法如下:

 

Mysql:

 

1

insert into TableName(F_ID,F_value) values

2

3

    (#{lt.id},#{lt.value})

4

 

Oracle:

 

1

insert into TableName(F_ID,F_value)

2

3

    select #{lt.id},#{lt.value} from dual

4

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn