INSERT INTO `base_equip` (`name`, `mould_type_id`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) (select DISTINCT device_model,0,1,`creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id` from project_sale_order_sub WHERE device_model not in (select name from base_equip) GROUP BY device_model);

UPDATE project_sale_order_sub a left join base_equip b on a.device_model = b.name set a.device_model = b.id;
