组装多个update语句,这种方式需要设置jdbc连接 allowMultiQueries=true
<update id="batchUpdatePushStatusByPrimaryKey" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
update t_subscribe_info_third_part_detail
set
push_status = #{item.pushStatus,jdbcType=SMALLINT},
push_count = #{item.pushCount,jdbcType=INTEGER},
push_time = #{item.pushTime,jdbcType=TIMESTAMP}
where id = #{item.id,jdbcType=BIGINT}
</foreach>
</update>
如果没有设置,即使使用了;分隔多个sql语句,执行器也会认为是一条sql语句,会在执行时报错