-- ============================================================
-- 湛江市智慧人社运营运维（2025-2027年）项目
-- 就业一湛通服务平台 - 公益性岗位管理 达梦数据库建表脚本
--
-- 说明：存储公益性岗位信息，包含用人单位信息和岗位信息
-- 数据库：达梦数据库 (DM8) / MySQL 8.0 兼容
-- 创建日期：2026-06-03
-- ============================================================

CREATE TABLE WELFARE_POST
(
    ID                      VARCHAR(36)   NOT NULL,
    ENTERPRISE_ID           VARCHAR(36)             COMMENT '关联企业ID',
    COMPANY_NAME            VARCHAR(200)            COMMENT '用人单位名称',
    POST_NAME               VARCHAR(200)            COMMENT '岗位名称',
    POST_TYPE               VARCHAR(50)             COMMENT '岗位类型',
    WORK_LOCATION           VARCHAR(200)            COMMENT '工作地点',
    DETAILED_ADDRESS        VARCHAR(500)            COMMENT '详细地址',
    RECRUIT_COUNT           INTEGER                 COMMENT '招聘人数',
    PLACED_COUNT            INTEGER    DEFAULT 0    COMMENT '已安置人数',
    SUBSIDY_STANDARD        VARCHAR(50)             COMMENT '补贴标准',
    SUBSIDY_PERIOD          VARCHAR(50)             COMMENT '补贴期限',
    SOCIAL_SECURITY_SUBSIDY VARCHAR(50)             COMMENT '社保补贴',
    POST_DESC               TEXT                    COMMENT '岗位描述',
    POST_REQUIREMENT        TEXT                    COMMENT '岗位要求',
    APPLY_METHOD            VARCHAR(50)             COMMENT '报名方式',
    APPLY_DEADLINE          DATE                    COMMENT '报名截止日期',
    PUBLISH_STATUS          VARCHAR(10)  DEFAULT '0' COMMENT '发布状态（0未发布/1已发布）',
    POST_STATUS             VARCHAR(10)  DEFAULT '招聘中' COMMENT '岗位状态（招聘中/已满/已关闭）',
    PUBLISHER               VARCHAR(50)             COMMENT '发布人',
    PUBLISH_ORG             VARCHAR(50)             COMMENT '发布机构',
    PUBLISH_TIME            DATETIME                COMMENT '发布时间',
    PRIMARY KEY (ID)
);

COMMENT ON TABLE WELFARE_POST IS '公益性岗位信息表';
COMMENT ON COLUMN WELFARE_POST.ID IS '主键ID';
COMMENT ON COLUMN WELFARE_POST.ENTERPRISE_ID IS '关联企业ID';
COMMENT ON COLUMN WELFARE_POST.COMPANY_NAME IS '用人单位名称';
COMMENT ON COLUMN WELFARE_POST.POST_NAME IS '岗位名称';
COMMENT ON COLUMN WELFARE_POST.POST_TYPE IS '岗位类型';
COMMENT ON COLUMN WELFARE_POST.WORK_LOCATION IS '工作地点';
COMMENT ON COLUMN WELFARE_POST.DETAILED_ADDRESS IS '详细地址';
COMMENT ON COLUMN WELFARE_POST.RECRUIT_COUNT IS '招聘人数';
COMMENT ON COLUMN WELFARE_POST.PLACED_COUNT IS '已安置人数';
COMMENT ON COLUMN WELFARE_POST.SUBSIDY_STANDARD IS '补贴标准';
COMMENT ON COLUMN WELFARE_POST.SUBSIDY_PERIOD IS '补贴期限';
COMMENT ON COLUMN WELFARE_POST.SOCIAL_SECURITY_SUBSIDY IS '社保补贴';
COMMENT ON COLUMN WELFARE_POST.POST_DESC IS '岗位描述';
COMMENT ON COLUMN WELFARE_POST.POST_REQUIREMENT IS '岗位要求';
COMMENT ON COLUMN WELFARE_POST.APPLY_METHOD IS '报名方式';
COMMENT ON COLUMN WELFARE_POST.APPLY_DEADLINE IS '报名截止日期';
COMMENT ON COLUMN WELFARE_POST.PUBLISH_STATUS IS '发布状态';
COMMENT ON COLUMN WELFARE_POST.POST_STATUS IS '岗位状态';
COMMENT ON COLUMN WELFARE_POST.PUBLISHER IS '发布人';
COMMENT ON COLUMN WELFARE_POST.PUBLISH_ORG IS '发布机构';
COMMENT ON COLUMN WELFARE_POST.PUBLISH_TIME IS '发布时间';
