INSERT INTO unit (unitId, name, spell, addr, status, type) VALUES ( #{item.unitId}, #{item.name}, #{item.spell}, #{item.addr}, #{item.status}, #{item.type}) ON DUPLICATE KEY UPDATE `name` = VALUES(`name`) delete from unit;