批量修改sql语句

 实现批量修改的sql语句,用List集合传值

<update id="studentBatchUpdate" parameterType="java.util.List">
	<foreach item="item" index="index" collection="list" open="" separator=";" close="">
	    update student
	    <set>
                studentNo = #{item.studentNo},
                studentName = #{item.studentName},
	        studentAge = #{item.studentAge}
	    </set>
	    where id =#{item.id}
	</foreach>
</update>
发布了69 篇原创文章 · 获赞 253 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/weixin_41595700/article/details/103457272
今日推荐