-- LMS 备货区域点位类型和点位状态字典，按字典类型及字典值幂等插入。
INSERT INTO system_dict_type
    (id, name, type, status, remark, creator, create_time, updater, update_time, deleted, deleted_time)
SELECT 2082668800000000101, 'LMS备货区域点位类型', 'lms_stocking_ivt_point_type', 0,
       'LMS备货区域点位类型', '1', NOW(), '1', NOW(), b'0', '1970-01-01 00:00:00'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_type
        WHERE type = 'lms_stocking_ivt_point_type' AND deleted = b'0'
 );

INSERT INTO system_dict_type
    (id, name, type, status, remark, creator, create_time, updater, update_time, deleted, deleted_time)
SELECT 2082668800000000102, 'LMS备货区域点位状态', 'lms_stocking_ivt_status', 0,
       'LMS备货区域点位状态', '1', NOW(), '1', NOW(), b'0', '1970-01-01 00:00:00'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_type
        WHERE type = 'lms_stocking_ivt_status' AND deleted = b'0'
 );

INSERT INTO system_dict_data
    (id, sort, label, value, dict_type, status, color_type, css_class,
     remark, creator, create_time, updater, update_time, deleted)
SELECT 2082668800000000111, 1, '绑定位', '1', 'lms_stocking_ivt_point_type', 0, 'primary', '',
       'LMS备货区域绑定位', '1', NOW(), '1', NOW(), b'0'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_data
        WHERE dict_type = 'lms_stocking_ivt_point_type' AND value = '1' AND deleted = b'0'
 );

INSERT INTO system_dict_data
    (id, sort, label, value, dict_type, status, color_type, css_class,
     remark, creator, create_time, updater, update_time, deleted)
SELECT 2082668800000000112, 2, '缓存位', '2', 'lms_stocking_ivt_point_type', 0, 'success', '',
       'LMS备货区域缓存位', '1', NOW(), '1', NOW(), b'0'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_data
        WHERE dict_type = 'lms_stocking_ivt_point_type' AND value = '2' AND deleted = b'0'
 );

INSERT INTO system_dict_data
    (id, sort, label, value, dict_type, status, color_type, css_class,
     remark, creator, create_time, updater, update_time, deleted)
SELECT 2082668800000000113, 3, '对接位', '3', 'lms_stocking_ivt_point_type', 0, 'warning', '',
       'LMS备货区域对接位', '1', NOW(), '1', NOW(), b'0'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_data
        WHERE dict_type = 'lms_stocking_ivt_point_type' AND value = '3' AND deleted = b'0'
 );

INSERT INTO system_dict_data
    (id, sort, label, value, dict_type, status, color_type, css_class,
     remark, creator, create_time, updater, update_time, deleted)
SELECT 2082668800000000121, 1, '空', '1', 'lms_stocking_ivt_status', 0, 'info', '',
       'LMS备货区域空点位', '1', NOW(), '1', NOW(), b'0'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_data
        WHERE dict_type = 'lms_stocking_ivt_status' AND value = '1' AND deleted = b'0'
 );

INSERT INTO system_dict_data
    (id, sort, label, value, dict_type, status, color_type, css_class,
     remark, creator, create_time, updater, update_time, deleted)
SELECT 2082668800000000122, 2, '有托盘', '2', 'lms_stocking_ivt_status', 0, 'success', '',
       'LMS备货区域有托盘点位', '1', NOW(), '1', NOW(), b'0'
 WHERE NOT EXISTS (
       SELECT 1 FROM system_dict_data
        WHERE dict_type = 'lms_stocking_ivt_status' AND value = '2' AND deleted = b'0'
 );
