mybatis实现批量更新

来源:互联网 发布:淘宝入驻费用多少钱 编辑:程序博客网 时间:2024/04/27 23:30
<!-- 批量修改 --><update id="batchUpdate" parameterType="list">            update SkuProFeeType            <trim prefix="set" suffixOverrides=",">            <trim prefix="GroupSort =case" suffix="end,">                <foreach collection="list" item="bean"  index="index">                         when (SkuId=#{bean.skuId} and GroupId=#{bean.groupId}) then #{bean.groupSort}               </foreach>             </trim>                          <trim prefix="operator =case" suffix="end,">                <foreach collection="list" item="bean"  index="index">                         when (SkuId=#{bean.skuId} and GroupId=#{bean.groupId}) then #{bean.operator}               </foreach>             </trim>             UpdateTime=now()             </trim>            where yn = 1 and            <foreach collection="list" separator="or" item="bean"  index="index" >             (SkuId=#{bean.skuId} and GroupId=#{bean.groupId})         </foreach></update>
真正的批量更新
0 0