Mybatis批量执行update语句。

解决方案是:把sql语句进行拼接,然后依次执行。在数据库中形如:

update table set a='a' where id='1';

update table set a='b' where id='2';

具体操作是:在mapping.xml文件中写入,

<update id="" parameterType="java.lang.String">

        ${value}
</update>

猜你喜欢

转载自blog.csdn.net/en_joker/article/details/80406751