关于mybatis批量插入的问题

tetty tetty 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
自己写的一个批量插入的方法
@Override
public void batchAdd(List<SnapshotDf> list) {
getSqlSession().insert(this.getClassName()+".batchAdd",list);
}
对应的map
<insert id="batchAdd" parameterType="java.util.List">
insert into snapshot_df(
link_id,
sid,
df_name,
df_storage,
df_used,
df_free,
df_usage,
df_mount,
record_time
)values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.linkId},
#{item.sid},
#{item.dfName},
#{item.dfStorage},
#{item.dfUsed},
#{item.dfFree},
#{item.dfUsage},
#{item.dfMount},
#{item.recordTime}
)
</foreach>
</insert>

可是为什么通过后台日志发现拼成的执行sql是
select count(1) from (insert into snapshot_df(...)...
为什么会多出select count(1) from这样一句呢?
...全文

相关推荐

评论
收藏 已收藏
分享
返回顶部
tetty
Web 开发 81,108 成员 341,721 内容