原文链接:https://blog.csdn.net/weixin_48207312/article/details/125797219
<update id="updateUsers" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update t_user
<set>
<if test="item.userName!= null and item.userName!= ''">user_name=#{item.userName},</if>
<if test="item.password!= null and item.password!= ''">password=#{item.password},</if>
<if test="item.age!= null and item.age!= ''">age=#{item.age}</if>
create_date= sysdate()
</set>
where id= #{item.id}
</foreach>
</update>
解决:
批量处理的时候需要在jdbc连接后面加上:allowMultiQueries=true,因为默认是不支持批处理的