工具:mybatis+pgsql
详见pgsql官方文档
案例
dao层
void update(List<User> userList);
sql
<update id = "update" parameterType="java.util.List">
<foreach collection = "list" item = "val" index = "index" open="" close=""separator=";">
update user
set username = #{val.username},
address = #{val.address}
where id = #{val.id}
</foreach>
</update>