CREATE TABLE IF NOT EXISTS "mde_area" (
                                          "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "name" varchar,
                                          "type" int,
                                          "parent_id" bigint,
                                          "creator" varchar DEFAULT '',
                                          "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                          "updater" varchar DEFAULT '',
                                          "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                          "deleted" bit NOT NULL DEFAULT FALSE,
                                          "tenant_id" bigint NOT NULL DEFAULT 0,
                                          PRIMARY KEY ("id")
) COMMENT '地区表';
  
   CREATE TABLE IF NOT EXISTS "mde_certificate" (
                                                    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                    "name_cn" varchar NOT NULL,
                                                    "name_en" varchar,
                                                    "parent_id" bigint NOT NULL,
                                                    "level" bit,
                                                    "creator" varchar DEFAULT '',
                                                    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                    "updater" varchar DEFAULT '',
                                                    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                    "deleted" bit NOT NULL DEFAULT FALSE,
                                                    "tenant_id" bigint NOT NULL DEFAULT 0,
                                                    PRIMARY KEY ("id")
   ) COMMENT '证书表';
  
   CREATE TABLE IF NOT EXISTS "mde_user_skill" (
                                                   "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                   "user_id" bigint NOT NULL,
                                                   "name" varchar,
                                                   "level" int,
                                                   "creator" varchar DEFAULT '',
                                                   "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                   "updater" varchar DEFAULT '',
                                                   "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                   "deleted" bit NOT NULL DEFAULT FALSE,
                                                   "tenant_id" bigint NOT NULL DEFAULT 0,
                                                   PRIMARY KEY ("id")
   ) COMMENT '人才技能表';
  
   CREATE TABLE IF NOT EXISTS "mde_work_exp" (
                                                 "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                 "user_id" bigint NOT NULL,
                                                 "enterprise_id" bigint,
                                                 "enterprise_name" varchar,
                                                 "industry_id" bigint,
                                                 "dept_name" varchar,
                                                 "position_id" bigint,
                                                 "position_name" varchar,
                                                 "start_time" varchar,
                                                 "end_time" varchar,
                                                 "content" varchar,
                                                 "achievement" varchar,
                                                 "pay" varchar,
                                                 "pay_type" int,
                                                 "currency_type" int,
                                                 "skill_list" varchar,
                                                 "creator" varchar DEFAULT '',
                                                 "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                 "updater" varchar DEFAULT '',
                                                 "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                 "deleted" bit NOT NULL DEFAULT FALSE,
                                                 "tenant_id" bigint NOT NULL DEFAULT 0,
                                                 PRIMARY KEY ("id")
   ) COMMENT '工作经历表';
  
   CREATE TABLE IF NOT EXISTS "mde_user_certificate" (
                                                         "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                         "user_id" bigint NOT NULL,
                                                         "certificate_id" bigint,
                                                         "creator" varchar DEFAULT '',
                                                         "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                         "updater" varchar DEFAULT '',
                                                         "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                         "deleted" bit NOT NULL DEFAULT FALSE,
                                                         "tenant_id" bigint NOT NULL DEFAULT 0,
                                                         PRIMARY KEY ("id")
   ) COMMENT '人才证书表';
  
   CREATE TABLE IF NOT EXISTS "mde_school" (
                                               "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                               "name" varchar,
                                               "area_id" bigint,
                                               "address" varchar,
                                               "longitude" varchar,
                                               "latitude" varchar,
                                               "status" int NOT NULL,
                                               "creator" varchar DEFAULT '',
                                               "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                               "updater" varchar DEFAULT '',
                                               "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                               "deleted" bit NOT NULL DEFAULT FALSE,
                                               "tenant_id" bigint NOT NULL DEFAULT 0,
                                               PRIMARY KEY ("id")
   ) COMMENT '学校表';
  
   CREATE TABLE IF NOT EXISTS "mde_position_tag" (
                                                     "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                     "position_id" bigint,
                                                     "label" varchar,
                                                     "creator" varchar DEFAULT '',
                                                     "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                     "updater" varchar DEFAULT '',
                                                     "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                     "deleted" bit NOT NULL DEFAULT FALSE,
                                                     "tenant_id" bigint NOT NULL DEFAULT 0,
                                                     PRIMARY KEY ("id")
   ) COMMENT '职位标签表';
  
   CREATE TABLE IF NOT EXISTS "mde_major" (
                                              "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                              "name_cn" varchar,
                                              "name__en" varchar,
                                              "status" int NOT NULL,
                                              "creator" varchar DEFAULT '',
                                              "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                              "updater" varchar DEFAULT '',
                                              "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                              "deleted" bit NOT NULL DEFAULT FALSE,
                                              "tenant_id" bigint NOT NULL DEFAULT 0,
                                              PRIMARY KEY ("id")
   ) COMMENT '专业表';
  
   CREATE TABLE IF NOT EXISTS "mde_job_interested" (
                                                       "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                       "user_id" bigint,
                                                       "job_type" int,
                                                       "position_id" bigint,
                                                       "industry_id_list" varchar,
                                                       "pay_min" varchar,
                                                       "pay_max" varchar,
                                                       "work_area_id" bigint,
                                                       "interested_area_id_list" varchar,
                                                       "creator" varchar DEFAULT '',
                                                       "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                       "updater" varchar DEFAULT '',
                                                       "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                       "deleted" bit NOT NULL DEFAULT FALSE,
                                                       "tenant_id" bigint NOT NULL DEFAULT 0,
                                                       PRIMARY KEY ("id")
   ) COMMENT '求职意向表';
  
   CREATE TABLE IF NOT EXISTS "mde_edu_exp" (
                                                "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                "user_id" bigint,
                                                "school_id" bigint,
                                                "school_name" varchar,
                                                "education_type" int,
                                                "education_system_type" int,
                                                "major_id" bigint,
                                                "major" varchar,
                                                "start_time" varchar,
                                                "end_time" varchar,
                                                "content" varchar,
                                                "creator" varchar DEFAULT '',
                                                "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                "updater" varchar DEFAULT '',
                                                "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                "deleted" bit NOT NULL DEFAULT FALSE,
                                                "tenant_id" bigint NOT NULL DEFAULT 0,
                                                PRIMARY KEY ("id")
   ) COMMENT '教育经历表';
  
   CREATE TABLE IF NOT EXISTS "mde_cv_attachment" (
                                                      "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                      "user_id" bigint,
                                                      "title" varchar,
                                                      "url" varchar,
                                                      "creator" varchar DEFAULT '',
                                                      "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                      "updater" varchar DEFAULT '',
                                                      "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                      "deleted" bit NOT NULL DEFAULT FALSE,
                                                      "tenant_id" bigint NOT NULL DEFAULT 0,
                                                      PRIMARY KEY ("id")
   ) COMMENT '简历附件表';

CREATE TABLE IF NOT EXISTS "mde_user" (
                                          "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                          "username" varchar NOT NULL,
                                          "password" varchar NOT NULL,
                                          "email" varchar,
                                          "phone" varchar,
                                          "avatar" varchar,
                                          "status" int NOT NULL,
                                          "register_ip" varchar,
                                          "register_terminal" varchar,
                                          "login_ip" varchar,
                                          "login_date" varchar,
                                          "creator" varchar DEFAULT '',
                                          "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                          "updater" varchar DEFAULT '',
                                          "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                          "deleted" bit NOT NULL DEFAULT FALSE,
                                          "tenant_id" bigint NOT NULL,
                                          PRIMARY KEY ("id")
) COMMENT '用户登录表';

CREATE TABLE IF NOT EXISTS "mde_job_advertised" (
                                                    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                    "enterprise_id" bigint NOT NULL,
                                                    "user_id" bigint NOT NULL,
                                                    "area_id" bigint NOT NULL,
                                                    "name" varchar NOT NULL,
                                                    "position_id" bigint NOT NULL,
                                                    "type" int NOT NULL,
                                                    "exp_type" int NOT NULL,
                                                    "edu_type" int NOT NULL,
                                                    "pay_from" int,
                                                    "pay_to" int,
                                                    "tag_list" varchar,
                                                    "content" varchar,
                                                    "requirement" varchar,
                                                    "address" varchar,
                                                    "longitude" varchar,
                                                    "latitude" varchar,
                                                    "status" int,
                                                    "creator" varchar DEFAULT '',
                                                    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                    "updater" varchar DEFAULT '',
                                                    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                    "deleted" bit NOT NULL DEFAULT FALSE,
                                                    "tenant_id" bigint NOT NULL,
                                                    PRIMARY KEY ("id")
) COMMENT '招聘职位表';

CREATE TABLE IF NOT EXISTS "mde_enterprise" (
                                                "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                "name" varchar,
                                                "another_name" varchar,
                                                "website" varchar,
                                                "introduce" varchar,
                                                "contact" varchar,
                                                "phone" varchar,
                                                "logo_url" varchar,
                                                "industry_id" bigint,
                                                "financing_status" int,
                                                "scale" int,
                                                "welfare_list" varchar,
                                                "album_list" varchar,
                                                "work_time" varchar,
                                                "develop_history" varchar,
                                                "received_honors" varchar,
                                                "creator" varchar DEFAULT '',
                                                "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                "updater" varchar DEFAULT '',
                                                "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                "deleted" bit NOT NULL DEFAULT FALSE,
                                                "tenant_id" bigint NOT NULL,
                                                PRIMARY KEY ("id")
) COMMENT '企业信息表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_business" (
                                                         "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                         "enterprise_id" bigint,
                                                         "code" varchar,
                                                         "name" varchar,
                                                         "type" varchar,
                                                         "area" varchar,
                                                         "address" varchar,
                                                         "representative" varchar,
                                                         "establishment_time" varchar,
                                                         "registered_capital" varchar,
                                                         "approval_time" varchar,
                                                         "former_name" varchar,
                                                         "industry" varchar,
                                                         "registration_authority" varchar,
                                                         "business_status" varchar,
                                                         "business_term" varchar,
                                                         "business_scope" varchar,
                                                         "creator" varchar DEFAULT '',
                                                         "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                         "updater" varchar DEFAULT '',
                                                         "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                         "deleted" bit NOT NULL DEFAULT FALSE,
                                                         "tenant_id" bigint NOT NULL,
                                                         PRIMARY KEY ("id")
) COMMENT '企业工商信息表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_register" (
                                                         "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                         "user_id" bigint,
                                                         "name" varchar,
                                                         "phone" varchar,
                                                         "email" varchar,
                                                         "business_license_url" varchar,
                                                         "status" int NOT NULL,
                                                         "reason" varchar,
                                                         "remark" varchar,
                                                         "creator" varchar DEFAULT '',
                                                         "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                         "updater" varchar DEFAULT '',
                                                         "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                         "deleted" bit NOT NULL DEFAULT FALSE,
                                                         "tenant_id" bigint NOT NULL,
                                                         PRIMARY KEY ("id")
) COMMENT '企业注册申请表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_address" (
                                                        "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
                                                        "enterprise_id" bigint,
                                                        "address" varchar,
                                                        "longitude" varchar,
                                                        "latitude" varchar,
                                                        "creator" varchar DEFAULT '',
                                                        "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                                        "updater" varchar DEFAULT '',
                                                        "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                                                        "deleted" bit NOT NULL DEFAULT FALSE,
                                                        "tenant_id" bigint NOT NULL,
                                                        PRIMARY KEY ("id")
) COMMENT '企业地址表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_user_bind" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" varchar NOT NULL,
    "status" int NOT NULL,
    "login_ip" varchar,
    "login_date" varchar,
    "user_type" int,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业登录用户表';

-- 将该建表 SQL 语句，添加到 citu-module-menduner.system-biz 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "mde_enterprise_post" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint,
    "code" varchar,
    "name_cn" varchar NOT NULL,
    "name_en" varchar NOT NULL,
    "sort" int NOT NULL,
    "status" int NOT NULL,
    "remark" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业岗位信息表';

-- 将该建表 SQL 语句，添加到 citu-module-menduner.system-biz 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "mde_enterprise_user_look" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint,
    "user_id" bigint NOT NULL,
    "user_name" varchar,
    "user_post_name" varchar,
    "look_user_id" bigint,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT ' 企业招聘者浏览表';

CREATE TABLE IF NOT EXISTS "mde_person_enterprise_attention" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint,
    "enterprise_id" bigint,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '人才-企业关注订阅表';

CREATE TABLE IF NOT EXISTS "mde_person_browse_record" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint NOT NULL,
    "job_id" bigint NOT NULL,
    "area_id" bigint,
    "position_id" bigint,
    "enterprise_id" bigint,
    "area_name" varchar,
    "job_name" varchar,
    "type" int,
    "exp_type" int,
    "edu_type" int,
    "pay_from" varchar,
    "pay_to" varchar,
    "pay_unit" int,
    "currency_type" int,
    "tag_list" varchar NOT NULL,
    "contact_user_id" bigint,
    "contact_user_name" varchar,
    "contact_user_post_name" varchar,
    "enterprise_name" varchar,
    "industry_id" bigint,
    "financing_status" int,
    "scale" int,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '人才-浏览记录';

CREATE TABLE IF NOT EXISTS "mde_person_job_collection" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint,
    "job_id" bigint,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '人才-招聘职位收藏表';

CREATE TABLE IF NOT EXISTS "mde_train_exp" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint,
    "start_time" varchar,
    "end_time" varchar,
    "org_name" varchar,
    "course" varchar,
    "content" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
) COMMENT '培训经历表';

CREATE TABLE IF NOT EXISTS "mde_project_exp" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint,
    "name" varchar,
    "start_time" varchar,
    "end_time" varchar,
    "content" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    PRIMARY KEY ("id")
) COMMENT '项目经历表';

CREATE TABLE IF NOT EXISTS "mde_skill" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "name_cn" varchar,
    "name_en" varchar,
    "parent_id" bigint,
    "level" bit,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '职业技能表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_user_apply" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" bigint NOT NULL,
    "enterprise_id" bigint NOT NULL,
    "post_id" bigint,
    "name" varchar,
    "status" varchar NOT NULL,
    "reason" varchar,
    "remark" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业用户申请';

CREATE TABLE IF NOT EXISTS "mde_job_cv_rel" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "job_id" bigint NOT NULL,
    "publish_user_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "title" varchar NOT NULL,
    "url" varchar NOT NULL,
    "status" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '招聘职位简历投递表';

CREATE TABLE IF NOT EXISTS "mde_hire_job_cv_rel" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "job_id" bigint NOT NULL,
    "publish_user_id" bigint NOT NULL,
    "recommend_user_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "name" varchar,
    "phone" varchar,
    "url" varchar NOT NULL,
    "status" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '众聘-简历投递表';

CREATE TABLE IF NOT EXISTS "mde_hire_commission_ratio" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" varchar NOT NULL,
    "rate" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '众聘-佣金比例表';

CREATE TABLE IF NOT EXISTS "mde_user_account" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "user_id" varchar NOT NULL,
    "balance" varchar,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '用户账户表';

-- 将该建表 SQL 语句，添加到 citu-module-menduner.system-biz 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "mde_enterprise_invite" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "type" varchar NOT NULL,
    "code" varchar NOT NULL,
    "expire_day" int NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业邀请码表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_invite_record" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "invite_enterprise_id" bigint NOT NULL,
    "invite_user_id" bigint NOT NULL,
    "type" varchar NOT NULL,
    "code" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业邀请记录表';

CREATE TABLE IF NOT EXISTS "mde_interview_invite" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "invite_user_id" bigint NOT NULL,
    "job_id" bigint NOT NULL,
    "type" varchar NOT NULL,
    "time" varchar NOT NULL,
    "phone" varchar NOT NULL,
    "status" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '面试邀请表';

CREATE TABLE IF NOT EXISTS "mde_enterprise_auth" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "enterprise_id" bigint NOT NULL,
    "user_id" bigint NOT NULL,
    "name" varchar NOT NULL,
    "identity_no" int NOT NULL,
    "front_url" varchar NOT NULL,
    "back_url" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '企业实名认证';

CREATE TABLE IF NOT EXISTS "mde_tag" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "name_cn" varchar NOT NULL,
    "name_en" varchar NOT NULL,
    "type" varchar NOT NULL,
    "parent_id" bigint,
    "level" bit,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    PRIMARY KEY ("id")
) COMMENT '标签管理';

CREATE TABLE IF NOT EXISTS "mde_hunt" (
    "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    "name" varchar NOT NULL,
    "enterprise_name" varchar NOT NULL,
    "phone" varchar NOT NULL,
    "creator" varchar DEFAULT '',
    "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updater" varchar DEFAULT '',
    "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    "deleted" bit NOT NULL DEFAULT FALSE,
    "tenant_id" bigint NOT NULL,
    "status" varchar NOT NULL,
    "remark" varchar,
    PRIMARY KEY ("id")
) COMMENT '猎寻服务';