MySQL 支持 replace into
例子:REPLACE INTO `st_controlmodule` (id,cname,cip,cport,cdesc,cstate) VALUES ('1281029966208831488','3.79安防通用模型_YB测试B03','192.168.3.79','10027','3.79安防通用模型_YB测试003','2');
但是MyCat不支持
用ON DUPLICATE KEY UPDATE 主键colunm=VALUES(主键colunm);
例子 INSERT INTO `st_controlmodule` (id,cname,cip,cport,cdesc,cstate) VALUES ('1281029966208831488','3.79安防通用模型_YB测试E03','192.168.3.79','10027','3.79安防通用模型_YB测试003','2')ON DUPLICATE KEY UPDATE id=VALUES(id);