mysql批量更新sql语句
<update id = "方法名" parameterType="java.util.list">
update course
<trim prefix="set" suffixOverrides=",">
<trim prefix="name=case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.name!=null">
when id=#{item.id} then #{item.name}
</if>
</foreach>
</trim>
<trim prefix="title =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.title!=null">
when id=#{item.id} then #{item.title}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="item" >
id=#{item.id}
</foreach>
</update>