<update id="modAllItems" parameterType="com.arvin.po.ItemsCustom">
<foreach collection="list" item="items" separator=";">
UPDATE items
<set>
<if test="items.name != null">
name = #{items.name},
</if>
<if test="items.price != null">
price = #{items.price},
</if>
<if test="items.detail != null">
detail = #{items.detail},
</if>
<if test="items.createtime!= null">
createtime = #{items.createtime},
</if>
</set>
WHERE id = #{items.id}
</foreach>
</update>
2.要批量提交多条执行语句,所以在db,properties 文件中
jdbc.url = jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true