mybatis怎么更新数据updatebyexample

mybatis怎么更新数据updatebyexample,第1张

mybatis中的updateByExampleSelective方法怎么使用。 sendDetailMapper.updateByExampleSelective(sendDetail, m)参数m怎么传

Java mysql mybatis批量更新数据库,采用以下写法即可执行,但是数据库连接必须配置:&allowMultiQueries=true

例如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true

<update id="batchUpdate" parameterType="java.util.List">

<foreach collection="list" item="item" index="index" open="" close="" separator="">

update test

<set>

test=${item.test}+1

</set>

where id = ${item.id}

</foreach>

</update>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11354004.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-15
下一篇2023-05-15

发表评论

登录后才能评论

评论列表(0条)

    保存