-- ============================================================
-- 六项机制(ROHS) 新表 DDL — 目标 schema: slaj
-- 生成时间: 2026-07-10
-- 共 73 张表
-- 本次迁移将 ROHS 独有业务表建到安监 slaj schema 中，
-- 供两个系统共享使用。
--
-- 执行方式: psql -h 39.98.38.2 -p 5866 -U highgo -d highgo -f this_file.sql
-- 执行前请先备份: pg_dump -h 39.98.38.2 -p 5866 -U highgo -d highgo -n slaj --schema-only > slaj_backup.sql
-- ============================================================

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_APP_BASE  →  新表: slaj.att_app_base
-- 列数: 21
-- ============================================================

CREATE TABLE slaj.att_app_base
   (	"guid" CHAR(32),
	"app_guid" CHAR(32),
	"app_code" VARCHAR(32),
	"app_name" VARCHAR(100),
	"domain_guid" CHAR(32),
	"org_admin" VARCHAR(40),
	"developer" VARCHAR(20),
	"develop_date" TIMESTAMP,
	"develop_plat" VARCHAR(40),
	"en_date" TIMESTAMP,
	"appr_adress" VARCHAR(200),
	"port" VARCHAR(50),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048),
	"ver_mark" DECIMAL(38,0),
	"node_code" VARCHAR(20),
	"db_ver" VARCHAR(50),
	"db_url" VARCHAR(200),
	"org_min_level" CHAR(2),
	"special_app" CHAR(1)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_JOB_BASE  →  新表: slaj.att_job_base
-- 列数: 12
-- ============================================================

CREATE TABLE slaj.att_job_base
   (	"guid" CHAR(32),
	"job_guid" CHAR(32),
	"job_code" VARCHAR(20),
	"job_name" VARCHAR(100),
	"job_level" CHAR(2),
	"job_resp" VARCHAR(512),
	"org_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_ORG_BASE20250113  →  新表: slaj.att_org_base20250113
-- 列数: 17
-- ============================================================

CREATE TABLE slaj.att_org_base20250113
   (	"guid" CHAR(32),
	"pguid" CHAR(32),
	"org_code" VARCHAR(32),
	"org_name" VARCHAR(512),
	"org_level" CHAR(2),
	"org_grad" VARCHAR(512),
	"org_type" CHAR(1),
	"ordernum" DECIMAL(38,0),
	"ad_code" VARCHAR(100),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048),
	"jurd" VARCHAR(17),
	"area_type" CHAR(1),
	"node_code" VARCHAR(20)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_ORG_DEP  →  新表: slaj.att_org_dep
-- 列数: 13
-- ============================================================

CREATE TABLE slaj.att_org_dep
   (	"guid" CHAR(32),
	"dep_name" VARCHAR(40),
	"org_guid" CHAR(32),
	"leg_pers" VARCHAR(20),
	"leg_pers_tel" VARCHAR(22),
	"safe_mana_pers" VARCHAR(20),
	"safe_mana_pers_tel" VARCHAR(22),
	"if_resp_spm" CHAR(1),
	"if_resp_aed" CHAR(1),
	"if_resp_fsm" CHAR(1),
	"note" VARCHAR(256),
	"ts" TIMESTAMP,
	"rec_pers" VARCHAR(32)
   ) ;

COMMENT ON COLUMN slaj.att_org_dep."guid" IS 'GUID';
COMMENT ON COLUMN slaj.att_org_dep."dep_name" IS '部门名称';
COMMENT ON COLUMN slaj.att_org_dep."org_guid" IS '所属机构GUID';
COMMENT ON COLUMN slaj.att_org_dep."leg_pers" IS '部门负责人';
COMMENT ON COLUMN slaj.att_org_dep."leg_pers_tel" IS '负责人电话';
COMMENT ON COLUMN slaj.att_org_dep."safe_mana_pers" IS '安全管理人员姓名';
COMMENT ON COLUMN slaj.att_org_dep."safe_mana_pers_tel" IS '安全管理人员电话';
COMMENT ON COLUMN slaj.att_org_dep."if_resp_spm" IS '是否负责安全生产管理';
COMMENT ON COLUMN slaj.att_org_dep."if_resp_aed" IS '是否负责事故应急处置';
COMMENT ON COLUMN slaj.att_org_dep."if_resp_fsm" IS '是否负责消防安全管理';
COMMENT ON COLUMN slaj.att_org_dep."note" IS '备注';
COMMENT ON COLUMN slaj.att_org_dep."ts" IS '时间戳';
COMMENT ON COLUMN slaj.att_org_dep."rec_pers" IS '记录人员';

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_PERSON_EXT  →  新表: slaj.att_person_ext
-- 列数: 23
-- ============================================================

CREATE TABLE slaj.att_person_ext
   (	"guid" CHAR(32),
	"pers_name" VARCHAR(60),
	"pers_code" CHAR(18),
	"org_guid" CHAR(32),
	"pers_type" CHAR(2),
	"sex" CHAR(1),
	"telnumb" VARCHAR(22),
	"faxnumb" VARCHAR(22),
	"mobilenumb" VARCHAR(11),
	"email" VARCHAR(60),
	"born_plac" VARCHAR(100),
	"born_date" TIMESTAMP,
	"nation" CHAR(2),
	"adm_duty" VARCHAR(3),
	"title" VARCHAR(40),
	"school" VARCHAR(100),
	"major" VARCHAR(100),
	"high_degr" VARCHAR(10),
	"wdatetime" TIMESTAMP,
	"status" CHAR(1),
	"note" VARCHAR(256),
	"ts" TIMESTAMP,
	"rec_pers" VARCHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_ROLE_BASE  →  新表: slaj.att_role_base
-- 列数: 13
-- ============================================================

CREATE TABLE slaj.att_role_base
   (	"guid" CHAR(32),
	"role_guid" CHAR(32),
	"role_code" VARCHAR(32),
	"role_name" VARCHAR(100),
	"role_desc" VARCHAR(512),
	"role_type" CHAR(2),
	"app_guid" CHAR(32),
	"org_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.ATT_USER_EXT  →  新表: slaj.att_user_ext
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.att_user_ext
   (	"guid" CHAR(32),
	"user_name" VARCHAR(100),
	"password" VARCHAR(256),
	"user_type" CHAR(2),
	"pers_id" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"ts" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.BDMS_ATT_ENG_PUST  →  新表: slaj.bdms_att_eng_pust
-- 列数: 33
-- ============================================================

CREATE TABLE slaj.bdms_att_eng_pust
   (	"guid" CHAR(32),
	"p_guid" CHAR(32),
	"eng_name" VARCHAR(100),
	"eng_guid" CHAR(32),
	"impo_grad" CHAR(1),
	"appr_budg" DECIMAL(12,4),
	"start_date" TIMESTAMP,
	"comp_date" TIMESTAMP,
	"eng_stat" CHAR(1),
	"org_guid" CHAR(32),
	"oflp_code" CHAR(32),
	"if_rein_force" CHAR(1),
	"proj_guid" CHAR(32),
	"stat" CHAR(1),
	"pust_code" VARCHAR(20),
	"cen_long" DECIMAL(11,8),
	"cen_lat" DECIMAL(10,8),
	"pust_loc" VARCHAR(256),
	"rv_guid" CHAR(32),
	"lk_guid" CHAR(32),
	"ad_guid" CHAR(32),
	"pust_type" CHAR(1),
	"des_head" DECIMAL(8,2),
	"ins_flow" DECIMAL(15,4),
	"des_flow" DECIMAL(15,4),
	"pust_num" DECIMAL(2,0),
	"ins_pow" DECIMAL(8,3),
	"eng_grad" CHAR(1),
	"eng_scal" CHAR(1),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.BIS_HIDD_REC_REP20250113  →  新表: slaj.bis_hidd_rec_rep20250113
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.bis_hidd_rec_rep20250113
   (	"guid" CHAR(32),
	"hidd_guid" CHAR(32),
	"rep_org_guid" CHAR(32),
	"rep_act" CHAR(1),
	"return_desc" VARCHAR(1000),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32),
	"rep_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.HARD_TOTAL  →  新表: slaj.hard_total
-- 列数: 31
-- ============================================================

CREATE TABLE slaj.hard_total
   (	"root_guid" VARCHAR(100),
	"org_guid" VARCHAR(100),
	"guid" VARCHAR(100),
	"create_time" TIMESTAMP,
	"org_name" VARCHAR(500),
	"hard_risk_level" VARCHAR(100),
	"identified_total" VARCHAR(100),
	"cotrol_total" VARCHAR(100),
	"control_rate" VARCHAR(100),
	"zd_hard" VARCHAR(100),
	"yb_hard" VARCHAR(100),
	"zd_cotrol" VARCHAR(100),
	"yb_cotrol" VARCHAR(100),
	"zd_rate" VARCHAR(100),
	"yb_rate" VARCHAR(100),
	"hard_indef" VARCHAR(50),
	"zd_indef_rate" VARCHAR(50),
	"yb_indef_rate" VARCHAR(50),
	"anser_indef" VARCHAR(50),
	"zd_anser_indef" VARCHAR(50),
	"yb_anser_indef" VARCHAR(50),
	"alread_indef" VARCHAR(50),
	"zd_alred_indef" VARCHAR(50),
	"yb_alred_indef" VARCHAR(50),
	"project_total" VARCHAR(50),
	"lbl" VARCHAR(50),
	"indef_xs" VARCHAR(100),
	"cotrol_xs" VARCHAR(100),
	"update_time" TIMESTAMP,
	"start_time" VARCHAR(100),
	"end_time" VARCHAR(100)
   ) ;

COMMENT ON COLUMN slaj.hard_total."org_guid" IS '关联机构';
COMMENT ON COLUMN slaj.hard_total."guid" IS '主键';
COMMENT ON COLUMN slaj.hard_total."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.hard_total."org_name" IS '机构名称';

-- ============================================================
-- 原表: SLAJ_ROHS.HIDD_STATISTICS  →  新表: slaj.hidd_statistics
-- 列数: 38
-- ============================================================

CREATE TABLE slaj.hidd_statistics
   (	"guid" VARCHAR(100),
	"org_guid" VARCHAR(100),
	"org_name" VARCHAR(150),
	"y_yb_over" VARCHAR(100),
	"v_zd_over" VARCHAR(100),
	"w_zd_total" VARCHAR(100),
	"z_yb_total" VARCHAR(100),
	"s_org_total" VARCHAR(100),
	"t_org_total1" VARCHAR(100),
	"sa_org_total1" VARCHAR(100),
	"e_pro_total" VARCHAR(100),
	"sc_pro_total" VARCHAR(100),
	"sb_hidd_total" VARCHAR(100),
	"create_time" TIMESTAMP,
	"ta_hidd_rate" DECIMAL,
	"u_hidd_rate" DECIMAL,
	"x_zd_rate" DECIMAL,
	"start_time" VARCHAR(100),
	"end_time" VARCHAR(100),
	"pcl" DECIMAL,
	"lbv" DECIMAL,
	"ybl" DECIMAL,
	"yhzs" DECIMAL,
	"ybzgl" DECIMAL,
	"zdzgl" DECIMAL,
	"zhzgl" DECIMAL,
	"zgfx" DECIMAL,
	"ybfx" DECIMAL,
	"pcfx" DECIMAL,
	"yhfx" DECIMAL,
	"ls_ybyzgln" DECIMAL,
	"ls_zdyzgln" DECIMAL,
	"is_ybzgln" DECIMAL,
	"is_zdzgln" DECIMAL,
	"yhzsln" DECIMAL,
	"fgcjd" DECIMAL,
	"ggxybdws" DECIMAL,
	"ggcdws" DECIMAL
   ) ;

COMMENT ON COLUMN slaj.hidd_statistics."guid" IS '主键';
COMMENT ON COLUMN slaj.hidd_statistics."org_guid" IS '关联机构';
COMMENT ON COLUMN slaj.hidd_statistics."org_name" IS '机构名称';
COMMENT ON COLUMN slaj.hidd_statistics."y_yb_over" IS '已整改一般隐患数';
COMMENT ON COLUMN slaj.hidd_statistics."v_zd_over" IS '已整改重大隐患数';
COMMENT ON COLUMN slaj.hidd_statistics."w_zd_total" IS '重大隐患数';
COMMENT ON COLUMN slaj.hidd_statistics."z_yb_total" IS '一般隐患数';
COMMENT ON COLUMN slaj.hidd_statistics."s_org_total" IS '单位总数';
COMMENT ON COLUMN slaj.hidd_statistics."t_org_total1" IS '上报月报单位数';
COMMENT ON COLUMN slaj.hidd_statistics."sa_org_total1" IS '无工程单位数';
COMMENT ON COLUMN slaj.hidd_statistics."e_pro_total" IS '工程总数';
COMMENT ON COLUMN slaj.hidd_statistics."sc_pro_total" IS '非0隐患工程数';
COMMENT ON COLUMN slaj.hidd_statistics."sb_hidd_total" IS '非0隐患单位数';
COMMENT ON COLUMN slaj.hidd_statistics."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.hidd_statistics."ta_hidd_rate" IS '按月非0隐患占比';
COMMENT ON COLUMN slaj.hidd_statistics."u_hidd_rate" IS '陷患月报上报率';
COMMENT ON COLUMN slaj.hidd_statistics."x_zd_rate" IS '重大隐患整改率';
COMMENT ON COLUMN slaj.hidd_statistics."start_time" IS '查询时间';
COMMENT ON COLUMN slaj.hidd_statistics."end_time" IS '查询结束时间';
COMMENT ON COLUMN slaj.hidd_statistics."pcl" IS '排查率';
COMMENT ON COLUMN slaj.hidd_statistics."lbv" IS '漏保率';
COMMENT ON COLUMN slaj.hidd_statistics."ybl" IS '月报率';
COMMENT ON COLUMN slaj.hidd_statistics."yhzs" IS '隐患总数';
COMMENT ON COLUMN slaj.hidd_statistics."ybzgl" IS '一般整改率';
COMMENT ON COLUMN slaj.hidd_statistics."zdzgl" IS '重大整改率';
COMMENT ON COLUMN slaj.hidd_statistics."zhzgl" IS '综合整改率';
COMMENT ON COLUMN slaj.hidd_statistics."zgfx" IS '整改风险';
COMMENT ON COLUMN slaj.hidd_statistics."ybfx" IS '月报风险';
COMMENT ON COLUMN slaj.hidd_statistics."pcfx" IS '排查风险';
COMMENT ON COLUMN slaj.hidd_statistics."yhfx" IS '隐患风险';
COMMENT ON COLUMN slaj.hidd_statistics."ls_ybyzgln" IS '历史一般隐患已整改';
COMMENT ON COLUMN slaj.hidd_statistics."ls_zdyzgln" IS '历史重大隐患已整改';
COMMENT ON COLUMN slaj.hidd_statistics."is_ybzgln" IS '历史一般隐患';
COMMENT ON COLUMN slaj.hidd_statistics."is_zdzgln" IS '历史重大隐患';
COMMENT ON COLUMN slaj.hidd_statistics."yhzsln" IS '历史隐患';

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_AD  →  新表: slaj.obj_ad
-- 表说明: 行政区划名录表
-- 列数: 5
-- ============================================================

CREATE TABLE slaj.obj_ad
   (	"guid" CHAR(32) ,
	"ad_code" CHAR(12),
	"ad_name" VARCHAR(100),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.obj_ad IS '行政区划名录表';
COMMENT ON COLUMN slaj.obj_ad."guid" IS '主键';
COMMENT ON COLUMN slaj.obj_ad."ad_code" IS '行政区划代码';
COMMENT ON COLUMN slaj.obj_ad."ad_name" IS '行政区划名称';
COMMENT ON COLUMN slaj.obj_ad."from_date" IS '对象建立时间';
COMMENT ON COLUMN slaj.obj_ad."str_to_date" IS '对象终止时间';

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_BAAD  →  新表: slaj.obj_baad
-- 列数: 5
-- ============================================================

CREATE TABLE slaj.obj_baad
   (	"guid" CHAR(32),
	"baad_code" CHAR(6),
	"baad_name" VARCHAR(100),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_HAZARD20250113  →  新表: slaj.obj_hazard20250113
-- 列数: 16
-- ============================================================

CREATE TABLE slaj.obj_hazard20250113
   (	"guid" CHAR(32),
	"haz_name" VARCHAR(300),
	"guide_guid" CHAR(32),
	"part_guid" CHAR(32),
	"org_guid" CHAR(32),
	"veri_status" CHAR(1),
	"veri_per" CHAR(32),
	"veri_time" TIMESTAMP,
	"create_per" CHAR(32),
	"create_time" TIMESTAMP,
	"update_per" CHAR(32),
	"update_time" TIMESTAMP,
	"pguid" CHAR(32),
	"change_status" CHAR(1),
	"type" CHAR(1),
	"eng_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_HAZARDBAK  →  新表: slaj.obj_hazardbak
-- 列数: 16
-- ============================================================

CREATE TABLE slaj.obj_hazardbak
   (	"guid" CHAR(32),
	"haz_name" VARCHAR(300),
	"guide_guid" CHAR(32),
	"part_guid" CHAR(32),
	"org_guid" CHAR(32),
	"veri_status" CHAR(1),
	"veri_per" CHAR(32),
	"veri_time" TIMESTAMP,
	"create_per" CHAR(32),
	"create_time" TIMESTAMP,
	"update_per" CHAR(32),
	"update_time" TIMESTAMP,
	"pguid" CHAR(32),
	"change_status" CHAR(1),
	"type" CHAR(1),
	"eng_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_HIDD20250113  →  新表: slaj.obj_hidd20250113
-- 列数: 32
-- ============================================================

CREATE TABLE slaj.obj_hidd20250113
   (	"guid" CHAR(32),
	"hidd_name" VARCHAR(300),
	"eng_guid" CHAR(32),
	"tend_guid" CHAR(32),
	"se_guid" CHAR(32),
	"org_guid" CHAR(32),
	"hidd_sour" CHAR(1),
	"hidd_grad" CHAR(1),
	"hidd_clas" CHAR(2),
	"if_found" CHAR(1),
	"pro_part" VARCHAR(1024),
	"part_long" DECIMAL(11,8),
	"part_lat" DECIMAL(10,8),
	"otlcol_qiff_fnvu" VARCHAR(2048),
	"insp_rec_guid" CHAR(32),
	"se_check_item_guid" CHAR(32),
	"hidd_stat" CHAR(1),
	"hidd_merg_guid" CHAR(32),
	"rec_org_guid" CHAR(32),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32),
	"hidds_guid" CHAR(32),
	"occu_num" DECIMAL(5,0),
	"sins_sche_guid" CHAR(32),
	"group_guid" CHAR(32),
	"temp" VARCHAR(20),
	"str_to_date" TIMESTAMP,
	"dict_guid" CHAR(32),
	"haz_guid" CHAR(32),
	"hidd_sort" CHAR(1)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_HIDDD  →  新表: slaj.obj_hiddd
-- 列数: 33
-- ============================================================

CREATE TABLE slaj.obj_hiddd
   (	"guid" CHAR(32),
	"hidd_name" VARCHAR(300),
	"eng_guid" CHAR(32),
	"tend_guid" CHAR(32),
	"se_guid" CHAR(32),
	"org_guid" CHAR(32),
	"hidd_sour" CHAR(1),
	"hidd_grad" CHAR(1),
	"hidd_clas" CHAR(2),
	"if_found" CHAR(1),
	"pro_part" VARCHAR(1024),
	"part_long" DECIMAL(11,8),
	"part_lat" DECIMAL(10,8),
	"otlcol_qiff_fnvu" VARCHAR(2048),
	"insp_rec_guid" CHAR(32),
	"se_check_item_guid" CHAR(32),
	"hidd_stat" CHAR(1),
	"hidd_merg_guid" CHAR(32),
	"rec_org_guid" CHAR(32),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32),
	"hidds_guid" CHAR(32),
	"occu_num" DECIMAL(5,0),
	"sins_sche_guid" CHAR(32),
	"group_guid" CHAR(32),
	"temp" VARCHAR(20),
	"str_to_date" TIMESTAMP,
	"dict_guid" CHAR(32),
	"haz_guid" CHAR(32),
	"hidd_sort" CHAR(1),
	"sign_data" VARCHAR(100)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_ORG_ZCPT  →  新表: slaj.obj_org_zcpt
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.obj_org_zcpt
   (	"guid" VARCHAR(32),
	"id" VARCHAR(32),
	"value_t" VARCHAR(32),
	"name" VARCHAR(255),
	"p_id" VARCHAR(32),
	"is_leaf" DECIMAL(1,0),
	"is_parent" DECIMAL(1,0),
	"bak_data" VARCHAR(2000),
	"open_flag" DECIMAL(1,0)
   ) ;

COMMENT ON COLUMN slaj.obj_org_zcpt."guid" IS 'guid';
COMMENT ON COLUMN slaj.obj_org_zcpt."id" IS 'id';
COMMENT ON COLUMN slaj.obj_org_zcpt."value_t" IS '值';
COMMENT ON COLUMN slaj.obj_org_zcpt."name" IS '名称';
COMMENT ON COLUMN slaj.obj_org_zcpt."p_id" IS '父节点';
COMMENT ON COLUMN slaj.obj_org_zcpt."is_leaf" IS '是否为叶子节点';
COMMENT ON COLUMN slaj.obj_org_zcpt."is_parent" IS '是否为父节点';
COMMENT ON COLUMN slaj.obj_org_zcpt."bak_data" IS '备注数据';
COMMENT ON COLUMN slaj.obj_org_zcpt."open_flag" IS '是否开启标记';

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_ROLE  →  新表: slaj.obj_role
-- 列数: 6
-- ============================================================

CREATE TABLE slaj.obj_role
   (	"guid" CHAR(32),
	"role_code" VARCHAR(32),
	"role_name" VARCHAR(100),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.OBJ_TEND20250113  →  新表: slaj.obj_tend20250113
-- 列数: 15
-- ============================================================

CREATE TABLE slaj.obj_tend20250113
   (	"guid" CHAR(32),
	"tend_name" VARCHAR(256),
	"org_guid" CHAR(32),
	"org_proj_dept_guid" CHAR(32),
	"eng_guid" CHAR(32),
	"leg_pers" VARCHAR(20),
	"leg_tel" VARCHAR(22),
	"con_amout" DECIMAL(12,4),
	"total_spc" DECIMAL(12,4),
	"cons_cont" VARCHAR(2048),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32),
	"str_to_date" TIMESTAMP
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.PPRTY_NOTICE_INFO  →  新表: slaj.pprty_notice_info
-- 列数: 12
-- ============================================================

CREATE TABLE slaj.pprty_notice_info
   (	"guid" CHAR(32),
	"notice_code" VARCHAR(32),
	"notice_title" VARCHAR(256),
	"app_code" VARCHAR(32),
	"user_guid" VARCHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"isread" CHAR(1),
	"mtime" TIMESTAMP,
	"notice_content" VARCHAR(4000),
	"role_code" VARCHAR(32),
	"org_guid" VARCHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_DRILL_EVA  →  新表: slaj.rel_drill_eva
-- 表说明: 演练评估与预案关系表
-- 列数: 11
-- ============================================================

CREATE TABLE slaj.rel_drill_eva
   (	"rde_guid" CHAR(32),
	"dr_guid" CHAR(32),
	"basic_id" CHAR(32),
	"rdb_status" VARCHAR(20),
	"rdb_node" VARCHAR(2000),
	"flag" CHAR(2),
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.rel_drill_eva IS '演练评估与预案关系表';
COMMENT ON COLUMN slaj.rel_drill_eva."rde_guid" IS '数据id';
COMMENT ON COLUMN slaj.rel_drill_eva."dr_guid" IS '演练记录id';
COMMENT ON COLUMN slaj.rel_drill_eva."basic_id" IS '预案id';
COMMENT ON COLUMN slaj.rel_drill_eva."rdb_status" IS '预案评估结果';
COMMENT ON COLUMN slaj.rel_drill_eva."rdb_node" IS '预案评估结论';
COMMENT ON COLUMN slaj.rel_drill_eva."flag" IS '标志位';
COMMENT ON COLUMN slaj.rel_drill_eva."org_guid" IS '机构guid';
COMMENT ON COLUMN slaj.rel_drill_eva."creper_guid" IS '创建人guid';
COMMENT ON COLUMN slaj.rel_drill_eva."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.rel_drill_eva."updper_guid" IS '更新人guid';
COMMENT ON COLUMN slaj.rel_drill_eva."update_time" IS '更新时间';

-- ============================================================
-- 原表: SLAJ_ROHS.REL_DRILL_SC  →  新表: slaj.rel_drill_sc
-- 表说明: 演练抽查结果表
-- 列数: 17
-- ============================================================

CREATE TABLE slaj.rel_drill_sc
   (	"cc_guid" CHAR(32),
	"spot_check" CHAR(1),
	"sc_explain" VARCHAR(200),
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"sc_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"basic_id" VARCHAR(500),
	"cor_type" CHAR(1),
	"cor_time" TIMESTAMP,
	"cor_explain" VARCHAR(200),
	"dr_guid" CHAR(32),
	"spot_check2" CHAR(1),
	"sc_explain2" VARCHAR(200),
	"sc_time2" TIMESTAMP,
	"create_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.rel_drill_sc IS '演练抽查结果表';
COMMENT ON COLUMN slaj.rel_drill_sc."cc_guid" IS '数据id';
COMMENT ON COLUMN slaj.rel_drill_sc."spot_check" IS '抽查结果枚举';
COMMENT ON COLUMN slaj.rel_drill_sc."sc_explain" IS '抽查结果说明';
COMMENT ON COLUMN slaj.rel_drill_sc."org_guid" IS '抽查机构guid';
COMMENT ON COLUMN slaj.rel_drill_sc."creper_guid" IS '抽查人guid';
COMMENT ON COLUMN slaj.rel_drill_sc."sc_time" IS '抽查时间';
COMMENT ON COLUMN slaj.rel_drill_sc."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.rel_drill_sc."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.rel_drill_sc."basic_id" IS '预案guid';
COMMENT ON COLUMN slaj.rel_drill_sc."cor_type" IS '整改方式';
COMMENT ON COLUMN slaj.rel_drill_sc."cor_time" IS '整改时间';
COMMENT ON COLUMN slaj.rel_drill_sc."cor_explain" IS '整改说明';
COMMENT ON COLUMN slaj.rel_drill_sc."dr_guid" IS '演练记录guid';
COMMENT ON COLUMN slaj.rel_drill_sc."spot_check2" IS '复查结果';
COMMENT ON COLUMN slaj.rel_drill_sc."sc_explain2" IS '复查说明';
COMMENT ON COLUMN slaj.rel_drill_sc."sc_time2" IS '复查时间';
COMMENT ON COLUMN slaj.rel_drill_sc."create_time" IS '创建时间';

-- ============================================================
-- 原表: SLAJ_ROHS.REL_INSURE_TEND  →  新表: slaj.rel_insure_tend
-- 表说明: 保险和标段关系表
-- 列数: 5
-- ============================================================

CREATE TABLE slaj.rel_insure_tend
   (	"insure_guid" CHAR(32),
	"tend_guid" CHAR(32),
	"guid" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.rel_insure_tend IS '保险和标段关系表';
COMMENT ON COLUMN slaj.rel_insure_tend."insure_guid" IS '保险id';
COMMENT ON COLUMN slaj.rel_insure_tend."tend_guid" IS '标段id';
COMMENT ON COLUMN slaj.rel_insure_tend."guid" IS '主键';
COMMENT ON COLUMN slaj.rel_insure_tend."from_date" IS '属性建立时间';
COMMENT ON COLUMN slaj.rel_insure_tend."str_to_date" IS '属性终止时间';

-- ============================================================
-- 原表: SLAJ_ROHS.REL_INSURE_TEND20250113  →  新表: slaj.rel_insure_tend20250113
-- 列数: 5
-- ============================================================

CREATE TABLE slaj.rel_insure_tend20250113
   (	"insure_guid" CHAR(32),
	"tend_guid" CHAR(32),
	"guid" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_JOB_ROLE  →  新表: slaj.rel_job_role
-- 列数: 8
-- ============================================================

CREATE TABLE slaj.rel_job_role
   (	"guid" CHAR(32),
	"job_guid" CHAR(32),
	"role_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_ORG_ZCPT  →  新表: slaj.rel_org_zcpt
-- 表说明: 机构与支撑平台关系
-- 列数: 5
-- ============================================================

CREATE TABLE slaj.rel_org_zcpt
   (	"guid" CHAR(32),
	"pguid" CHAR(32),
	"org_name" VARCHAR(100),
	"zcpt_name" VARCHAR(100),
	"zcpt_uuid" CHAR(32)
   ) ;

COMMENT ON TABLE slaj.rel_org_zcpt IS '机构与支撑平台关系';
COMMENT ON COLUMN slaj.rel_org_zcpt."guid" IS '机构id';
COMMENT ON COLUMN slaj.rel_org_zcpt."pguid" IS '机构上级';
COMMENT ON COLUMN slaj.rel_org_zcpt."org_name" IS '机构名称';
COMMENT ON COLUMN slaj.rel_org_zcpt."zcpt_name" IS '支撑平台名称';
COMMENT ON COLUMN slaj.rel_org_zcpt."zcpt_uuid" IS '支撑平台uuid';

-- ============================================================
-- 原表: SLAJ_ROHS.REL_PERS_ZCPT  →  新表: slaj.rel_pers_zcpt
-- 表说明: 机构与支撑平台关系
-- 列数: 4
-- ============================================================

CREATE TABLE slaj.rel_pers_zcpt
   (	"guid" CHAR(32),
	"pers_name" VARCHAR(100),
	"zcpt_uuid" CHAR(32),
	"real_name" VARCHAR(100)
   ) ;

COMMENT ON TABLE slaj.rel_pers_zcpt IS '机构与支撑平台关系';
COMMENT ON COLUMN slaj.rel_pers_zcpt."guid" IS '机构id';
COMMENT ON COLUMN slaj.rel_pers_zcpt."pers_name" IS '人员名称';
COMMENT ON COLUMN slaj.rel_pers_zcpt."zcpt_uuid" IS '支撑平台人员uuid';
COMMENT ON COLUMN slaj.rel_pers_zcpt."real_name" IS '支撑平台人员名称';

-- ============================================================
-- 原表: SLAJ_ROHS.REL_SYS_PERS  →  新表: slaj.rel_sys_pers
-- 列数: 2
-- ============================================================

CREATE TABLE slaj.rel_sys_pers
   (	"id" CHAR(32),
	"pers_name" VARCHAR(20)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_USER_APP  →  新表: slaj.rel_user_app
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.rel_user_app
   (	"guid" CHAR(32),
	"user_guid" CHAR(32),
	"app_guid" CHAR(32),
	"is_admin" CHAR(1),
	"status" CHAR(1),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048),
	"modifier" CHAR(32),
	"org_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_USER_APPOINT  →  新表: slaj.rel_user_appoint
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.rel_user_appoint
   (	"guid" CHAR(32),
	"user_guid" CHAR(32),
	"org_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048),
	"role_code" VARCHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_USER_JOB  →  新表: slaj.rel_user_job
-- 列数: 8
-- ============================================================

CREATE TABLE slaj.rel_user_job
   (	"guid" CHAR(32),
	"user_guid" CHAR(32),
	"job_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_USER_ROLE  →  新表: slaj.rel_user_role
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.rel_user_role
   (	"guid" CHAR(32),
	"user_guid" CHAR(32),
	"role_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"from_date" TIMESTAMP,
	"str_to_date" TIMESTAMP,
	"note" VARCHAR(2048),
	"org_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.REL_USER_ROLE_EXT  →  新表: slaj.rel_user_role_ext
-- 列数: 8
-- ============================================================

CREATE TABLE slaj.rel_user_role_ext
   (	"guid" CHAR(32),
	"user_guid" CHAR(32),
	"role_guid" CHAR(32),
	"status" CHAR(1),
	"modifier" CHAR(32),
	"ts" TIMESTAMP,
	"remark" VARCHAR(2048),
	"org_guid" CHAR(32)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_ACCI_EVALUATE  →  新表: slaj.t_busi_acci_evaluate
-- 表说明: 事故风险评价
-- 列数: 18
-- ============================================================

CREATE TABLE slaj.t_busi_acci_evaluate
   (	"guid" CHAR(32),
	"acci_guid" CHAR(32),
	"org_guid" CHAR(32),
	"risk_grad" VARCHAR(50),
	"standard" VARCHAR(50),
	"result" VARCHAR(50),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"l" DECIMAL,
	"e" DECIMAL,
	"c" DECIMAL,
	"d" DECIMAL,
	"role" VARCHAR(50),
	"name" VARCHAR(50),
	"h" DECIMAL,
	"s" DECIMAL
   ) ;

COMMENT ON TABLE slaj.t_busi_acci_evaluate IS '事故风险评价';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."acci_guid" IS '事故主键';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."org_guid" IS '所属机构';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."risk_grad" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."standard" IS '1、固定（从检测监控措施带来的）、2、浮动（可新增、删除）';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."result" IS '评定结果';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."creper_guid" IS '创建人主键';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."create_time" IS '创建人时间';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."updper_guid" IS '修改人主键';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."l" IS 'L值';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."e" IS 'E值';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."c" IS 'C值';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."d" IS 'D值';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."role" IS '所属角色';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."name" IS '姓名';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."h" IS 'H值';
COMMENT ON COLUMN slaj.t_busi_acci_evaluate."s" IS 'S值';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_ACCOUNT_RECORD  →  新表: slaj.t_busi_account_record
-- 表说明: 责任追究记录
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.t_busi_account_record
   (	"guid" VARCHAR(32),
	"pun_unit" VARCHAR(100),
	"penalty_date" TIMESTAMP,
	"penalty_per" VARCHAR(20),
	"penalty_basis" VARCHAR(1000),
	"penalty_reason" VARCHAR(1000),
	"penalty_result" VARCHAR(1000),
	"record_per" VARCHAR(20),
	"record_date" TIMESTAMP,
	"org_guid" CHAR(32)
   ) ;

COMMENT ON TABLE slaj.t_busi_account_record IS '责任追究记录';
COMMENT ON COLUMN slaj.t_busi_account_record."pun_unit" IS '被惩罚单位';
COMMENT ON COLUMN slaj.t_busi_account_record."penalty_date" IS '处罚日期';
COMMENT ON COLUMN slaj.t_busi_account_record."penalty_per" IS '被处罚人员';
COMMENT ON COLUMN slaj.t_busi_account_record."penalty_basis" IS '处罚依据';
COMMENT ON COLUMN slaj.t_busi_account_record."penalty_reason" IS '处罚原因';
COMMENT ON COLUMN slaj.t_busi_account_record."penalty_result" IS '处罚结果';
COMMENT ON COLUMN slaj.t_busi_account_record."record_per" IS '记录人员';
COMMENT ON COLUMN slaj.t_busi_account_record."record_date" IS '记录时间';
COMMENT ON COLUMN slaj.t_busi_account_record."org_guid" IS '机构id';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_BD_TOTAL  →  新表: slaj.t_busi_bd_total
-- 列数: 13
-- ============================================================

CREATE TABLE slaj.t_busi_bd_total
   (	"guid" VARCHAR(150),
	"create_time" TIMESTAMP,
	"start_time" VARCHAR(150),
	"org_guid" VARCHAR(150),
	"org_name" VARCHAR(150),
	"dwzs" DECIMAL,
	"zj_project" DECIMAL,
	"bd" DECIMAL,
	"gm_azx" DECIMAL,
	"azx_fxd" DECIMAL,
	"azx_rate" DECIMAL,
	"jd" VARCHAR(145),
	"nf" VARCHAR(150)
   ) ;

COMMENT ON COLUMN slaj.t_busi_bd_total."dwzs" IS '单位总数';
COMMENT ON COLUMN slaj.t_busi_bd_total."zj_project" IS '在建工程';
COMMENT ON COLUMN slaj.t_busi_bd_total."bd" IS '标段';
COMMENT ON COLUMN slaj.t_busi_bd_total."gm_azx" IS '购买安责险标段';
COMMENT ON COLUMN slaj.t_busi_bd_total."azx_fxd" IS '安责风险度';
COMMENT ON COLUMN slaj.t_busi_bd_total."azx_rate" IS '安责风险率';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_CONPLAN_BASIC20250113  →  新表: slaj.t_busi_conplan_basic20250113
-- 列数: 20
-- ============================================================

CREATE TABLE slaj.t_busi_conplan_basic20250113
   (	"guid" CHAR(32),
	"plan_name" VARCHAR(100),
	"org_guid" CHAR(32),
	"entry_time" TIMESTAMP,
	"eva_cycle" DECIMAL(38,0),
	"revised" CHAR(1),
	"plan_type" CHAR(1),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"plan_status" CHAR(1),
	"parent_id" CHAR(32),
	"revision_info" VARCHAR(200),
	"parent_name" VARCHAR(100),
	"revise_time" TIMESTAMP,
	"haz_guid" VARCHAR(32),
	"eng_guid" VARCHAR(32),
	"emer_type" CHAR(1),
	"area_type" CHAR(1)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_CONT_MEAS  →  新表: slaj.t_busi_cont_meas
-- 列数: 21
-- ============================================================

CREATE TABLE slaj.t_busi_cont_meas
   (	"guid" CHAR(32),
	"monitor_mode" VARCHAR(20),
	"early" VARCHAR(300),
	"threshold" VARCHAR(10),
	"cycle" DECIMAL,
	"start_time" TIMESTAMP,
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"org_guid" CHAR(32),
	"eng_guid" CHAR(32),
	"haz_guid" CHAR(32),
	"haz_name" VARCHAR(100),
	"haz_grade" VARCHAR(50),
	"type" VARCHAR(10),
	"risk_grad" VARCHAR(50),
	"condition" VARCHAR(1000),
	"is_quantify" VARCHAR(10),
	"auto_freq" DECIMAL,
	"manual_freq" DECIMAL
   ) ;

COMMENT ON COLUMN slaj.t_busi_cont_meas."monitor_mode" IS '监控方式';
COMMENT ON COLUMN slaj.t_busi_cont_meas."early" IS '预警指标';
COMMENT ON COLUMN slaj.t_busi_cont_meas."threshold" IS '预警阈值';
COMMENT ON COLUMN slaj.t_busi_cont_meas."cycle" IS '巡检周期';
COMMENT ON COLUMN slaj.t_busi_cont_meas."start_time" IS '巡检开始时间';
COMMENT ON COLUMN slaj.t_busi_cont_meas."creper_guid" IS '创建人';
COMMENT ON COLUMN slaj.t_busi_cont_meas."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_cont_meas."updper_guid" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_cont_meas."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_cont_meas."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_cont_meas."eng_guid" IS '工程id';
COMMENT ON COLUMN slaj.t_busi_cont_meas."haz_guid" IS '危险源id';
COMMENT ON COLUMN slaj.t_busi_cont_meas."haz_name" IS '危险源名称';
COMMENT ON COLUMN slaj.t_busi_cont_meas."haz_grade" IS '危险源等级';
COMMENT ON COLUMN slaj.t_busi_cont_meas."type" IS '类型';
COMMENT ON COLUMN slaj.t_busi_cont_meas."risk_grad" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_cont_meas."condition" IS '预警条件';
COMMENT ON COLUMN slaj.t_busi_cont_meas."is_quantify" IS '预警指标是否为可量化指标';
COMMENT ON COLUMN slaj.t_busi_cont_meas."auto_freq" IS '自动监测频次';
COMMENT ON COLUMN slaj.t_busi_cont_meas."manual_freq" IS '手动监测频次';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_DATA_TYPE_LEVEL  →  新表: slaj.t_busi_data_type_level
-- 列数: 24
-- ============================================================

CREATE TABLE slaj.t_busi_data_type_level
   (	"id" DECIMAL,
	"data_asset_id" DECIMAL,
	"system_name" VARCHAR(500),
	"server_ip" VARCHAR(100),
	"server_port" DECIMAL,
	"protocol_type" VARCHAR(200),
	"instance_name" VARCHAR(200),
	"schema_name" VARCHAR(200),
	"table_name" VARCHAR(200),
	"column_family" VARCHAR(200),
	"column_name" VARCHAR(200),
	"remark" VARCHAR(500),
	"sensitive_type_id" DECIMAL,
	"sensitive_type_code" VARCHAR(200),
	"sensitive_type_name" VARCHAR(200),
	"data_type_id" DECIMAL,
	"data_type_name" VARCHAR(200),
	"grade_id" VARCHAR(200),
	"grade_name" VARCHAR(200),
	"label_id" DECIMAL,
	"label_name" VARCHAR(200),
	"check_time" DECIMAL,
	"template_id" DECIMAL,
	"template_name" VARCHAR(200)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_DRILL_EVA  →  新表: slaj.t_busi_drill_eva
-- 表说明: 应急演练评估信息表
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.t_busi_drill_eva
   (	"de_guid" CHAR(32),
	"basic_id" VARCHAR(500),
	"eva_time" TIMESTAMP,
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"assess" VARCHAR(200),
	"dr_guid" CHAR(32)
   ) ;

COMMENT ON TABLE slaj.t_busi_drill_eva IS '应急演练评估信息表';
COMMENT ON COLUMN slaj.t_busi_drill_eva."de_guid" IS '数据id';
COMMENT ON COLUMN slaj.t_busi_drill_eva."basic_id" IS '预案id';
COMMENT ON COLUMN slaj.t_busi_drill_eva."eva_time" IS '评估时间';
COMMENT ON COLUMN slaj.t_busi_drill_eva."org_guid" IS '填报机构guid';
COMMENT ON COLUMN slaj.t_busi_drill_eva."creper_guid" IS '创建人guid';
COMMENT ON COLUMN slaj.t_busi_drill_eva."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_drill_eva."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.t_busi_drill_eva."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_drill_eva."assess" IS '评估主持单位';
COMMENT ON COLUMN slaj.t_busi_drill_eva."dr_guid" IS '演练记录id';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_DRILL_RECORD  →  新表: slaj.t_busi_drill_record
-- 表说明: 演练实施记录表
-- 列数: 16
-- ============================================================

CREATE TABLE slaj.t_busi_drill_record
   (	"dr_guid" CHAR(32),
	"basic_id" VARCHAR(500),
	"drill_type" CHAR(1),
	"drill_time" TIMESTAMP,
	"partake_num" DECIMAL(38,0),
	"partake_org" VARCHAR(200),
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"drill_name" VARCHAR(200),
	"pdr_guid" CHAR(32),
	"rdb" CHAR(1),
	"cor_status" CHAR(1),
	"emer_type" CHAR(1)
   ) ;

COMMENT ON TABLE slaj.t_busi_drill_record IS '演练实施记录表';
COMMENT ON COLUMN slaj.t_busi_drill_record."dr_guid" IS '数据id';
COMMENT ON COLUMN slaj.t_busi_drill_record."basic_id" IS '预案id';
COMMENT ON COLUMN slaj.t_busi_drill_record."drill_type" IS '演练类型';
COMMENT ON COLUMN slaj.t_busi_drill_record."drill_time" IS '演练时间';
COMMENT ON COLUMN slaj.t_busi_drill_record."partake_num" IS '参与人数';
COMMENT ON COLUMN slaj.t_busi_drill_record."partake_org" IS '参与单位';
COMMENT ON COLUMN slaj.t_busi_drill_record."org_guid" IS '填报人所在机构guid';
COMMENT ON COLUMN slaj.t_busi_drill_record."creper_guid" IS '创建人guid';
COMMENT ON COLUMN slaj.t_busi_drill_record."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_drill_record."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.t_busi_drill_record."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_drill_record."drill_name" IS '预案演练名称';
COMMENT ON COLUMN slaj.t_busi_drill_record."pdr_guid" IS '整改记录id';
COMMENT ON COLUMN slaj.t_busi_drill_record."rdb" IS '评估状态1未评估2已评估';
COMMENT ON COLUMN slaj.t_busi_drill_record."cor_status" IS '演练状态1演练2重新演练';
COMMENT ON COLUMN slaj.t_busi_drill_record."emer_type" IS '系统交互参数';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_ENG_PART  →  新表: slaj.t_busi_eng_part
-- 表说明: 区域管理信息表
-- 列数: 14
-- ============================================================

CREATE TABLE slaj.t_busi_eng_part
   (	"guid" CHAR(32),
	"part_name" VARCHAR(1024),
	"eng_guid" CHAR(32),
	"tend_guid" CHAR(32),
	"part_long" DECIMAL(11,8),
	"part_lat" DECIMAL(10,8),
	"org_guid" CHAR(32),
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"rec_pers" CHAR(32),
	"str_to_date" TIMESTAMP,
	"status" CHAR(1),
	"area_type" CHAR(1)
   ) ;

COMMENT ON TABLE slaj.t_busi_eng_part IS '区域管理信息表';
COMMENT ON COLUMN slaj.t_busi_eng_part."part_name" IS '区域名称';
COMMENT ON COLUMN slaj.t_busi_eng_part."eng_guid" IS '工程id';
COMMENT ON COLUMN slaj.t_busi_eng_part."tend_guid" IS '标段id';
COMMENT ON COLUMN slaj.t_busi_eng_part."part_long" IS '经度';
COMMENT ON COLUMN slaj.t_busi_eng_part."part_lat" IS '纬度';
COMMENT ON COLUMN slaj.t_busi_eng_part."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_eng_part."note" IS '备注';
COMMENT ON COLUMN slaj.t_busi_eng_part."coll_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_eng_part."upd_time" IS '更新时间';
COMMENT ON COLUMN slaj.t_busi_eng_part."rec_pers" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_eng_part."str_to_date" IS '删除时间';
COMMENT ON COLUMN slaj.t_busi_eng_part."status" IS '1启用 2停用';
COMMENT ON COLUMN slaj.t_busi_eng_part."area_type" IS '1工程区域 2非工程单位区域';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_ENG_SAFE_EVALUATE  →  新表: slaj.t_busi_eng_safe_evaluate
-- 表说明: 工程安全生产风险值
-- 列数: 14
-- ============================================================

CREATE TABLE slaj.t_busi_eng_safe_evaluate
   (	"guid" CHAR(32),
	"eng_guid" CHAR(32),
	"initial_absolute" DECIMAL,
	"initial_relative" DECIMAL,
	"now_absolute" DECIMAL,
	"now_relative" DECIMAL,
	"haz" DECIMAL,
	"hidd" DECIMAL,
	"acci" DECIMAL,
	"risk_grade" CHAR(1),
	"evaluate_date" TIMESTAMP,
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.t_busi_eng_safe_evaluate IS '工程安全生产风险值';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."eng_guid" IS '工程主键';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."initial_absolute" IS '初始绝对风险值';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."initial_relative" IS '1注销 2未注销 ';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."now_absolute" IS '1开启 2关闭';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."now_relative" IS '当前风险值和';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."haz" IS '危险源数量';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."hidd" IS '隐患数量';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."acci" IS '事故数量';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."risk_grade" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."evaluate_date" IS '评价日期';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."note" IS '备注';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."coll_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_eng_safe_evaluate."upd_time" IS '修改时间';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_EVALUATE  →  新表: slaj.t_busi_evaluate
-- 列数: 18
-- ============================================================

CREATE TABLE slaj.t_busi_evaluate
   (	"guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"org_guid" CHAR(32),
	"risk_grad" VARCHAR(50),
	"standard" VARCHAR(50),
	"result" VARCHAR(50),
	"l" DECIMAL,
	"e" DECIMAL,
	"c" DECIMAL,
	"d" DECIMAL,
	"role" VARCHAR(50),
	"name" VARCHAR(50),
	"h" DECIMAL,
	"haziden_guid" CHAR(32),
	"s" DECIMAL
   ) ;

COMMENT ON COLUMN slaj.t_busi_evaluate."creper_guid" IS '创建人';
COMMENT ON COLUMN slaj.t_busi_evaluate."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_evaluate."updper_guid" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_evaluate."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_evaluate."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_evaluate."risk_grad" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_evaluate."standard" IS '评价标准';
COMMENT ON COLUMN slaj.t_busi_evaluate."result" IS '评定结果';
COMMENT ON COLUMN slaj.t_busi_evaluate."l" IS 'l值';
COMMENT ON COLUMN slaj.t_busi_evaluate."e" IS 'e值';
COMMENT ON COLUMN slaj.t_busi_evaluate."c" IS 'c值';
COMMENT ON COLUMN slaj.t_busi_evaluate."d" IS 'd值';
COMMENT ON COLUMN slaj.t_busi_evaluate."role" IS '所属角色';
COMMENT ON COLUMN slaj.t_busi_evaluate."name" IS '姓名';
COMMENT ON COLUMN slaj.t_busi_evaluate."h" IS 'h值';
COMMENT ON COLUMN slaj.t_busi_evaluate."haziden_guid" IS '危险源辨识id';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_GROUP_INFO  →  新表: slaj.t_busi_group_info
-- 表说明: 安全机构成员表
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.t_busi_group_info
   (	"guid" VARCHAR(32),
	"group_name" VARCHAR(50),
	"post" VARCHAR(250),
	"tel" VARCHAR(20),
	"safeogr_guid" VARCHAR(32),
	"org_guid" VARCHAR(32),
	"create_time" TIMESTAMP,
	"create_per" VARCHAR(20),
	"update_time" TIMESTAMP,
	"update_per" VARCHAR(20)
   ) ;

COMMENT ON TABLE slaj.t_busi_group_info IS '安全机构成员表';
COMMENT ON COLUMN slaj.t_busi_group_info."group_name" IS '成员名称';
COMMENT ON COLUMN slaj.t_busi_group_info."post" IS '职务';
COMMENT ON COLUMN slaj.t_busi_group_info."tel" IS '电话';
COMMENT ON COLUMN slaj.t_busi_group_info."safeogr_guid" IS '安全机构id';
COMMENT ON COLUMN slaj.t_busi_group_info."org_guid" IS '机构id';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HARD_TOTAL  →  新表: slaj.t_busi_hard_total
-- 表说明: 非工程辨识率
-- 列数: 35
-- ============================================================

CREATE TABLE slaj.t_busi_hard_total
   (	"org_guid" VARCHAR(150),
	"org_name" VARCHAR(150),
	"guid" VARCHAR(150),
	"create_time" TIMESTAMP,
	"hard_rate" DECIMAL,
	"bs_total" DECIMAL,
	"gk_total" DECIMAL,
	"zh_rate" DECIMAL,
	"zd_hard_total" DECIMAL,
	"yb_hard_total" DECIMAL,
	"zd_gk" DECIMAL,
	"yb_gk" DECIMAL,
	"zd_gk_rate" DECIMAL,
	"yb_gk_rate" DECIMAL,
	"hard_bs_rate" DECIMAL,
	"zd_bs_rate" DECIMAL,
	"yb_bs_rate" DECIMAL,
	"conbs_total" DECIMAL,
	"conzd_bs_total" DECIMAL,
	"conyb_bs_total" DECIMAL,
	"yx_total" DECIMAL,
	"yxzd_total" DECIMAL,
	"yxyb_total" DECIMAL,
	"pro_total" DECIMAL,
	"lbl" DECIMAL,
	"bsl" DECIMAL,
	"gkl" DECIMAL,
	"start_time" VARCHAR(150),
	"end_time" VARCHAR(150),
	"jd" VARCHAR(150),
	"nf" VARCHAR(150),
	"fgcbsl" DECIMAL,
	"fgcdwzs" DECIMAL,
	"gcdwzs" DECIMAL,
	"gcbsl" DECIMAL
   ) ;

COMMENT ON TABLE slaj.t_busi_hard_total IS '非工程辨识率';
COMMENT ON COLUMN slaj.t_busi_hard_total."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_hard_total."org_name" IS '单位名称';
COMMENT ON COLUMN slaj.t_busi_hard_total."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_hard_total."hard_rate" IS '风险度';
COMMENT ON COLUMN slaj.t_busi_hard_total."bs_total" IS '辨识总数';
COMMENT ON COLUMN slaj.t_busi_hard_total."gk_total" IS '管控总数';
COMMENT ON COLUMN slaj.t_busi_hard_total."zh_rate" IS '综合管控率';
COMMENT ON COLUMN slaj.t_busi_hard_total."zd_hard_total" IS '重大辨识';
COMMENT ON COLUMN slaj.t_busi_hard_total."yb_hard_total" IS '一般辨识';
COMMENT ON COLUMN slaj.t_busi_hard_total."zd_gk" IS '重大管控';
COMMENT ON COLUMN slaj.t_busi_hard_total."yb_gk" IS '一般管控';
COMMENT ON COLUMN slaj.t_busi_hard_total."zd_gk_rate" IS '重大管控率';
COMMENT ON COLUMN slaj.t_busi_hard_total."yb_gk_rate" IS '一般管控率';
COMMENT ON COLUMN slaj.t_busi_hard_total."hard_bs_rate" IS '危险源辨识率';
COMMENT ON COLUMN slaj.t_busi_hard_total."zd_bs_rate" IS '重大辨识率';
COMMENT ON COLUMN slaj.t_busi_hard_total."yb_bs_rate" IS '一般辨识率';
COMMENT ON COLUMN slaj.t_busi_hard_total."conbs_total" IS '应辨识总数';
COMMENT ON COLUMN slaj.t_busi_hard_total."conzd_bs_total" IS '应该辨识重大';
COMMENT ON COLUMN slaj.t_busi_hard_total."conyb_bs_total" IS '应该辨识一般';
COMMENT ON COLUMN slaj.t_busi_hard_total."yx_total" IS '有效总数';
COMMENT ON COLUMN slaj.t_busi_hard_total."yxzd_total" IS '有效重大';
COMMENT ON COLUMN slaj.t_busi_hard_total."yxyb_total" IS '有效一般';
COMMENT ON COLUMN slaj.t_busi_hard_total."pro_total" IS '工程总数';
COMMENT ON COLUMN slaj.t_busi_hard_total."lbl" IS '漏报率';
COMMENT ON COLUMN slaj.t_busi_hard_total."bsl" IS '辨识率';
COMMENT ON COLUMN slaj.t_busi_hard_total."gkl" IS '管控率';
COMMENT ON COLUMN slaj.t_busi_hard_total."start_time" IS '开始时间';
COMMENT ON COLUMN slaj.t_busi_hard_total."end_time" IS '结束时间';
COMMENT ON COLUMN slaj.t_busi_hard_total."jd" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hard_total."nf" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hard_total."fgcbsl" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hard_total."fgcdwzs" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hard_total."gcdwzs" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hard_total."gcbsl" IS '未使用';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HAZARD_REPORT20250113  →  新表: slaj.t_busi_hazard_report20250113
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.t_busi_hazard_report20250113
   (	"guid" CHAR(32),
	"haz_iden_guid" CHAR(32),
	"org_guid" CHAR(32),
	"status" CHAR(1),
	"wiun_guid" CHAR(32),
	"create_per" CHAR(32),
	"create_time" TIMESTAMP,
	"update_per" CHAR(32),
	"update_time" TIMESTAMP
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HAZ_IDENBAK  →  新表: slaj.t_busi_haz_idenbak
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.t_busi_haz_idenbak
   (	"guid" CHAR(32),
	"haz_guid" CHAR(32),
	"haz_grade" CHAR(1),
	"otlcol_qgw_tnygts" VARCHAR(2500),
	"guide_in" CHAR(1),
	"create_per" CHAR(32),
	"create_time" TIMESTAMP,
	"update_per" CHAR(32),
	"update_time" TIMESTAMP,
	"acci_cause" VARCHAR(2000)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HIDD_EVALUATE  →  新表: slaj.t_busi_hidd_evaluate
-- 表说明: 隐患风险评价
-- 列数: 18
-- ============================================================

CREATE TABLE slaj.t_busi_hidd_evaluate
   (	"guid" CHAR(32),
	"hidd_guid" CHAR(32),
	"org_guid" CHAR(32),
	"risk_grad" VARCHAR(50),
	"standard" VARCHAR(50),
	"result" VARCHAR(50),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"l" DECIMAL,
	"e" DECIMAL,
	"c" DECIMAL,
	"d" DECIMAL,
	"role" VARCHAR(50),
	"name" VARCHAR(50),
	"h" DECIMAL,
	"s" DECIMAL
   ) ;

COMMENT ON TABLE slaj.t_busi_hidd_evaluate IS '隐患风险评价';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."hidd_guid" IS '事故主键';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."org_guid" IS '所属机构';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."risk_grad" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."standard" IS '1、固定（从检测监控措施带来的）、2、浮动（可新增、删除）';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."result" IS '评定结果';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."creper_guid" IS '创建人主键';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."create_time" IS '创建人时间';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."updper_guid" IS '修改人主键';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."l" IS 'L值';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."e" IS 'E值';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."c" IS 'C值';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."d" IS 'D值';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."role" IS '所属角色';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."name" IS '姓名';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."h" IS 'H值';
COMMENT ON COLUMN slaj.t_busi_hidd_evaluate."s" IS 'S值';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HIDD_TOTAL  →  新表: slaj.t_busi_hidd_total
-- 表说明: 隐患排查排名表
-- 列数: 47
-- ============================================================

CREATE TABLE slaj.t_busi_hidd_total
   (	"guid" VARCHAR(150),
	"start_time" VARCHAR(150),
	"create_time" TIMESTAMP,
	"org_guid" VARCHAR(200),
	"org_name" VARCHAR(200),
	"fxd" DECIMAL,
	"pcl" DECIMAL,
	"ybl" DECIMAL,
	"sydw" DECIMAL,
	"ypcdw" DECIMAL,
	"mix_dwzs" DECIMAL,
	"mix_yhdw" DECIMAL,
	"mix_zb" DECIMAL,
	"mid_dwzs" DECIMAL,
	"mid_yhdw" DECIMAL,
	"mid_zb" DECIMAL,
	"max_dwzs" DECIMAL,
	"max_yhdw" DECIMAL,
	"max_zb" DECIMAL,
	"yhzs" DECIMAL,
	"wzg" DECIMAL,
	"zzzg" DECIMAL,
	"yzg" DECIMAL,
	"ln_yhzs" DECIMAL,
	"ln_zdyh" DECIMAL,
	"ln_ybyh" DECIMAL,
	"ln_yzg" DECIMAL,
	"ln_zdyzg" DECIMAL,
	"ln_ybyzg" DECIMAL,
	"zdzgl" DECIMAL,
	"ybzgl" DECIMAL,
	"zhzgl" DECIMAL,
	"ze_yhdws" DECIMAL,
	"ze_ljdws" DECIMAL,
	"xz_yhs" DECIMAL,
	"yhlbl" DECIMAL,
	"jd" VARCHAR(150),
	"nf" DECIMAL,
	"sc_pro_totala" DECIMAL,
	"sc_pro_totalb" DECIMAL,
	"sc_pro_totalc" DECIMAL,
	"fgcjda" DECIMAL,
	"pro_zsa" DECIMAL,
	"pro_zsb" DECIMAL,
	"pro_zsc" DECIMAL,
	"sa_org_total1a" DECIMAL,
	"dwzs" DECIMAL
   ) ;

COMMENT ON TABLE slaj.t_busi_hidd_total IS '隐患排查排名表';
COMMENT ON COLUMN slaj.t_busi_hidd_total."start_time" IS '开始时间';
COMMENT ON COLUMN slaj.t_busi_hidd_total."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_hidd_total."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_hidd_total."org_name" IS '单位名称';
COMMENT ON COLUMN slaj.t_busi_hidd_total."fxd" IS '隐患风险度';
COMMENT ON COLUMN slaj.t_busi_hidd_total."pcl" IS '排查率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ybl" IS '月报上报率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."sydw" IS '企事业单位总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ypcdw" IS '已排查单位(上报)';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mix_dwzs" IS '10单位总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mix_yhdw" IS '0隐患单位数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mix_zb" IS '占比';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mid_dwzs" IS '11单位总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mid_yhdw" IS '0隐患单位数11';
COMMENT ON COLUMN slaj.t_busi_hidd_total."mid_zb" IS '占比11';
COMMENT ON COLUMN slaj.t_busi_hidd_total."max_dwzs" IS '12单位总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."max_yhdw" IS '0隐患单位数12';
COMMENT ON COLUMN slaj.t_busi_hidd_total."max_zb" IS '占比12';
COMMENT ON COLUMN slaj.t_busi_hidd_total."yhzs" IS '当季隐患总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."wzg" IS '未落实整改';
COMMENT ON COLUMN slaj.t_busi_hidd_total."zzzg" IS '整改中隐患';
COMMENT ON COLUMN slaj.t_busi_hidd_total."yzg" IS '已整改隐患';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_yhzs" IS '历年隐患总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_zdyh" IS '历年重大隐患数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_ybyh" IS '历年一般隐患数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_yzg" IS '历年已整改总数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_zdyzg" IS '历年已整改重大隐患数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ln_ybyzg" IS '历年已整改一般隐患数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."zdzgl" IS '重大隐患整改率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ybzgl" IS '一般隐患整改率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."zhzgl" IS '综合整改率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ze_yhdws" IS '当季度连续3月新增0隐患单位数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."ze_ljdws" IS '当季度3个月累计新增0隐患单位数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."xz_yhs" IS '平均每个单位新增隐患数';
COMMENT ON COLUMN slaj.t_busi_hidd_total."yhlbl" IS '隐患漏报率';
COMMENT ON COLUMN slaj.t_busi_hidd_total."jd" IS '季度';
COMMENT ON COLUMN slaj.t_busi_hidd_total."nf" IS '年份';
COMMENT ON COLUMN slaj.t_busi_hidd_total."sc_pro_totala" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."sc_pro_totalb" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."sc_pro_totalc" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."fgcjda" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."pro_zsa" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."pro_zsb" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."pro_zsc" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."sa_org_total1a" IS '未使用';
COMMENT ON COLUMN slaj.t_busi_hidd_total."dwzs" IS '未使用';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_HUIZONG_TOTAL  →  新表: slaj.t_busi_huizong_total
-- 表说明: 汇总统计
-- 列数: 19
-- ============================================================

CREATE TABLE slaj.t_busi_huizong_total
   (	"guid" VARCHAR(150),
	"create_time" TIMESTAMP,
	"start_time" VARCHAR(150),
	"org_name" VARCHAR(159),
	"org_guid" VARCHAR(150),
	"anfxd" DECIMAL,
	"yhfxd" DECIMAL,
	"pcl" DECIMAL,
	"zhzgl" DECIMAL,
	"hard_rate" DECIMAL,
	"hard_bs_rate" DECIMAL,
	"zh_rate" DECIMAL,
	"ya_fxz" DECIMAL,
	"ya_ylz" DECIMAL,
	"yj_fxz" DECIMAL,
	"azx_rate" DECIMAL,
	"azx_fxd" DECIMAL,
	"jd" VARCHAR(150),
	"nf" VARCHAR(150)
   ) ;

COMMENT ON TABLE slaj.t_busi_huizong_total IS '汇总统计';
COMMENT ON COLUMN slaj.t_busi_huizong_total."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_huizong_total."start_time" IS '开始时间';
COMMENT ON COLUMN slaj.t_busi_huizong_total."org_name" IS '单位名称';
COMMENT ON COLUMN slaj.t_busi_huizong_total."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_huizong_total."anfxd" IS '安全风险度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."yhfxd" IS '隐患风险度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."pcl" IS '排查率';
COMMENT ON COLUMN slaj.t_busi_huizong_total."zhzgl" IS '综合整改率';
COMMENT ON COLUMN slaj.t_busi_huizong_total."hard_rate" IS '危险源风险度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."hard_bs_rate" IS '危险源辨识率';
COMMENT ON COLUMN slaj.t_busi_huizong_total."zh_rate" IS '管控率';
COMMENT ON COLUMN slaj.t_busi_huizong_total."ya_fxz" IS '预安填报';
COMMENT ON COLUMN slaj.t_busi_huizong_total."ya_ylz" IS '预案演练';
COMMENT ON COLUMN slaj.t_busi_huizong_total."yj_fxz" IS '应急风险';
COMMENT ON COLUMN slaj.t_busi_huizong_total."azx_rate" IS '安责险风险度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."azx_fxd" IS '安责险风险度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."jd" IS '年度';
COMMENT ON COLUMN slaj.t_busi_huizong_total."nf" IS '年份';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_INSURE_INFO  →  新表: slaj.t_busi_insure_info
-- 表说明: 项目保险信息表
-- 列数: 34
-- ============================================================

CREATE TABLE slaj.t_busi_insure_info
   (	"guid" VARCHAR(32),
	"policy_no" VARCHAR(50),
	"insurance_unit" VARCHAR(100),
	"insure_company_name" VARCHAR(100),
	"insure_start_time" TIMESTAMP,
	"insure_end_time" TIMESTAMP,
	"insure_perno" VARCHAR(100),
	"accident_limit" DECIMAL(38,6),
	"accident_three_limit" DECIMAL(38,6),
	"employee_casualty_limit" DECIMAL(38,6),
	"accident_inspect_fees" DECIMAL(38,6),
	"accident_rescue_fees" DECIMAL(38,6),
	"aggregate_indemnity_limit" DECIMAL(38,6),
	"law_proceed_limit" DECIMAL(38,6),
	"law_proceed_total_limit" DECIMAL(38,6),
	"medical_expense_limit" DECIMAL(38,6),
	"medical_expense_accumu_limit" DECIMAL(38,6),
	"creat_time" TIMESTAMP,
	"creater" VARCHAR(50),
	"update_time" TIMESTAMP,
	"updater" VARCHAR(50),
	"str_to_date" TIMESTAMP,
	"project_per_num" DECIMAL(38,6),
	"insurance_base" DECIMAL(38,6),
	"safety_education_training" DECIMAL(10,0),
	"accident_hazard_inve" DECIMAL(10,0),
	"risk_grad_control" DECIMAL(10,0),
	"cons_safety_prod" DECIMAL(10,0),
	"emer_manage" DECIMAL(10,0),
	"promot_technology" DECIMAL(10,0),
	"org_guid" VARCHAR(32),
	"as_three_server" VARCHAR(50),
	"ser_name" VARCHAR(50),
	"insurance_org" VARCHAR(2000)
   ) ;

COMMENT ON TABLE slaj.t_busi_insure_info IS '项目保险信息表';
COMMENT ON COLUMN slaj.t_busi_insure_info."policy_no" IS '保单编号';
COMMENT ON COLUMN slaj.t_busi_insure_info."insurance_unit" IS '投保单位';
COMMENT ON COLUMN slaj.t_busi_insure_info."insure_company_name" IS '保险公司名称';
COMMENT ON COLUMN slaj.t_busi_insure_info."insure_start_time" IS '保险开始时间';
COMMENT ON COLUMN slaj.t_busi_insure_info."insure_end_time" IS '保险结束时间';
COMMENT ON COLUMN slaj.t_busi_insure_info."insure_perno" IS '被保险人数';
COMMENT ON COLUMN slaj.t_busi_insure_info."accident_limit" IS '每次事故赔偿限额(万元)  ';
COMMENT ON COLUMN slaj.t_busi_insure_info."accident_three_limit" IS '第三者每人人身伤亡赔偿限额(万元)';
COMMENT ON COLUMN slaj.t_busi_insure_info."employee_casualty_limit" IS '雇员每人人身伤亡赔偿限额(万元';
COMMENT ON COLUMN slaj.t_busi_insure_info."accident_inspect_fees" IS '每次事故调查勘验费用赔偿限额';
COMMENT ON COLUMN slaj.t_busi_insure_info."accident_rescue_fees" IS '每次事故抢险救援费用赔偿限额';
COMMENT ON COLUMN slaj.t_busi_insure_info."aggregate_indemnity_limit" IS '保险期间内总累计赔偿限额 ';
COMMENT ON COLUMN slaj.t_busi_insure_info."law_proceed_limit" IS '每次法律诉讼赔偿限额';
COMMENT ON COLUMN slaj.t_busi_insure_info."law_proceed_total_limit" IS '累计法律诉讼总赔偿限额(万元) ';
COMMENT ON COLUMN slaj.t_busi_insure_info."medical_expense_limit" IS '每人医疗费用赔偿限额(';
COMMENT ON COLUMN slaj.t_busi_insure_info."medical_expense_accumu_limit" IS '累计医疗费用赔偿限额(万元) *';
COMMENT ON COLUMN slaj.t_busi_insure_info."creat_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_insure_info."creater" IS '创建人';
COMMENT ON COLUMN slaj.t_busi_insure_info."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_insure_info."updater" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_insure_info."str_to_date" IS '删除时间';
COMMENT ON COLUMN slaj.t_busi_insure_info."project_per_num" IS '保费（元）';
COMMENT ON COLUMN slaj.t_busi_insure_info."insurance_base" IS '保险基数（万元）';
COMMENT ON COLUMN slaj.t_busi_insure_info."safety_education_training" IS '安全生产教育培训（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."accident_hazard_inve" IS '事故隐患排查（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."risk_grad_control" IS '风险分级管控（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."cons_safety_prod" IS '安全生产标准化建设（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."emer_manage" IS '应急预案管理（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."promot_technology" IS '安全生产科技推广应用（次;年）';
COMMENT ON COLUMN slaj.t_busi_insure_info."org_guid" IS '机构id';
COMMENT ON COLUMN slaj.t_busi_insure_info."as_three_server" IS '服务机构是否为第三方（0否，1是）';
COMMENT ON COLUMN slaj.t_busi_insure_info."ser_name" IS '服务机构名称';
COMMENT ON COLUMN slaj.t_busi_insure_info."insurance_org" IS '投保单位';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_INSURE_INFO20250113  →  新表: slaj.t_busi_insure_info20250113
-- 列数: 34
-- ============================================================

CREATE TABLE slaj.t_busi_insure_info20250113
   (	"guid" VARCHAR(32),
	"policy_no" VARCHAR(50),
	"insurance_unit" VARCHAR(100),
	"insure_company_name" VARCHAR(100),
	"insure_start_time" TIMESTAMP,
	"insure_end_time" TIMESTAMP,
	"insure_perno" VARCHAR(100),
	"accident_limit" DECIMAL(38,6),
	"accident_three_limit" DECIMAL(38,6),
	"employee_casualty_limit" DECIMAL(38,6),
	"accident_inspect_fees" DECIMAL(38,6),
	"accident_rescue_fees" DECIMAL(38,6),
	"aggregate_indemnity_limit" DECIMAL(38,6),
	"law_proceed_limit" DECIMAL(38,6),
	"law_proceed_total_limit" DECIMAL(38,6),
	"medical_expense_limit" DECIMAL(38,6),
	"medical_expense_accumu_limit" DECIMAL(38,6),
	"creat_time" TIMESTAMP,
	"creater" VARCHAR(50),
	"update_time" TIMESTAMP,
	"updater" VARCHAR(50),
	"str_to_date" TIMESTAMP,
	"project_per_num" DECIMAL(38,6),
	"insurance_base" DECIMAL(38,6),
	"safety_education_training" DECIMAL(10,0),
	"accident_hazard_inve" DECIMAL(10,0),
	"risk_grad_control" DECIMAL(10,0),
	"cons_safety_prod" DECIMAL(10,0),
	"emer_manage" DECIMAL(10,0),
	"promot_technology" DECIMAL(10,0),
	"org_guid" VARCHAR(32),
	"as_three_server" VARCHAR(50),
	"ser_name" VARCHAR(50),
	"insurance_org" VARCHAR(2000)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_INSURE_PRE  →  新表: slaj.t_busi_insure_pre
-- 表说明: 安全险事故预防服务表
-- 列数: 16
-- ============================================================

CREATE TABLE slaj.t_busi_insure_pre
   (	"guid" VARCHAR(32),
	"policy_no" VARCHAR(12),
	"service_type" VARCHAR(2),
	"service_org" VARCHAR(255),
	"service_engineer" VARCHAR(255),
	"service_time" TIMESTAMP,
	"report" VARCHAR(2000),
	"safe_train" VARCHAR(2000),
	"train_title" VARCHAR(255),
	"train_file" VARCHAR(50),
	"harzard_invest" VARCHAR(255),
	"harzard_num" DECIMAL(8,0),
	"rectify_file" VARCHAR(50),
	"org_guid" VARCHAR(50),
	"record_peo" VARCHAR(50),
	"edit_peo" VARCHAR(50)
   ) ;

COMMENT ON TABLE slaj.t_busi_insure_pre IS '安全险事故预防服务表';
COMMENT ON COLUMN slaj.t_busi_insure_pre."policy_no" IS '保单编码';
COMMENT ON COLUMN slaj.t_busi_insure_pre."service_type" IS '服务类型';
COMMENT ON COLUMN slaj.t_busi_insure_pre."service_org" IS '服务机构';
COMMENT ON COLUMN slaj.t_busi_insure_pre."service_engineer" IS '服务工程师';
COMMENT ON COLUMN slaj.t_busi_insure_pre."service_time" IS '服务时间';
COMMENT ON COLUMN slaj.t_busi_insure_pre."report" IS '服务报告';
COMMENT ON COLUMN slaj.t_busi_insure_pre."safe_train" IS '安全生产教育培训';
COMMENT ON COLUMN slaj.t_busi_insure_pre."train_title" IS '培训主题';
COMMENT ON COLUMN slaj.t_busi_insure_pre."train_file" IS '培训附件';
COMMENT ON COLUMN slaj.t_busi_insure_pre."harzard_invest" IS '隐患排查';
COMMENT ON COLUMN slaj.t_busi_insure_pre."harzard_num" IS '隐患数量';
COMMENT ON COLUMN slaj.t_busi_insure_pre."rectify_file" IS '整改文件';
COMMENT ON COLUMN slaj.t_busi_insure_pre."org_guid" IS '填报人机构';
COMMENT ON COLUMN slaj.t_busi_insure_pre."record_peo" IS '记录人';
COMMENT ON COLUMN slaj.t_busi_insure_pre."edit_peo" IS '编辑人';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_MEET_TOTAL  →  新表: slaj.t_busi_meet_total
-- 表说明: 应急排名表
-- 列数: 19
-- ============================================================

CREATE TABLE slaj.t_busi_meet_total
   (	"guid" VARCHAR(150),
	"create_time" TIMESTAMP,
	"start_time" VARCHAR(150),
	"org_guid" VARCHAR(150),
	"org_name" VARCHAR(150),
	"dwzs" VARCHAR(150),
	"zh_ya" DECIMAL,
	"zx_ya" DECIMAL,
	"xc_ya" DECIMAL,
	"ya_yl" DECIMAL,
	"yazs" DECIMAL,
	"ylzs" DECIMAL,
	"yjl" DECIMAL,
	"yll" DECIMAL,
	"fxz" DECIMAL,
	"ylfxz" DECIMAL,
	"yj_fxz" DECIMAL,
	"jd" VARCHAR(150),
	"nf" VARCHAR(150)
   ) ;

COMMENT ON TABLE slaj.t_busi_meet_total IS '应急排名表';
COMMENT ON COLUMN slaj.t_busi_meet_total."start_time" IS '开始时间';
COMMENT ON COLUMN slaj.t_busi_meet_total."org_guid" IS '单位id';
COMMENT ON COLUMN slaj.t_busi_meet_total."org_name" IS '单位名称';
COMMENT ON COLUMN slaj.t_busi_meet_total."dwzs" IS '单位总数';
COMMENT ON COLUMN slaj.t_busi_meet_total."zh_ya" IS '综合预案数量';
COMMENT ON COLUMN slaj.t_busi_meet_total."zx_ya" IS '专项预案数量';
COMMENT ON COLUMN slaj.t_busi_meet_total."xc_ya" IS '现场处置数量';
COMMENT ON COLUMN slaj.t_busi_meet_total."ya_yl" IS '预案演练';
COMMENT ON COLUMN slaj.t_busi_meet_total."yazs" IS '预案演练单位数';
COMMENT ON COLUMN slaj.t_busi_meet_total."ylzs" IS '演练单位数';
COMMENT ON COLUMN slaj.t_busi_meet_total."yjl" IS '应急预案上报率';
COMMENT ON COLUMN slaj.t_busi_meet_total."yll" IS '应急预案演练率';
COMMENT ON COLUMN slaj.t_busi_meet_total."fxz" IS '应急预案演练率';
COMMENT ON COLUMN slaj.t_busi_meet_total."ylfxz" IS '预案演练风险值';
COMMENT ON COLUMN slaj.t_busi_meet_total."yj_fxz" IS '应急风险值';
COMMENT ON COLUMN slaj.t_busi_meet_total."jd" IS '基数';
COMMENT ON COLUMN slaj.t_busi_meet_total."nf" IS '年份';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_ORG_SAFE_EVALUATE  →  新表: slaj.t_busi_org_safe_evaluate
-- 表说明: 单位安全生产风险值
-- 列数: 15
-- ============================================================

CREATE TABLE slaj.t_busi_org_safe_evaluate
   (	"guid" CHAR(32),
	"org_guid" CHAR(32),
	"org_pguid" CHAR(32),
	"initial_absolute" DECIMAL,
	"now_absolute" DECIMAL,
	"now_relative" DECIMAL,
	"haz" DECIMAL,
	"hidd" DECIMAL,
	"acci" DECIMAL,
	"risk_grade" CHAR(1),
	"evaluate_date" TIMESTAMP,
	"note" VARCHAR(256),
	"coll_time" TIMESTAMP,
	"upd_time" TIMESTAMP,
	"initial_relative" DECIMAL
   ) ;

COMMENT ON TABLE slaj.t_busi_org_safe_evaluate IS '单位安全生产风险值';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."org_guid" IS '单位主键';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."org_pguid" IS '组织父主键';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."initial_absolute" IS '初始绝对风险值';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."now_absolute" IS '1开启 2关闭';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."now_relative" IS '当前风险值和';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."haz" IS '危险源数量';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."hidd" IS '隐患数量';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."acci" IS '事故数量';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."risk_grade" IS '风险等级';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."evaluate_date" IS '评价日期';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."note" IS '备注';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."coll_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."upd_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_org_safe_evaluate."initial_relative" IS '1注销 2未注销 ';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_POSSIBLE_ACCIDENT  →  新表: slaj.t_busi_possible_accident
-- 表说明: 或有事故
-- 列数: 7
-- ============================================================

CREATE TABLE slaj.t_busi_possible_accident
   (	"guid" CHAR(32),
	"haz_iden_guid" CHAR(32),
	"acci_name" VARCHAR(255),
	"create_per" CHAR(32),
	"create_time" TIMESTAMP,
	"update_per" CHAR(32),
	"update_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.t_busi_possible_accident IS '或有事故';
COMMENT ON COLUMN slaj.t_busi_possible_accident."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_possible_accident."haz_iden_guid" IS '辨识主键';
COMMENT ON COLUMN slaj.t_busi_possible_accident."acci_name" IS '或有事故名称';
COMMENT ON COLUMN slaj.t_busi_possible_accident."create_per" IS '创建人主键';
COMMENT ON COLUMN slaj.t_busi_possible_accident."create_time" IS '创建人时间';
COMMENT ON COLUMN slaj.t_busi_possible_accident."update_per" IS '修改人主键';
COMMENT ON COLUMN slaj.t_busi_possible_accident."update_time" IS '修改时间';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_POSTRES  →  新表: slaj.t_busi_postres
-- 列数: 9
-- ============================================================

CREATE TABLE slaj.t_busi_postres
   (	"guid" CHAR(32),
	"position" VARCHAR(500),
	"job_res" VARCHAR(500),
	"jd" VARCHAR(500),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"org_guid" CHAR(32)
   ) ;

COMMENT ON COLUMN slaj.t_busi_postres."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_postres."position" IS '岗位名称';
COMMENT ON COLUMN slaj.t_busi_postres."job_res" IS '岗位职责';
COMMENT ON COLUMN slaj.t_busi_postres."jd" IS '岗位描述';
COMMENT ON COLUMN slaj.t_busi_postres."creper_guid" IS '创建人';
COMMENT ON COLUMN slaj.t_busi_postres."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_postres."updper_guid" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_postres."update_time" IS '更新时间';
COMMENT ON COLUMN slaj.t_busi_postres."org_guid" IS '关联机构';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_POSTRES_PERSON  →  新表: slaj.t_busi_postres_person
-- 列数: 10
-- ============================================================

CREATE TABLE slaj.t_busi_postres_person
   (	"guid" CHAR(32),
	"position_guid" CHAR(32),
	"related_person" VARCHAR(100),
	"name" VARCHAR(32),
	"phone" DECIMAL,
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"org_guid" CHAR(32)
   ) ;

COMMENT ON COLUMN slaj.t_busi_postres_person."guid" IS '主键';
COMMENT ON COLUMN slaj.t_busi_postres_person."position_guid" IS '位置';
COMMENT ON COLUMN slaj.t_busi_postres_person."related_person" IS '关联人员';
COMMENT ON COLUMN slaj.t_busi_postres_person."name" IS '名称';
COMMENT ON COLUMN slaj.t_busi_postres_person."phone" IS '电话号码';
COMMENT ON COLUMN slaj.t_busi_postres_person."creper_guid" IS '创建人';
COMMENT ON COLUMN slaj.t_busi_postres_person."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_postres_person."updper_guid" IS '修改人';
COMMENT ON COLUMN slaj.t_busi_postres_person."update_time" IS '更新时间';
COMMENT ON COLUMN slaj.t_busi_postres_person."org_guid" IS '关联机构';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_SAFEORG_INFO  →  新表: slaj.t_busi_safeorg_info
-- 表说明: 安全机构
-- 列数: 8
-- ============================================================

CREATE TABLE slaj.t_busi_safeorg_info
   (	"guid" VARCHAR(50),
	"safe_orgname" VARCHAR(50),
	"setup_date" TIMESTAMP,
	"org_guid" VARCHAR(32),
	"create_time" TIMESTAMP,
	"update_time" TIMESTAMP,
	"create_per" VARCHAR(20),
	"update_per" VARCHAR(20)
   ) ;

COMMENT ON TABLE slaj.t_busi_safeorg_info IS '安全机构';
COMMENT ON COLUMN slaj.t_busi_safeorg_info."safe_orgname" IS '安全机构名称';
COMMENT ON COLUMN slaj.t_busi_safeorg_info."setup_date" IS '成立时间';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_SIX_BOOST_MWR  →  新表: slaj.t_busi_six_boost_mwr
-- 表说明: 六项机制推进部直属
-- 列数: 32
-- ============================================================

CREATE TABLE slaj.t_busi_six_boost_mwr
   (	"guid" CHAR(32),
	"org_guid" CHAR(32),
	"eng_num" VARCHAR(10),
	"plan_oeg_num" VARCHAR(10),
	"plan_eng_num" VARCHAR(10),
	"self_pers_boost" VARCHAR(10),
	"org_pers_boost" VARCHAR(10),
	"self_main_pers_boost" VARCHAR(10),
	"org_main_pers_boost" VARCHAR(10),
	"plan_measure" VARCHAR(1000),
	"self_train" VARCHAR(10),
	"org_train" VARCHAR(10),
	"self_train_pers" VARCHAR(10),
	"org_train_pers" VARCHAR(10),
	"self_insp" VARCHAR(10),
	"org_insp" VARCHAR(10),
	"self_main_insp" VARCHAR(10),
	"org_main_insp" VARCHAR(10),
	"self_insp_wat" VARCHAR(10),
	"org_insp_wat" VARCHAR(10),
	"self_main_insp_wat" VARCHAR(10),
	"org_main_insp_wat" VARCHAR(10),
	"assess_first" VARCHAR(1000),
	"wat_eng" VARCHAR(10),
	"wat_eng_six" VARCHAR(10),
	"run_eng" VARCHAR(10),
	"run_eng_six" VARCHAR(10),
	"othe_org" VARCHAR(10),
	"othe_org_six" VARCHAR(10),
	"coll_time" TIMESTAMP,
	"update_time" TIMESTAMP,
	"org_num" VARCHAR(10)
   ) ;

COMMENT ON TABLE slaj.t_busi_six_boost_mwr IS '六项机制推进部直属';
COMMENT ON COLUMN slaj.t_busi_six_boost_mwr."guid" IS '主键';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_SMS_RECORD  →  新表: slaj.t_busi_sms_record
-- 列数: 4
-- ============================================================

CREATE TABLE slaj.t_busi_sms_record
   (	"guid" VARCHAR(32),
	"send_tel" VARCHAR(32),
	"tp" VARCHAR(2),
	"ts" TIMESTAMP
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_STR_PUNISH  →  新表: slaj.t_busi_str_punish
-- 表说明: 处罚信息表
-- 列数: 12
-- ============================================================

CREATE TABLE slaj.t_busi_str_punish
   (	"guid" VARCHAR(50),
	"punish_org" VARCHAR(255),
	"punished_org" VARCHAR(255),
	"social_credit_code" VARCHAR(50),
	"punish_time" TIMESTAMP,
	"punish_type" VARCHAR(255),
	"punish_amount" DECIMAL(20,2),
	"punish_detail" VARCHAR(2000),
	"punish_file" VARCHAR(50),
	"punish_org_name" VARCHAR(255),
	"create_time" TIMESTAMP,
	"update_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.t_busi_str_punish IS '处罚信息表';
COMMENT ON COLUMN slaj.t_busi_str_punish."guid" IS 'GUID';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_org" IS '处罚单位';
COMMENT ON COLUMN slaj.t_busi_str_punish."punished_org" IS '被处罚单位';
COMMENT ON COLUMN slaj.t_busi_str_punish."social_credit_code" IS '社会信用代码';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_time" IS '处罚时间';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_type" IS '处罚类型';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_amount" IS '处罚金额';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_detail" IS '处罚说明';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_file" IS '处罚文件';
COMMENT ON COLUMN slaj.t_busi_str_punish."punish_org_name" IS '处罚机构';
COMMENT ON COLUMN slaj.t_busi_str_punish."create_time" IS '新增时间';
COMMENT ON COLUMN slaj.t_busi_str_punish."update_time" IS '更新时间';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_SUPPLIES_RESERVE  →  新表: slaj.t_busi_supplies_reserve
-- 表说明: 应急物资和储备表
-- 列数: 14
-- ============================================================

CREATE TABLE slaj.t_busi_supplies_reserve
   (	"guid" CHAR(32),
	"material_type" CHAR(1),
	"material_name" VARCHAR(100),
	"material_num" DECIMAL,
	"company" VARCHAR(50),
	"provide_time" TIMESTAMP,
	"desposit_site" VARCHAR(200),
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"specs" VARCHAR(50),
	"admin_org" VARCHAR(100)
   ) ;

COMMENT ON TABLE slaj.t_busi_supplies_reserve IS '应急物资和储备表';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."guid" IS '数据id';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."material_type" IS '物资和装备分类';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."material_name" IS '物资和装备名称';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."material_num" IS '物资和装备数量';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."company" IS '规格单位';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."provide_time" IS '配备时间';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."desposit_site" IS '存放位置';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."org_guid" IS '填报人所在机构guid';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."creper_guid" IS '填报人guid';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."create_time" IS '填报时间';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."specs" IS '规格';
COMMENT ON COLUMN slaj.t_busi_supplies_reserve."admin_org" IS '管理单位';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_TEAM_INFO  →  新表: slaj.t_busi_team_info
-- 表说明: 应急队伍信息表
-- 列数: 11
-- ============================================================

CREATE TABLE slaj.t_busi_team_info
   (	"guid" CHAR(32),
	"team_name" VARCHAR(100),
	"team_pernum" DECIMAL(38,0),
	"team_leader" VARCHAR(100),
	"leader_phone" VARCHAR(300),
	"team_res" VARCHAR(200),
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP
   ) ;

COMMENT ON TABLE slaj.t_busi_team_info IS '应急队伍信息表';
COMMENT ON COLUMN slaj.t_busi_team_info."guid" IS '数据id';
COMMENT ON COLUMN slaj.t_busi_team_info."team_name" IS '队伍名称';
COMMENT ON COLUMN slaj.t_busi_team_info."team_pernum" IS '队伍人数';
COMMENT ON COLUMN slaj.t_busi_team_info."team_leader" IS '队伍负责人';
COMMENT ON COLUMN slaj.t_busi_team_info."leader_phone" IS '负责人电话';
COMMENT ON COLUMN slaj.t_busi_team_info."team_res" IS '队伍主要职责';
COMMENT ON COLUMN slaj.t_busi_team_info."org_guid" IS '填报机构guid';
COMMENT ON COLUMN slaj.t_busi_team_info."creper_guid" IS '创建人guid';
COMMENT ON COLUMN slaj.t_busi_team_info."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_team_info."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.t_busi_team_info."update_time" IS '修改时间';

-- ============================================================
-- 原表: SLAJ_ROHS.T_BUSI_TRAIN_RECORD  →  新表: slaj.t_busi_train_record
-- 表说明: 应急培训记录表
-- 列数: 13
-- ============================================================

CREATE TABLE slaj.t_busi_train_record
   (	"guid" CHAR(32),
	"train_topics" VARCHAR(100),
	"attendance" DECIMAL(38,0),
	"train_location" VARCHAR(100),
	"train_type" CHAR(1),
	"train_start" TIMESTAMP,
	"train_end" TIMESTAMP,
	"org_guid" CHAR(32),
	"creper_guid" CHAR(32),
	"create_time" TIMESTAMP,
	"updper_guid" CHAR(32),
	"update_time" TIMESTAMP,
	"is_special_train" CHAR(1)
   ) ;

COMMENT ON TABLE slaj.t_busi_train_record IS '应急培训记录表';
COMMENT ON COLUMN slaj.t_busi_train_record."guid" IS '数据id';
COMMENT ON COLUMN slaj.t_busi_train_record."train_topics" IS '培训主题';
COMMENT ON COLUMN slaj.t_busi_train_record."attendance" IS '参加人数';
COMMENT ON COLUMN slaj.t_busi_train_record."train_location" IS '培训地点';
COMMENT ON COLUMN slaj.t_busi_train_record."train_type" IS '培训方式';
COMMENT ON COLUMN slaj.t_busi_train_record."train_start" IS '培训开始时间';
COMMENT ON COLUMN slaj.t_busi_train_record."train_end" IS '培训结束时间';
COMMENT ON COLUMN slaj.t_busi_train_record."org_guid" IS '填报机构guid';
COMMENT ON COLUMN slaj.t_busi_train_record."creper_guid" IS '创建人guid';
COMMENT ON COLUMN slaj.t_busi_train_record."create_time" IS '创建时间';
COMMENT ON COLUMN slaj.t_busi_train_record."updper_guid" IS '修改人guid';
COMMENT ON COLUMN slaj.t_busi_train_record."update_time" IS '修改时间';
COMMENT ON COLUMN slaj.t_busi_train_record."is_special_train" IS '是否为特别训练';

-- ============================================================
-- 原表: SLAJ_ROHS.T_CON_SAFE_ENU  →  新表: slaj.t_con_safe_enu
-- 表说明: 安监枚举表
-- 列数: 7
-- ============================================================

CREATE TABLE slaj.t_con_safe_enu
   (	"guid" CHAR(32),
	"busi_model" VARCHAR(100),
	"busi_feild" VARCHAR(100),
	"code_value" VARCHAR(100),
	"code_name" VARCHAR(100),
	"model_name" VARCHAR(200),
	"feild_name" VARCHAR(200)
   ) ;

COMMENT ON TABLE slaj.t_con_safe_enu IS '安监枚举表';
COMMENT ON COLUMN slaj.t_con_safe_enu."guid" IS '主键';
COMMENT ON COLUMN slaj.t_con_safe_enu."busi_model" IS '业务表';
COMMENT ON COLUMN slaj.t_con_safe_enu."busi_feild" IS '业务字段';
COMMENT ON COLUMN slaj.t_con_safe_enu."code_value" IS '枚举值';
COMMENT ON COLUMN slaj.t_con_safe_enu."code_name" IS '枚举含义';
COMMENT ON COLUMN slaj.t_con_safe_enu."model_name" IS '模型名';
COMMENT ON COLUMN slaj.t_con_safe_enu."feild_name" IS '字段名';

-- ============================================================
-- 原表: SLAJ_ROHS.T_CON_SLAJ_LOG  →  新表: slaj.t_con_slaj_log
-- 列数: 27
-- ============================================================

CREATE TABLE slaj.t_con_slaj_log
   (	"id" CHAR(32),
	"user_id" VARCHAR(100),
	"user_name" VARCHAR(500),
	"org_guid" CHAR(32),
	"ad_code" CHAR(12),
	"operator_ip" VARCHAR(1000),
	"description" VARCHAR(500),
	"source" CHAR(1),
	"opt_type" CHAR(1),
	"state" CHAR(1),
	"opt_cont" VARCHAR(2000),
	"request_url" VARCHAR(2000),
	"request_class_name" VARCHAR(2000),
	"request_method_name" VARCHAR(2000),
	"time_take" TIMESTAMP,
	"details" VARCHAR(2000),
	"opt_time" TIMESTAMP,
	"remarks" VARCHAR(1000),
	"abno_infor" TEXT,
	"role_id" TEXT,
	"org_code" VARCHAR(20),
	"iphone" VARCHAR(20),
	"role_names" TEXT,
	"operate_param" TEXT,
	"sign_data" VARCHAR(100) ,
	"data_sign" VARCHAR(100),
	"sign_verify" DECIMAL(38,0)
   ) ;

COMMENT ON COLUMN slaj.t_con_slaj_log."id" IS '32位数据uuid';
COMMENT ON COLUMN slaj.t_con_slaj_log."user_id" IS '当前操作人身份证号码';
COMMENT ON COLUMN slaj.t_con_slaj_log."user_name" IS '当前操作人姓名';
COMMENT ON COLUMN slaj.t_con_slaj_log."org_guid" IS '当前机构的guid';
COMMENT ON COLUMN slaj.t_con_slaj_log."ad_code" IS '当前操作人行政区编码';
COMMENT ON COLUMN slaj.t_con_slaj_log."operator_ip" IS '当前操作人IP';
COMMENT ON COLUMN slaj.t_con_slaj_log."description" IS '操作描述（执行的操作）';
COMMENT ON COLUMN slaj.t_con_slaj_log."source" IS '数据来源（1.web，2.APP）';
COMMENT ON COLUMN slaj.t_con_slaj_log."opt_type" IS '操作（L.登录，O.注销,S.搜索，E.编辑，D.删除，V.查看，A.新增，X.下载模板，Z.导入数据，T.审核）';
COMMENT ON COLUMN slaj.t_con_slaj_log."state" IS '数据操作状态（0.error,1.success）';
COMMENT ON COLUMN slaj.t_con_slaj_log."opt_cont" IS '业务模块（存储编码例集中供水工程NY_1、行业概况NY_2）';
COMMENT ON COLUMN slaj.t_con_slaj_log."request_url" IS '请求URL';
COMMENT ON COLUMN slaj.t_con_slaj_log."request_class_name" IS '请求类名称';

-- ============================================================
-- 原表: SLAJ_ROHS.T_DICT_SCOR_CERTI  →  新表: slaj.t_dict_scor_certi
-- 列数: 12
-- ============================================================

CREATE TABLE slaj.t_dict_scor_certi
   (	"guid" CHAR(32),
	"org_guid" CHAR(32),
	"scor_guid" CHAR(32),
	"certi_guid" CHAR(32),
	"create_per" VARCHAR(100),
	"create_time" TIMESTAMP,
	"update_per" VARCHAR(100),
	"update_time" TIMESTAMP,
	"create_org" VARCHAR(100),
	"punish_guid" CHAR(32),
	"str_to_date" TIMESTAMP,
	"pun_status" CHAR(1)
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_DICT_SCOR_PUNISH  →  新表: slaj.t_dict_scor_punish
-- 列数: 8
-- ============================================================

CREATE TABLE slaj.t_dict_scor_punish
   (	"guid" CHAR(32),
	"big_type" VARCHAR(255),
	"mid_type" VARCHAR(255),
	"small_type" VARCHAR(1000),
	"score" VARCHAR(100),
	"stand_org" CHAR(32),
	"stand_name" VARCHAR(200),
	"stand_simple" VARCHAR(100)
   ) ;

COMMENT ON COLUMN slaj.t_dict_scor_punish."guid" IS '主键';
COMMENT ON COLUMN slaj.t_dict_scor_punish."big_type" IS '大类';
COMMENT ON COLUMN slaj.t_dict_scor_punish."mid_type" IS '中类';
COMMENT ON COLUMN slaj.t_dict_scor_punish."small_type" IS '小类';
COMMENT ON COLUMN slaj.t_dict_scor_punish."score" IS '分值（分;次）';
COMMENT ON COLUMN slaj.t_dict_scor_punish."stand_org" IS '标准机构guid';
COMMENT ON COLUMN slaj.t_dict_scor_punish."stand_name" IS '标准名称';
COMMENT ON COLUMN slaj.t_dict_scor_punish."stand_simple" IS '大类简称';

-- ============================================================
-- 原表: SLAJ_ROHS.T_SSO_USERROLE_SM3  →  新表: slaj.t_sso_userrole_sm3
-- 列数: 4
-- ============================================================

CREATE TABLE slaj.t_sso_userrole_sm3
   (	"id" CHAR(32),
	"sign_data" VARCHAR(100),
	"user_id" CHAR(32),
	"role_info" TEXT
   ) ;

-- ============================================================
-- 原表: SLAJ_ROHS.T_SSO_USER_SM3  →  新表: slaj.t_sso_user_sm3
-- 列数: 3
-- ============================================================

CREATE TABLE slaj.t_sso_user_sm3
   (	"id" CHAR(32),
	"sign_data" VARCHAR(100),
	"user_id" CHAR(32)
   ) ;

