其他分享
首页 > 其他分享> > mybatis批量更新

mybatis批量更新

作者:互联网

```c
 <update id=" ">
        update table 
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="columnname= case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    when id=#{item.id } then #{item.columnname,typeHandler=uyun.whale.common.mybatis.type.UUIDTypeHandler}
                </foreach>
            </trim>
        </trim>
        WHERE
        id IN
        <foreach collection="list" item="item" open="(" close=")" separator=",">
            #{item.id}
        </foreach>
    </update>

标签:批量,columnname,typeHandler,更新,item,mybatis,WHERE,id
来源: https://blog.csdn.net/cj1140874158/article/details/114019927