SET NAMES utf8mb4;
SET CHARACTER SET utf8mb4;
SET character_set_client = utf8mb4;
SET character_set_connection = utf8mb4;
SET character_set_results = utf8mb4;

INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark)
SELECT '人员子类型', 'ccdi_person_sub_type', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_type
    WHERE dict_type = 'ccdi_person_sub_type'
);

UPDATE sys_dict_type
SET dict_name = '人员子类型',
    status = '0',
    remark = '中介黑名单-人员子类型',
    update_by = 'admin',
    update_time = NOW()
WHERE dict_type = 'ccdi_person_sub_type';

UPDATE sys_dict_data
SET dict_sort = 1,
    dict_label = '本人',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '本人';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 1, '本人', '本人', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '本人'
);

UPDATE sys_dict_data
SET dict_sort = 2,
    dict_label = '配偶',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '配偶';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 2, '配偶', '配偶', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '配偶'
);

UPDATE sys_dict_data
SET dict_sort = 3,
    dict_label = '子女',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '子女';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 3, '子女', '子女', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '子女'
);

UPDATE sys_dict_data
SET dict_sort = 4,
    dict_label = '父母',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '父母';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 4, '父母', '父母', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '父母'
);

UPDATE sys_dict_data
SET dict_sort = 5,
    dict_label = '兄弟姐妹',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '兄弟姐妹';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 5, '兄弟姐妹', '兄弟姐妹', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '兄弟姐妹'
);

UPDATE sys_dict_data
SET dict_sort = 6,
    dict_label = '其他',
    css_class = '',
    list_class = 'default',
    is_default = 'N',
    status = '0',
    update_by = 'admin',
    update_time = NOW(),
    remark = '中介黑名单-人员子类型'
WHERE dict_type = 'ccdi_person_sub_type'
  AND dict_value = '其他';

INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
SELECT 6, '其他', '其他', 'ccdi_person_sub_type', '', 'default', 'N', '0', 'admin', NOW(), '中介黑名单-人员子类型'
WHERE NOT EXISTS (
    SELECT 1
    FROM sys_dict_data
    WHERE dict_type = 'ccdi_person_sub_type'
      AND dict_value = '其他'
);
