-- ============================================================
-- 湛江市智慧人社运营运维（2025-2027年）项目
-- 就业一湛通服务平台 - 岗位信息库 达梦数据库建表脚本
-- 
-- 依据：《需求规格说明书》第3.1.2.2节 - 岗位信息库 详情页面字段设计
-- 数据库：达梦数据库 (DM8)
-- 创建日期：2025-06-02
-- ============================================================

-- ============================================================
-- 表1：岗位信息表
-- 说明：存储企业的招聘岗位信息
-- ============================================================
CREATE TABLE POST_INFO
(
    ID                      VARCHAR(36)  NOT NULL,
    ENTERPRISE_ID           VARCHAR(36)  NOT NULL,
    OCCUPATION              VARCHAR(200) NOT NULL,
    POST_NAME               VARCHAR(200) NOT NULL,
    WORK_NATURE             VARCHAR(50)  NOT NULL,
    SALARY_TYPE             VARCHAR(50)  NOT NULL,
    SALARY_MIN              DECIMAL(12, 2),
    SALARY_MAX              DECIMAL(12, 2),
    RECRUIT_COUNT           INTEGER      NOT NULL,
    POST_VALID_DATE         DATE         NOT NULL,
    POST_TAG                VARCHAR(200) NOT NULL,
    OTHER_BENEFITS          VARCHAR(500),
    POST_DESC               TEXT         NOT NULL,
    EDUCATION_REQUIRE       VARCHAR(100) NOT NULL,
    WORK_EXPERIENCE_REQUIRE VARCHAR(100) NOT NULL,
    SKILL_LEVEL_REQUIRE     VARCHAR(100) NOT NULL,
    FOREIGN_LANGUAGE        VARCHAR(100),
    LANGUAGE_LEVEL          VARCHAR(50),
    CONTACT_PERSON          VARCHAR(100) NOT NULL,
    CONTACT_PHONE           VARCHAR(20)  NOT NULL,
    WORK_LOCATION           VARCHAR(200) NOT NULL,
    DETAILED_ADDRESS        VARCHAR(500) NOT NULL,
    DATA_SOURCE             VARCHAR(50)  NOT NULL,
    CREATE_BY               VARCHAR(50),
    CREATE_TIME             DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP,
    UPDATE_BY               VARCHAR(50),
    UPDATE_TIME             DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP,
    SYS_ORG_CODE            VARCHAR(50),
    PRIMARY KEY (ID)
);

COMMENT
ON TABLE POST_INFO IS '岗位信息表';
COMMENT
ON COLUMN POST_INFO.ID IS '主键ID';
COMMENT
ON COLUMN POST_INFO.ENTERPRISE_ID IS '关联企业基本信息ID';
COMMENT
ON COLUMN POST_INFO.OCCUPATION IS '职业（工种）';
COMMENT
ON COLUMN POST_INFO.POST_NAME IS '岗位名称';
COMMENT
ON COLUMN POST_INFO.WORK_NATURE IS '工作性质';
COMMENT
ON COLUMN POST_INFO.SALARY_TYPE IS '薪酬待遇';
COMMENT
ON COLUMN POST_INFO.SALARY_MIN IS '薪酬待遇';
COMMENT
ON COLUMN POST_INFO.SALARY_MAX IS '薪酬待遇';
COMMENT
ON COLUMN POST_INFO.RECRUIT_COUNT IS '招聘人数';
COMMENT
ON COLUMN POST_INFO.POST_VALID_DATE IS '岗位有效期';
COMMENT
ON COLUMN POST_INFO.POST_TAG IS '职位标签';
COMMENT
ON COLUMN POST_INFO.OTHER_BENEFITS IS '其他福利';
COMMENT
ON COLUMN POST_INFO.POST_DESC IS '岗位描述';
COMMENT
ON COLUMN POST_INFO.EDUCATION_REQUIRE IS '学历要求';
COMMENT
ON COLUMN POST_INFO.WORK_EXPERIENCE_REQUIRE IS '工作经验';
COMMENT
ON COLUMN POST_INFO.SKILL_LEVEL_REQUIRE IS '职业技能等级';
COMMENT
ON COLUMN POST_INFO.FOREIGN_LANGUAGE IS '外语语种';
COMMENT
ON COLUMN POST_INFO.LANGUAGE_LEVEL IS '外语水平要求';
COMMENT
ON COLUMN POST_INFO.CONTACT_PERSON IS '联系人';
COMMENT
ON COLUMN POST_INFO.CONTACT_PHONE IS '联系电话';
COMMENT
ON COLUMN POST_INFO.WORK_LOCATION IS '工作地点';
COMMENT
ON COLUMN POST_INFO.DETAILED_ADDRESS IS '详细地址';
COMMENT
ON COLUMN POST_INFO.DATA_SOURCE IS '数据来源';
COMMENT
ON COLUMN POST_INFO.CREATE_BY IS '创建人';
COMMENT
ON COLUMN POST_INFO.CREATE_TIME IS '创建时间';
COMMENT
ON COLUMN POST_INFO.UPDATE_BY IS '修改人';
COMMENT
ON COLUMN POST_INFO.UPDATE_TIME IS '更新时间';
COMMENT
ON COLUMN POST_INFO.SYS_ORG_CODE IS '组织机构编号';
