https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html
用法
http://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/
When you insert a new row into a table if the row causes a duplicate in [UNIQUE](http://www.mysqltutorial.org/mysql-unique/) index or [PRIMARY KEY](http://www.mysqltutorial.org/mysql-primary-key/) , MySQL will issue an error.
However, if you specify the ON DUPLICATE KEY UPDATE option in the INSERT statement, MySQL will update the existing row with the new values instead.