<span style="font-size:18px;">insert into table
(station_id,
station_name,
station_code,
station_ip,
station_port,
dept_id,
dept_name,
address,
linkman_phone,
creater,
create_time,
last_update_time)
select seq.nextval, t.* from (
<foreach collection="sInfos" item="sInfo" index="index" separator="union all">
select #{sInfo.stationName} stationName,
#{sInfo.stationCode} stationCode,
#{sInfo.stationIp} stationIp,
#{sInfo.stationPort} stationPort,
#{sInfo.deptId} deptId,
#{sInfo.deptName} deptName,
#{sInfo.address},
#{sInfo.linkmanPhone} address,
#{sInfo.creater} creater,
sysdate create_time,
sysdate last_update_time from dual
</foreach>
) t</span>
使用mybatis 实现批量插入,主键自增长
最新推荐文章于 2024-05-16 14:29:54 发布