2025_11_30_cxf_creat.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. -- auto-generated definition
  2. create table kwt_logistics_order_unit
  3. (
  4. id bigint not null comment '主键'
  5. primary key,
  6. l_order_id bigint not null comment '物流订单id(kwt_logistics_order的主键id)',
  7. unit_type int not null comment '单位类型(1托运企业、2承运企业)',
  8. top_ent_id bigint null comment '顶级企业ID',
  9. ent_id bigint not null comment '企业id',
  10. firm_name varchar(100) not null comment '企业名称',
  11. contacts_id bigint null comment '联系人ID',
  12. contacts varchar(40) null comment '联系人姓名',
  13. phone varchar(40) null comment '联系电话',
  14. remark varchar(400) null comment '备注',
  15. status int default 0 not null comment '用户状态(0正常、1已锁)',
  16. create_by bigint not null,
  17. create_time datetime not null,
  18. update_by bigint not null,
  19. update_time datetime not null comment '更新时间',
  20. del_flag int default 0 not null comment '是否删除(0未删除,1删除)'
  21. )
  22. comment '物流订单-托运企业/承运企业' row_format = DYNAMIC;
  23. -- auto-generated definition
  24. create table kwt_waybill_order
  25. (
  26. id bigint not null comment '主键'
  27. primary key,
  28. ent_id bigint not null comment '企业id',
  29. l_order_id bigint not null comment '物流订单id',
  30. w_order_no varchar(30) not null comment '编号',
  31. type int not null comment '派车类型(1:趟次:2:循环)',
  32. truck_id bigint null comment '车辆档案ID',
  33. truck_no varchar(20) not null comment '车牌号',
  34. driver_id bigint null comment '司机id',
  35. driver_name varchar(40) null comment '司机姓名',
  36. driver_phone varchar(20) null comment '司机手机号',
  37. driver_idcard varchar(20) null comment '司机身份证号码',
  38. remark varchar(400) null comment '备注',
  39. status int default 0 not null comment '状态(1-接单,5-到达装货点,10-已装货,15-已离场,20-已卸货,25-已完成,30-审核驳回,99-已作废)',
  40. create_by bigint not null,
  41. create_time datetime default CURRENT_TIMESTAMP not null,
  42. update_by bigint default -1 not null,
  43. update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间',
  44. del_flag int default 0 not null comment '是否删除(0未删除,1删除)',
  45. task_start_time datetime default '1000-01-01 00:00:00' not null comment '任务开始时间',
  46. task_end_time datetime default '1000-01-01 00:00:00' not null comment '任务结束时间'
  47. )
  48. comment '车辆运单' row_format = DYNAMIC;
  49. -- auto-generated definition
  50. create table kwt_waybill_order_subtask
  51. (
  52. id bigint not null comment '主键'
  53. primary key,
  54. ent_id bigint not null comment '企业id',
  55. l_order_id bigint not null comment '物流订单id(kwt_logistics_order)',
  56. w_order_id bigint not null comment '物流订单id',
  57. w_order_no varchar(30) not null comment '编号',
  58. unit varchar(10) null comment '托量单位',
  59. entrust_amount decimal(10, 6) null comment '已委托量',
  60. unload_amount decimal(10, 6) null comment '卸货重量',
  61. unload_time datetime null comment '卸货时间',
  62. load_amount decimal(10, 6) null comment '装货重量',
  63. load_time datetime null comment '装货时间',
  64. deficit_amount decimal(10, 6) null comment '亏吨重量',
  65. deficit_price decimal(10, 4) null comment '亏吨扣款',
  66. remark varchar(400) null comment '备注',
  67. status int default 0 not null comment '状态(1-接单,5-到达装货点,10-已装货,15-已离场,20-已卸货,25-已完成,30-审核驳回,99-已作废)',
  68. create_by bigint not null,
  69. create_time datetime not null,
  70. update_by bigint default -1 not null,
  71. update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间',
  72. del_flag int default 0 not null comment '是否删除(0未删除,1删除)',
  73. unload_url varchar(255) null comment '卸货凭证',
  74. unload_upload_time datetime null comment '凭证上传时间',
  75. unload_operator varchar(255) null comment '凭证上传操作人'
  76. )
  77. comment '车辆运单-子运单' row_format = DYNAMIC;
  78. -- auto-generated definition
  79. create table kwt_logistics_order_goods
  80. (
  81. id bigint not null comment '主键'
  82. primary key,
  83. l_order_id bigint not null comment '物流订单id',
  84. l_order_no varchar(64) not null comment '物流订单编号',
  85. goods_id bigint null comment '商品id',
  86. goods_name varchar(100) null comment '商品名称',
  87. goods_type varchar(32) null comment '商品类型',
  88. sku_id bigint null comment 'sku',
  89. remark varchar(400) null comment '备注',
  90. status int default 0 not null comment '用户状态(0正常、1已锁)',
  91. create_by bigint not null,
  92. create_time datetime not null,
  93. update_by bigint not null,
  94. update_time datetime not null comment '更新时间',
  95. del_flag int default 0 not null comment '是否删除(0未删除,1删除)'
  96. )
  97. comment '物流订单-商品信息' row_format = DYNAMIC;
  98. -- auto-generated definition
  99. create table kwt_logistics_order
  100. (
  101. id bigint not null comment '主键'
  102. primary key,
  103. ent_id bigint not null comment '企业id',
  104. t_order_id bigint null comment '交易订单id(kwo_trade_order)',
  105. t_order_no varchar(30) null comment '交易订单编号(kwo_trade_order)',
  106. l_order_no varchar(30) not null comment '物流订单编号',
  107. pid bigint null comment '分包上级物流订单id',
  108. pids varchar(100) null comment '存放分包所有物流订单id使用“;”分隔',
  109. type varchar(10) not null comment '物流订单类型(1 贸易订单生成物流订单、2 自建物流订单)',
  110. level varchar(255) null comment '代表分包等级',
  111. bind_status varchar(255) charset utf8 null comment '对账绑定状态(0未绑定/解绑:1绑定)',
  112. settlement_cycle bigint null comment '结算周期(周结、月结、季结)',
  113. billing_mode varchar(255) null comment '计费方式',
  114. price decimal(8, 2) null comment '运价',
  115. price_type bigint null comment '运价方式(元/吨、元/车)',
  116. amount decimal(10, 6) not null comment '已委托量(上游给他分配的量)',
  117. unit varchar(10) not null comment '单位(吨、方、箱、件)',
  118. loss decimal(8, 2) null comment '合理损耗',
  119. loss_unit varchar(20) null comment '合理损耗单位(‰/kG)',
  120. goods_price decimal(11, 2) null comment '商品价值(扣亏货值)((实装-实卸)-合理损耗)如果为负数,则为零',
  121. goods_price_unit varchar(20) null comment '商品价值(扣亏货值)单位',
  122. start_time datetime null comment '计划开始时间',
  123. end_time datetime null comment '计划结束时间',
  124. subcontract_amount decimal(11, 6) null comment '分包量(给下游承运商分包的量)',
  125. entrust_amount decimal(11, 6) null comment '已委托量(自己承运,给下游司机分配的量)',
  126. unload_amount decimal(11, 6) null comment '卸货量(自己承运总卸货量)',
  127. load_amount decimal(11, 6) null comment '装货量(自己承运总装货量)',
  128. ignore_amount decimal(11, 6) null comment '忽略剩余量',
  129. deficit_amount decimal(11, 6) null comment '亏吨量(自己承运总亏吨量:装货量-卸货量)',
  130. deficit_price decimal(11, 2) null comment '亏吨扣款(自己承运总亏吨扣款)',
  131. load_time datetime null comment '实际开始时间(装货)',
  132. unload_time datetime null comment '实际结束时间(卸货)',
  133. total_take int null comment '趟次(自己+下游承运总卸货量,算方式为趟次时,最终值以完结输入值为准)',
  134. total_load_amount decimal(11, 6) null comment '装货-履约量(自己+下游承运总装货量)',
  135. total_unload_amount decimal(11, 6) null comment '卸货-履约量(自己+下游承运总卸货量)',
  136. payment bigint null comment '付款方式(预付款、线下支付、第三方支付)',
  137. tax_rate decimal(6) null comment '发票税率(%)',
  138. remark varchar(200) null comment '备注',
  139. status int default 0 not null comment '0,待签约,1待接单',
  140. create_by bigint not null,
  141. create_time datetime not null,
  142. update_by bigint not null,
  143. update_time datetime not null comment '更新时间',
  144. del_flag int default 0 not null comment '是否删除(0未删除,1删除)'
  145. )
  146. comment '物流订单' row_format = DYNAMIC;