postgresql的批量更新的原生sql和在mybatis的xml中的sql写法
postgresql批量更新的原生sql
update person
set id=tmp.id
from (values
(1,'张飞',37,'书法','成都','巴蜀中学','15276152716','2021-03-26 17:32:28'),
(2,'关羽',43,'围棋','成都','巴蜀中学','15276152716','2021-03-26 17:32:28'),
(3,'赵云',33,'剑术','成都','巴蜀中学','15276152716','2021-03-26 17:32:28'),
(4,'马超',31,'射箭','成都','巴蜀中学','15276152716','2021-03-26 17:32:28'),
(5,'黄忠',49,'饮酒','成都','巴蜀中学','15276152716','2021-03-26 17:32:28')
)
as
tmp(id,name,age,hobby,city,school,mobile,update_time)
where
person.id=tmp.id
在mybatis的xml中的sql写法
<update id="batchUpdateName">