<!--批量更新-->
<update id="updateList">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update user
<trim prefix="SET" suffixOverrides=",">
<if test="item.age!= null ">age= #{item.age},</if>
<if test="item.name!= null and item.name!= ''">name= #{item.name},</if>
</trim>
where id= #{item.id}
</foreach>
</update>
Mybatis根据List批量更新
猜你喜欢
转载自blog.csdn.net/corleone_4ever/article/details/105092460
今日推荐
周排行