 drop table  YJPT_BW ;
 drop table   YJPT_GKWXHWZYFZBLHHZ ;
 drop table   YJPT_GKWXHWZYFZBL_FZ ;
 drop table  YJPT_WXHWPMB ;
 drop table  YJPT_WXHWGKZYSBD ;
--泊位
create table YJPT_BW
(
  id            VARCHAR2(25) not null,
  szd           VARCHAR2(50),
  szgq          VARCHAR2(50),
  qymc        VARCHAR2(200),
  mtmc       VARCHAR2(200),
  bwmc       VARCHAR2(100),
  bwsx        	VARCHAR2(20),
  bwszsx       VARCHAR2(20),
  fwlx         VARCHAR2(20),
  tcnf          NUMBER,
  jgxs         VARCHAR2(20),
  sclx         VARCHAR2(20),
  jgysnf        NUMBER,
  qysjsh        VARCHAR2(100),
  qysjss        VARCHAR2(100),
  bwcd          VARCHAR2(100),
  wxpbw         CHAR(1),
  sjtgnl        VARCHAR2(100),
  sjkpnl        VARCHAR2(100),
  nhwtgml       VARCHAR2(100),
  nwxhwttl      VARCHAR2(100),
  zyhbwfl       VARCHAR2(20),
  jd            VARCHAR2(30),
  wd            VARCHAR2(30),
  sffz          CHAR(1),
  bwyt          VARCHAR2(30),
  zyrkfw        VARCHAR2(400),
  add_user      VARCHAR2(50),
  add_date      TIMESTAMP(6),
  update_user   VARCHAR2(50),
  update_date   TIMESTAMP(6),
  record_status NUMBER default 0,
  jtjgisdyidh   VARCHAR2(40),
  hckpnl        VARCHAR2(100),
  zwbwyt      VARCHAR2(250),
  bwdm 		VARCHAR2(10)  
);
comment on table YJPT_BW
  is '泊位';
comment on column YJPT_BW.id  is 'ID';
comment on column YJPT_BW.szd  is '所在地';
comment on column YJPT_BW.szgq  is '所在港区';
comment on column YJPT_BW.qymc  is '企业名称';
comment on column YJPT_BW.mtmc  is '码头名称';
comment on column YJPT_BW.bwmc  is '泊位名称';
comment on column YJPT_BW.bwsx  is '泊位属性';
comment on column YJPT_BW.bwszsx  is '泊位所在水系';
comment on column YJPT_BW.fwlx  is '服务类型';
comment on column YJPT_BW.tcnf  is '投产年份';
comment on column YJPT_BW.jgxs  is '结构型式';
comment on column YJPT_BW.sclx  is '生产类型';
comment on column YJPT_BW.jgysnf  is '竣工验收年份';
comment on column YJPT_BW.qysjsh  is '前沿设计水深';
comment on column YJPT_BW.qysjss  is '前沿实际水深';
comment on column YJPT_BW.bwcd  is '泊位长度';
comment on column YJPT_BW.wxpbw  is '危险品泊位';
comment on column YJPT_BW.sjtgnl  is '设计通过能力';
comment on column YJPT_BW.sjkpnl  is '设计靠泊能力（吨级）';
comment on column YJPT_BW.nhwtgml  is '年货物通过能力';
comment on column YJPT_BW.nwxhwttl  is '年危险货物吞吐量';
comment on column YJPT_BW.zyhbwfl  is '专业化泊位分类';
comment on column YJPT_BW.jd  is '经度';
comment on column YJPT_BW.wd  is '纬度';
comment on column YJPT_BW.sffz  is '是否发证';
comment on column YJPT_BW.bwyt  is '泊位用途';
comment on column YJPT_BW.zyrkfw  is '作业认可范围';
comment on column YJPT_BW.add_user  is '创建人';
comment on column YJPT_BW.add_date  is '创建时间';
comment on column YJPT_BW.update_user  is '修改人';
comment on column YJPT_BW.update_date  is '修改时间';
comment on column YJPT_BW.record_status  is '删除状态';
comment on column YJPT_BW.hckpnl  is '核查靠泊能力';
comment on column YJPT_BW.zwbwyt  is '泊位用途显示';
alter table YJPT_BW
  add constraint PK_YJPT_BW primary key (ID);
  
  --附证申请（主表）
  create table YJPT_GKWXHWZYFZBLHHZ
(
  id            VARCHAR2(25) not null,
  qymc          VARCHAR2(200),
  szd           VARCHAR2(50),
  ssgq          VARCHAR2(50),
  dz            VARCHAR2(2000),
  fddbr         VARCHAR2(200),
  aqgljg        VARCHAR2(200),
  aqfz          VARCHAR2(200),
  gqgljgfzrxm   VARCHAR2(200),
  gqgljgfzrzc   VARCHAR2(200),
  gqgljgfzrlxdh VARCHAR2(20),
  gqgljgfzrdzyx VARCHAR2(200),
  add_user      VARCHAR2(50),
  add_date      TIMESTAMP(6),
  update_user   VARCHAR2(50),
  update_date   TIMESTAMP(6),
  record_status NUMBER default 0,
  zycs          VARCHAR2(50),
  cq            VARCHAR2(50),
  zyfs         VARCHAR2(200),
  whdj         VARCHAR2(50),
  zywxhwpm      VARCHAR2(4000),
  bh            VARCHAR2(2000),
  blbh   VARCHAR2(50),
  sqtbrq        TIMESTAMP(6),
  fzsj          TIMESTAMP(6),
  fzfzrq        TIMESTAMP(6),
  fzgkjyxkzh    VARCHAR2(20),
  fzzycs        VARCHAR2(20),
  fzcsbh        VARCHAR2(50),
  fzqynbbh      VARCHAR2(20),
  fzjg          VARCHAR2(100),
  yxqkssj       TIMESTAMP(6),
  yxqjssj       TIMESTAMP(6),
  qynbbh        VARCHAR2(50),
  gkjyxkz       VARCHAR2(400)
)
;
comment on table YJPT_GKWXHWZYFZBLHHZ
  is '港口危险货物作业"附证" 办理或换证申请表';
comment on column YJPT_GKWXHWZYFZBLHHZ.qymc
  is '企业名称';
comment on column YJPT_GKWXHWZYFZBLHHZ.szd
  is '所在地';
comment on column YJPT_GKWXHWZYFZBLHHZ.ssgq
  is '所属港区';
comment on column YJPT_GKWXHWZYFZBLHHZ.dz
  is '地址';
comment on column YJPT_GKWXHWZYFZBLHHZ.fddbr
  is '法定代表人';
comment on column YJPT_GKWXHWZYFZBLHHZ.aqgljg
  is '安全管理机构';
comment on column YJPT_GKWXHWZYFZBLHHZ.aqfz
  is '安全副总';
comment on column YJPT_GKWXHWZYFZBLHHZ.gqgljgfzrxm
  is '安全管理机构负责人信息  姓名';
comment on column YJPT_GKWXHWZYFZBLHHZ.gqgljgfzrzc
  is '安全管理机构负责人信息  职称';
comment on column YJPT_GKWXHWZYFZBLHHZ.gqgljgfzrlxdh
  is '安全管理机构负责人信息  联系电话';
comment on column YJPT_GKWXHWZYFZBLHHZ.gqgljgfzrdzyx
  is '安全管理机构负责人信息  电子邮箱';
comment on column YJPT_GKWXHWZYFZBLHHZ.add_user
  is '创建人';
comment on column YJPT_GKWXHWZYFZBLHHZ.add_date
  is '创建时间';
comment on column YJPT_GKWXHWZYFZBLHHZ.update_user
  is '修改人';
comment on column YJPT_GKWXHWZYFZBLHHZ.update_date
  is '修改时间';
comment on column YJPT_GKWXHWZYFZBLHHZ.record_status
  is '删除状态';
comment on column YJPT_GKWXHWZYFZBLHHZ.zycs
  is '作业场所';
comment on column YJPT_GKWXHWZYFZBLHHZ.cq
  is '产权';
comment on column YJPT_GKWXHWZYFZBLHHZ.zyfs
  is '作业方式';
comment on column YJPT_GKWXHWZYFZBLHHZ.whdj
  is '危货等级';
comment on column YJPT_GKWXHWZYFZBLHHZ.zywxhwpm
  is '作业危险货物品名';
comment on column YJPT_GKWXHWZYFZBLHHZ.bh
  is '编号';
  comment on column YJPT_GKWXHWZYFZBLHHZ.blbh
  is '办理编号';
comment on column YJPT_GKWXHWZYFZBLHHZ.sqtbrq
  is '填报日期';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzsj
  is '发证时间';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzfzrq
  is '发证日期';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzgkjyxkzh
  is '港口经营许可证号';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzzycs
  is '作业场所';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzcsbh
  is '附证场所编号';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzqynbbh
  is '企业内部编号';
comment on column YJPT_GKWXHWZYFZBLHHZ.fzjg
  is '发证机关';
comment on column YJPT_GKWXHWZYFZBLHHZ.yxqkssj
  is '有效期开始时间';
comment on column YJPT_GKWXHWZYFZBLHHZ.yxqjssj
  is '有效期结束时间';
comment on column YJPT_GKWXHWZYFZBLHHZ.qynbbh
  is '企业内部编号';
comment on column YJPT_GKWXHWZYFZBLHHZ.gkjyxkz
  is '港口经营许可证号';
alter table YJPT_GKWXHWZYFZBLHHZ
  add constraint PK_YJPT_GKWXHWZYFZBLHHZ primary key (ID);

  --附证信息表（子表）
  create table YJPT_GKWXHWZYFZBL_FZ
(
  id            VARCHAR2(25) not null,
  zycs          VARCHAR2(20),
  fzcsbh        VARCHAR2(100),
  qynbbh        VARCHAR2(100),
  fzsq          VARCHAR2(25),
  add_user      VARCHAR2(50),
  add_date      TIMESTAMP(6),
  update_user   VARCHAR2(50),
  update_date   TIMESTAMP(6),
  record_status NUMBER default 1,
  qynbmc        VARCHAR2(100),
  jyr          VARCHAR2(200),
  wxhwm      VARCHAR2(2000),
  SZD 			VARCHAR2(50)
)
;
comment on table YJPT_GKWXHWZYFZBL_FZ
is '附证信息表';
comment on column YJPT_GKWXHWZYFZBL_FZ.zycs
  is '作业场所id';
comment on column YJPT_GKWXHWZYFZBL_FZ.fzcsbh
  is '附证场所编号';
comment on column YJPT_GKWXHWZYFZBL_FZ.qynbbh
  is '企业内部编号';
comment on column YJPT_GKWXHWZYFZBL_FZ.fzsq
  is '原附证申请id';
comment on column YJPT_GKWXHWZYFZBL_FZ.jyr
  is '关联的经营人';
comment on column YJPT_GKWXHWZYFZBL_FZ.wxhwm
  is '允许作业的危险货物品名';
alter table YJPT_GKWXHWZYFZBL_FZ
  add constraint PK_YJPT_GKWXHWZYFZBL_FZ primary key (ID);

  --危险品名表
  create table YJPT_WXHWPMB
(
  id            VARCHAR2(25) not null,
  bh            VARCHAR2(10),
  mchsm         VARCHAR2(200),
  un            VARCHAR2(10),
  sm         VARCHAR2(200),
  ywmc          VARCHAR2(500),
  lbhxb         VARCHAR2(100),
  cywxx         VARCHAR2(100),
  bzlb          VARCHAR2(50),
  bz            VARCHAR2(200),
  add_user      VARCHAR2(50),
  add_date      TIMESTAMP(6),
  update_user   VARCHAR2(50),
  update_date   TIMESTAMP(6),
  record_status VARCHAR2(10) default '0',
  lhxz          VARCHAR2(512),
  aqffcs        VARCHAR2(1000),
  szd           VARCHAR2(50),
  hzwxx      VARCHAR2(50),
  dxdj          VARCHAR2(50),
  wrlb          VARCHAR2(50)
)
;
comment on table YJPT_GKWXHWZYFZBL_FZ
  is '危险品名表';
comment on column YJPT_WXHWPMB.id
  is 'ID';
comment on column YJPT_WXHWPMB.bh
  is '编号';
comment on column YJPT_WXHWPMB.mchsm
  is '名称和说明(中文名称)';
  comment on column YJPT_WXHWPMB.un
  is 'un';
comment on column YJPT_WXHWPMB.sm
  is '名称和说明';
comment on column YJPT_WXHWPMB.ywmc
  is '英文名称';
comment on column YJPT_WXHWPMB.lbhxb
  is '类别和项别';
comment on column YJPT_WXHWPMB.cywxx
  is '次要危险性';
comment on column YJPT_WXHWPMB.bzlb
  is '包装类别';
comment on column YJPT_WXHWPMB.bz
  is '备注';
comment on column YJPT_WXHWPMB.add_user
  is '创建人';
comment on column YJPT_WXHWPMB.add_date
  is '创建时间';
comment on column YJPT_WXHWPMB.update_user
  is '修改人';
comment on column YJPT_WXHWPMB.update_date
  is '修改时间';
comment on column YJPT_WXHWPMB.record_status
  is '删除状态';
comment on column YJPT_WXHWPMB.lhxz
  is '理化性质';
comment on column YJPT_WXHWPMB.aqffcs
  is '防范措施';
comment on column YJPT_WXHWPMB.szd
  is 'SZD';
comment on column YJPT_WXHWPMB.hzwxx
  is '火灾危险性';
comment on column YJPT_WXHWPMB.dxdj
  is '毒性等级';
comment on column YJPT_WXHWPMB.wrlb
  is '污染类别';
  comment on column YJPT_WXHWPMB.bzlb
  is '包装类别';
alter table YJPT_WXHWPMB
  add constraint PK_YJPT_WXHWPMB primary key (ID);
  
  --危险货物作业申报单
  create table YJPT_WXHWGKZYSBD
(
  id            VARCHAR2(25) not null,
  zywtr         VARCHAR2(100),
  xcglfzr       VARCHAR2(20),
  add_user      VARCHAR2(50),
  add_date      TIMESTAMP(6),
  update_user   VARCHAR2(50),
  update_date   TIMESTAMP(6),
  record_status NUMBER,
  gq             VARCHAR2(50),
  bh            VARCHAR2(50),
  szd            VARCHAR2(50),
  zydw          VARCHAR2(200),
  cm            VARCHAR2(200),
  wxplb         VARCHAR2(200),
  wxwpmc        VARCHAR2(200),
  wpbh          VARCHAR2(200),
  jcg           VARCHAR2(200),
  zysl          NUMBER(*,3),
  lhxz          VARCHAR2(2000),
  zysj          TIMESTAMP(6),
  zydd          VARCHAR2(20),
  aqffcs        VARCHAR2(2000),
  bgr           VARCHAR2(40),
  lxfs          VARCHAR2(400),
  bgsj          TIMESTAMP(6),
  zyddqybh      VARCHAR2(20),
  szgq          VARCHAR2(50),
  kpsj          TIMESTAMP(6),
  zylx          VARCHAR2(100),
  sg            VARCHAR2(100),
  xg            VARCHAR2(100),
  kgsj          TIMESTAMP(6),
  wgsj          TIMESTAMP(6),
  kgzt          CHAR(1),
  wgzt          CHAR(1),
  gjbh          VARCHAR2(100),
  zysjq         TIMESTAMP(6),
  zysjz         TIMESTAMP(6),
  qxzysj        TIMESTAMP(6),
  zyddqt        VARCHAR2(50),
  wxhwmcbh      VARCHAR2(200),
  inorout       CHAR(1),
  hwzl         VARCHAR2(20),
  jzxsl       VARCHAR2(15),
  hwxs		VARCHAR2(100),
  hc             VARCHAR2(40),
  cbbh          VARCHAR2(20),
  cnno          VARCHAR2(100),
  hzwxx       VARCHAR2(50),
  dxdj            VARCHAR2(50),
  wrlb              VARCHAR2(50),
  mao             VARCHAR2(10),
  SL20C     NUMBER,
  SL40C     NUMBER,
  SL45C     NUMBER,
  SLSPC     NUMBER,
  SL20T     NUMBER,
  SL40T     NUMBER,
  TEU     NUMBER，
  ywcm   VARCHAR2(100),
   bzlb          VARCHAR2(50)
);
comment on table YJPT_WXHWGKZYSBD
  is '危险货物港口作业申请';
comment on column YJPT_WXHWGKZYSBD.id
  is 'ID';
comment on column YJPT_WXHWGKZYSBD.zywtr
  is '作业委托人';
comment on column YJPT_WXHWGKZYSBD.xcglfzr
  is '现场管理负责人';
comment on column YJPT_WXHWGKZYSBD.add_user
  is '创建人';
comment on column YJPT_WXHWGKZYSBD.add_date
  is '创建时间';
comment on column YJPT_WXHWGKZYSBD.update_user
  is '修改人';
comment on column YJPT_WXHWGKZYSBD.update_date
  is '修改时间';
comment on column YJPT_WXHWGKZYSBD.record_status
  is '删除状态';
comment on column YJPT_WXHWGKZYSBD.bh
  is '编号';
comment on column YJPT_WXHWGKZYSBD.szd
  is '所在地';
comment on column YJPT_WXHWGKZYSBD.zydw
  is '作业单位';
comment on column YJPT_WXHWGKZYSBD.cm
  is '船名';
comment on column YJPT_WXHWGKZYSBD.wxplb
  is '危险品类别';
comment on column YJPT_WXHWGKZYSBD.wxwpmc
  is '危险物品名称';
comment on column YJPT_WXHWGKZYSBD.wpbh
  is '物品编号';
comment on column YJPT_WXHWGKZYSBD.jcg
  is '进出港';
comment on column YJPT_WXHWGKZYSBD.zysl
  is '作业数量（吨）';
comment on column YJPT_WXHWGKZYSBD.lhxz
  is '理化性质';
comment on column YJPT_WXHWGKZYSBD.zysj
  is '作业时间';
comment on column YJPT_WXHWGKZYSBD.zydd
  is '作业地点';
comment on column YJPT_WXHWGKZYSBD.aqffcs
  is '安全防范措施';
comment on column YJPT_WXHWGKZYSBD.bgr
  is '报告人';
comment on column YJPT_WXHWGKZYSBD.lxfs
  is '联系方式';
comment on column YJPT_WXHWGKZYSBD.bgsj
  is '报告时间';
comment on column YJPT_WXHWGKZYSBD.zyddqybh
  is '作业场所选择企业内部编号';
comment on column YJPT_WXHWGKZYSBD.kpsj
  is '靠泊时间';
comment on column YJPT_WXHWGKZYSBD.zylx
  is '作业类型';
comment on column YJPT_WXHWGKZYSBD.sg
  is '上港';
comment on column YJPT_WXHWGKZYSBD.xg
  is '下港';
comment on column YJPT_WXHWGKZYSBD.kgsj
  is '开工时间';
comment on column YJPT_WXHWGKZYSBD.wgsj
  is '完工时间';
comment on column YJPT_WXHWGKZYSBD.kgzt
  is '开工状态';
comment on column YJPT_WXHWGKZYSBD.wgzt
  is '完工状态';
comment on column YJPT_WXHWGKZYSBD.gjbh
  is '国际编号';
comment on column YJPT_WXHWGKZYSBD.zysjq
  is '作业时间起';
comment on column YJPT_WXHWGKZYSBD.zysjz
  is '作业时间止';
comment on column YJPT_WXHWGKZYSBD.qxzysj
  is '取消作业时间';
comment on column YJPT_WXHWGKZYSBD.zyddqt
  is '作业地点其他的选项';
comment on column YJPT_WXHWGKZYSBD.wxhwmcbh
  is '危险货物品种编号';
comment on column YJPT_WXHWGKZYSBD.inorout
  is '进或者出港';
comment on column YJPT_WXHWGKZYSBD.hwzl
  is '货物种类';
comment on column YJPT_WXHWGKZYSBD.jzxsl
  is '集装箱数量';
comment on column YJPT_WXHWGKZYSBD.hwxs
  is '货物形式';
comment on column YJPT_WXHWGKZYSBD.hc
  is '航次';
comment on column YJPT_WXHWGKZYSBD.cbbh 
  is '船舶编号';
comment on column YJPT_WXHWGKZYSBD.cnno
  is '物品CN编码';
comment on column YJPT_WXHWGKZYSBD.hzwxx
  is '火灾危险性';
comment on column YJPT_WXHWGKZYSBD.dxdj
  is '毒性等级';
comment on column YJPT_WXHWGKZYSBD.wrlb
  is '污染类别';
  comment on column YJPT_WXHWGKZYSBD.bzlb
  is '包装类别';
comment on column YJPT_WXHWGKZYSBD.mao
  is '内贸外贸';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SL20C 
 IS '20''集装箱数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SL40C 
 IS '40''集装箱数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SL45C
 IS '45''集装箱数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SLSPC
 IS '特种集装箱数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SL20T 
 IS '20''罐柜数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.SL40T 
 IS '40''罐柜数量';
COMMENT ON COLUMN YJPT_WXHWGKZYSBD.TEU
 IS 'TEU';
 COMMENT ON COLUMN YJPT_WXHWGKZYSBD.YWCM
 IS '英文船名';
alter table YJPT_WXHWGKZYSBD
  add constraint PK_YJPT_WXHWGKZYSBD primary key (ID);
  