Mybatis批量更新时遇到大坑

http://quinntian.xyz/articles/2018/07/20/1532083230130.html
批量更新代码如下

id="insertMessageReply" parameterType="list">
  collection="list" close="" index="index" item="item" separator=";">
  insert into message_reply(create_time,from_username)
    values
        (
    #{item.CreateTime,jdbcType=BIGINT},
    #{item.FromUserName,jdbcType=VARCHAR},

    )

执行时总是报语法错误
1.Mybatis批量插入时必须在连接地址后面加?allowMultiQueries=true

2.另外还需注意分隔符必须是分号; separator=”;”

猜你喜欢

转载自blog.csdn.net/leofitz/article/details/81137202
今日推荐