Bootstrap

mybatis批量update

  1. jdbc配置文件的url后添加:&allowMultiQueries=true (只针对批量update)
  2. 参数传递为list
    <update id="updateAllCus"  parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
          update  t_oc_cm_custom
          set usingstatus='01',zwyf=#{item.zwyf}
          where tenantid=#{item.tenantid} and id=#{item.cid}
        </foreach>  
    </update>
;