demo.sql 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. -- 交际委托子表序列
  2. CREATE SEQUENCE seq_jycrkwt_sub
  3. START WITH 1
  4. INCREMENT BY 1
  5. MINVALUE 1
  6. NOMAXVALUE
  7. NOCYCLE
  8. CACHE 20;
  9. -- 委托书添加字段
  10. ALTER TABLE db_utf8:ty_jycrkwt ADD lscd varchar(100);
  11. ALTER TABLE db_utf8:ty_jycrkwt ADD wtrq date;
  12. ALTER TABLE db_utf8:ty_jycrkwt ADD bzq_first_date date;
  13. ALTER TABLE db_utf8:ty_jycrkwt ADD bzq_last_date date;
  14. ALTER TABLE db_utf8:ty_jycrkwt ADD wcsj date;
  15. ALTER TABLE db_utf8:ty_jycrkwt ADD gxcj DECIMAL(9,2);
  16. ALTER TABLE db_utf8:ty_jycrkwt ADD qybmyq varchar(200);
  17. ALTER TABLE db_utf8:ty_jycrkwt ADD qyzz varchar(20);
  18. ALTER TABLE db_utf8:ty_jycrkwt ADD commitment varchar(200);
  19. ALTER TABLE db_utf8:ty_jycrkwt ADD fhbz varchar(200);
  20. ALTER TABLE db_utf8:ty_jycrkwt ADD jyxmyq varchar(200);
  21. ALTER TABLE db_utf8:ty_jycrkwt ADD jjcz DECIMAL(9,2);
  22. ALTER TABLE db_utf8:ty_jycrkwt ADD bzyq varchar(200);
  23. ALTER TABLE db_utf8:ty_jycrkwt ADD jhfs varchar(20);
  24. ALTER TABLE db_utf8:ty_jycrkwt ADD jlfs varchar(20);
  25. ALTER TABLE db_utf8:ty_jycrkwt ADD rkyq varchar(20);
  26. ALTER TABLE db_utf8:ty_jycrkwt ADD sfbgyq varchar(200);
  27. ALTER TABLE db_utf8:ty_jycrkwt ADD ccjyxm varchar(200);
  28. ALTER TABLE db_utf8:ty_jycrkwt ADD crksx varchar(20);
  29. ALTER TABLE db_utf8:ty_jycrkwt ADD jsfs varchar(200);
  30. ALTER TABLE db_utf8:ty_jycrkwt ADD slr varchar(100);
  31. ALTER TABLE db_utf8:ty_jycrkwt ADD slryj varchar(200);
  32. ALTER TABLE db_utf8:ty_jycrkwt ADD slrq date;
  33. ALTER TABLE db_utf8:ty_jycrkwt ADD jyzxshr varchar(100);
  34. ALTER TABLE db_utf8:ty_jycrkwt ADD jyzxshryj varchar(200);
  35. ALTER TABLE db_utf8:ty_jycrkwt ADD jyzxshrq date;
  36. ALTER TABLE db_utf8:ty_jycrkwt ADD wtshr varchar(100);
  37. ALTER TABLE db_utf8:ty_jycrkwt ADD wtfqz text;
  38. ALTER TABLE db_utf8:ty_jycrkwt ADD wtfgzsj date;
  39. ALTER TABLE db_utf8:ty_jycrkwt ADD wtshsj date;
  40. comment on column db_utf8:ty_jycrkwt.lscd is '产地';
  41. comment on column db_utf8:ty_jycrkwt.wtrq is '委托日期';
  42. comment on column db_utf8:ty_jycrkwt.bzq_first_date is '保质期限 最早一批';
  43. comment on column db_utf8:ty_jycrkwt.bzq_last_date is '保质期限 最后一批';
  44. comment on column db_utf8:ty_jycrkwt.wcsj is '完成时间';
  45. comment on column db_utf8:ty_jycrkwt.gxcj is '购销价差';
  46. comment on column db_utf8:ty_jycrkwt.qybmyq is '报名企业要求';
  47. comment on column db_utf8:ty_jycrkwt.qyzz is '资质<br/> 1生产 2经营 3应急 4进口';
  48. comment on column db_utf8:ty_jycrkwt.commitment is '承诺';
  49. comment on column db_utf8:ty_jycrkwt.fhbz is '符合标准';
  50. comment on column db_utf8:ty_jycrkwt.jyxmyq is '检验项目要求';
  51. comment on column db_utf8:ty_jycrkwt.jjcz is '竞价差值';
  52. comment on column db_utf8:ty_jycrkwt.bzyq is '包装要求';
  53. comment on column db_utf8:ty_jycrkwt.jhfs is '交货方式<br/> 1库内价 2汽车车板价';
  54. comment on column db_utf8:ty_jycrkwt.jlfs is '计量方式<br/> 1地磅记录 2检斤计价 3其他';
  55. comment on column db_utf8:ty_jycrkwt.rkyq is '入库要求<br/> 1第三方报告 2出厂报告';
  56. comment on column db_utf8:ty_jycrkwt.sfbgyq is '第三方报告要求';
  57. comment on column db_utf8:ty_jycrkwt.ccjyxm is '出厂检验项目';
  58. comment on column db_utf8:ty_jycrkwt.crksx is '出入库顺序<br/> 1先出后入 2先入后出 3其他';
  59. comment on column db_utf8:ty_jycrkwt.jsfs is '结算方式';
  60. comment on column db_utf8:ty_jycrkwt.slr is '受理人';
  61. comment on column db_utf8:ty_jycrkwt.slryj is '受理人意见';
  62. comment on column db_utf8:ty_jycrkwt.slrq is '受理日期';
  63. comment on column db_utf8:ty_jycrkwt.jyzxshr is '审核人';
  64. comment on column db_utf8:ty_jycrkwt.jyzxshryj is '审核人意见';
  65. comment on column db_utf8:ty_jycrkwt.jyzxshrq is '审核人日期';
  66. comment on column db_utf8:ty_jycrkwt.wtshr is '委托审核人';
  67. comment on column db_utf8:ty_jycrkwt.wtfgzsj is '委托审核时间';
  68. comment on column db_utf8:ty_jycrkwt.wtfqz is '委托方盖章';
  69. comment on column db_utf8:ty_jycrkwt.wtshsj is '委托方盖章时间';
  70. -- 安排添加字段
  71. ALTER TABLE db_utf8:ty_jycrkap ADD sm varchar(20);
  72. ALTER TABLE db_utf8:ty_jycrkap ADD jgjd varchar(20);
  73. ALTER TABLE db_utf8:ty_jycrkap ADD hf varchar(20);
  74. ALTER TABLE db_utf8:ty_jycrkap ADD wcsj date;
  75. ALTER TABLE db_utf8:ty_jycrkap ADD rknl DECIMAL(9,3);
  76. ALTER TABLE db_utf8:ty_jycrkap ADD sfkc integer;
  77. comment on column db_utf8:ty_jycrkap.sm is '碎米';
  78. comment on column db_utf8:ty_jycrkap.jgjd is '加工精度';
  79. comment on column db_utf8:ty_jycrkap.hf is '灰分';
  80. comment on column db_utf8:ty_jycrkap.wcsj is '完成时间';
  81. comment on column db_utf8:ty_jycrkap.rknl is '入库能力';
  82. comment on column db_utf8:ty_jycrkap.sfkc is '是否空仓<br/> 0 否 1 是';
  83. lock table db_utf8:ty_jycrkwt in exclusive mode ;
  84. RENAME COLUMN db_utf8:ty_jycrkwt.jsfx TO jyfs ;
  85. ALTER TABLE db_utf8:ty_jycrkwt MODIFY jyfs INTEGER ;
  86. comment on column db_utf8:ty_jycrkwt.jyfs is '交易方式' ;
  87. RENAME COLUMN db_utf8:ty_jycrkwt.jylx TO jyfx ;
  88. ALTER TABLE db_utf8:ty_jycrkwt MODIFY jyfx INTEGER ;
  89. comment on column db_utf8:ty_jycrkwt.jyfx is '交易方向' ;
  90. commit work ;
  91. RENAME COLUMN db_utf8:ty_jycrkwt.jsfxmc TO jyfsmc ;
  92. RENAME COLUMN db_utf8:ty_jycrkwt.jylxmc TO jyfxmc ;
  93. ALTER TABLE db_utf8:ty_jycrkap ADD bd_group varchar(5);
  94. comment on column db_utf8:ty_jycrkap.bd_group is '标的分组';
  95. ALTER TABLE db_utf8:ty_jycrkap ADD bdh varchar(32);
  96. ALTER TABLE db_utf8:ty_jycrkap ADD bdbm varchar(32);
  97. comment on column db_utf8:ty_jycrkap.bdh is '标的号';
  98. comment on column db_utf8:ty_jycrkap.bdbm is '标的编码';
  99. ALTER TABLE db_utf8:ty_jycrkap ADD jydj DECIMAL(9,2);
  100. comment on column db_utf8:ty_jycrkap.jydj is '交易底价';
  101. ALTER TABLE db_utf8:ty_jycrkwt ADD hwggbt varchar(200) ;
  102. ALTER TABLE db_utf8:ty_jycrkwt ADD hwggzw text ;
  103. ALTER TABLE db_utf8:ty_jycrkwt ADD wcm_id1 int ;
  104. ALTER TABLE db_utf8:ty_jycrkwt ADD wcm_id2 int ;
  105. comment on column db_utf8:ty_jycrkwt.wcm_id1 is 'wcm反写的docid' ;
  106. comment on column db_utf8:ty_jycrkwt.wcm_id2 is 'wcm反写的docid' ;