<update id="batchUpdate" parameterType="java.util.List"> <foreach collection="list" item="item" index="index" open="begin" close="end;" separator="" > update T_EMP_1 <set> age = #{item.age}+1,name=#{item.name} </set> where id = #{item.id}; </foreach> </update>
<update id="batchUpdate" parameterType="java.util.List"> begin <foreach collection="list" item="item" index="index" separator="" > update T_EMP_1 <set> age = #{item.age}+1,name=#{item.name} </set> where id = #{item.id}; </foreach> end; </update>