mytatis foreach 下面的update用法
任第一 2013-02-21 01:39:08 <update id="id" parameterType="Dto">
<foreach item="item" collection="是一个list" >
update test set t.A=#{item.a},t.b='success' where t.id=#{item.id}
</foreach>
</update>
我想这么写。但是报错。假如list里面有两条记录打印Sql如下:
update test set t.A=a,t.b='success' where t.id=1 update test set t.A=a1,t.b='success' where t.id=2
mybatis 中的Sql是不能这么写的。希望大家给我一个思路。