﻿-- T_BUSI_HIDD_EVA 隐患安全生产评价
CREATE TABLE t_busi_hidd_eva (
    guid            VARCHAR(32)   PRIMARY KEY,
    org_guid        VARCHAR(32)   NOT NULL,
    create_time     TIMESTAMP     DEFAULT CURRENT_TIMESTAMP,
    start_date      VARCHAR(20),
    end_date        VARCHAR(20),
    org_num         INTEGER       DEFAULT 0,
    eng_num         INTEGER       DEFAULT 0,
    oeng_org        INTEGER       DEFAULT 0,
    hidd_org        INTEGER       DEFAULT 0,
    hidd_eng        INTEGER       DEFAULT 0,
    mon_org         INTEGER       DEFAULT 0,
    pcl             NUMERIC(8,2)  DEFAULT 0,
    lbl             NUMERIC(8,2)  DEFAULT 0,
    ybl             NUMERIC(8,2)  DEFAULT 0,
    hidd_num        INTEGER       DEFAULT 0,
    yb_hidd         INTEGER       DEFAULT 0,
    zd_hidd         INTEGER       DEFAULT 0,
    zg_yb_hidd      INTEGER       DEFAULT 0,
    zg_zd_hidd      INTEGER       DEFAULT 0,
    yb_zgl          NUMERIC(8,2)  DEFAULT 0,
    zd_zgl          NUMERIC(8,2)  DEFAULT 0,
    hidd_zgl        NUMERIC(8,2)  DEFAULT 0,
    zg_fx           NUMERIC(8,2)  DEFAULT 0,
    mon_fx          NUMERIC(8,2)  DEFAULT 0,
    pcfx            NUMERIC(8,2)  DEFAULT 0,
    yh_fx           NUMERIC(8,2)  DEFAULT 0,
    his_hidd        INTEGER       DEFAULT 0,
    his_yb          INTEGER       DEFAULT 0,
    his_zd          INTEGER       DEFAULT 0,
    his_zg_yb       INTEGER       DEFAULT 0,
    his_zg_zd       INTEGER       DEFAULT 0,
    his_zg_hidd     INTEGER       DEFAULT 0,
    ohidd_org       INTEGER       DEFAULT 0,
    date_type       VARCHAR(1)
);

COMMENT ON TABLE  t_busi_hidd_eva           IS '隐患安全生产评价';
COMMENT ON COLUMN t_busi_hidd_eva.guid      IS '主键';
COMMENT ON COLUMN t_busi_hidd_eva.org_guid  IS '所属机构';
COMMENT ON COLUMN t_busi_hidd_eva.create_time IS '生成时间';
COMMENT ON COLUMN t_busi_hidd_eva.start_date IS '评价开始日期';
COMMENT ON COLUMN t_busi_hidd_eva.end_date  IS '评价结束日期';
COMMENT ON COLUMN t_busi_hidd_eva.org_num   IS '单位数量';
COMMENT ON COLUMN t_busi_hidd_eva.eng_num   IS '工程数量';
COMMENT ON COLUMN t_busi_hidd_eva.pcl       IS '排查率';
COMMENT ON COLUMN t_busi_hidd_eva.lbl       IS '漏保率';
COMMENT ON COLUMN t_busi_hidd_eva.hidd_num  IS '隐患总数';
COMMENT ON COLUMN t_busi_hidd_eva.yb_hidd   IS '一般隐患';
COMMENT ON COLUMN t_busi_hidd_eva.zd_hidd   IS '重大隐患';
COMMENT ON COLUMN t_busi_hidd_eva.zg_yb_hidd IS '已整改一般隐患';
COMMENT ON COLUMN t_busi_hidd_eva.zg_zd_hidd IS '已整改重大隐患';
COMMENT ON COLUMN t_busi_hidd_eva.hidd_zgl  IS '综合整改率';
COMMENT ON COLUMN t_busi_hidd_eva.date_type IS '时间类型';

CREATE INDEX idx_busi_hidd_eva_org ON t_busi_hidd_eva(org_guid);
