WITH dict AS (
    SELECT "id" AS dict_id FROM "frame_dict" WHERE "code" = 'CarType' LIMIT 1
),
_deleted AS (
    DELETE FROM "frame_dict_item"
    WHERE "dict_id" IN (SELECT dict_id FROM dict)
)

INSERT INTO "frame_dict_item"
("id", "dict_id", "code", "name", "value", "sort_number", "is_enable", "is_delete", "create_at", "create_by", "update_at", "update_by")
VALUES
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Plc',     '法睿兰达 [ PLC ]',     0, 1, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Plc_v1',  '法睿兰达 [ PLC_v1 ]',  1, 2, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Pcb',     '法睿兰达 [ PCB ]',     2, 3, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Fairyland.Pc',      '法睿兰达 [ PC ]',      3, 4, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc'),
(gen_random_uuid(), (SELECT dict_id FROM dict), 'Standard.Vda5050',  '行业标准 [ VDA5050 ]',  4, 5, TRUE, FALSE, CURRENT_TIMESTAMP, 'FASS.Mvc', CURRENT_TIMESTAMP, 'FASS.Mvc');