You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mes-heli/sql/v1.3.0/2.data.sql

4 lines
464 B

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;