<update id="updateUsermainInvcode" parameterType="java.util.List">
<if test="list!=null">
UPDATE usermain
<trim prefix="set" suffixOverrides=",">
<trim prefix="code =case" suffix="end,">
<foreach collection="list" item="data" index="index">
<if test="data.userid != null">
when userid=#{data.userid} then #{data.code}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="data" index="index" > userid=#{data.userid} </foreach>
</if>
</update>
mybatis批量更新list
猜你喜欢
转载自blog.csdn.net/dragon974539495/article/details/102560352
今日推荐
周排行