

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for t_dx_customs_detail
-- ----------------------------
DROP TABLE IF EXISTS `t_dx_customs_detail`;
CREATE TABLE `t_dx_customs_detail` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `customs_code` varchar(255) DEFAULT NULL COMMENT '缴款书号码',
  `taxno` varchar(255) DEFAULT NULL COMMENT '税号信息',
  `goods_name` varchar(255) DEFAULT NULL COMMENT '获取名称',
  `num` varchar(50) DEFAULT NULL COMMENT '数量',
  `detail_amount` varchar(50) DEFAULT NULL COMMENT '完税价格',
  `unit` varchar(50) DEFAULT NULL COMMENT '单位',
  `tax_rate` varchar(20) DEFAULT NULL COMMENT '税率',
  `tax_amount` varchar(20) DEFAULT NULL COMMENT '税款金额',
  `data_sources` varchar(255) DEFAULT NULL COMMENT '数据来源',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='海关缴款书明细';

-- ----------------------------
-- Table structure for t_dx_record_invoice_detail
-- ----------------------------
DROP TABLE IF EXISTS `t_dx_record_invoice_detail`;
CREATE TABLE `t_dx_record_invoice_detail` (
  `id` bigint(30) NOT NULL,
  `uuid` varchar(30) NOT NULL COMMENT '唯一标识(发票代码+发票号码)',
  `invoice_code` varchar(20) DEFAULT NULL COMMENT '发票代码',
  `invoice_no` varchar(10) DEFAULT NULL COMMENT '发票号码',
  `detail_no` varchar(20) DEFAULT NULL COMMENT '明细序号',
  `goods_name` varchar(255) DEFAULT NULL COMMENT '货物或应税劳务名称',
  `model` varchar(80) DEFAULT NULL COMMENT '规格型号',
  `unit` varchar(50) DEFAULT NULL COMMENT '单位',
  `num` varchar(50) DEFAULT NULL COMMENT '数量',
  `unit_price` varchar(50) DEFAULT NULL COMMENT '单价',
  `detail_amount` varchar(20) DEFAULT NULL COMMENT '金额',
  `tax_rate` varchar(20) DEFAULT NULL COMMENT '税率',
  `tax_amount` varchar(20) DEFAULT NULL COMMENT '税额',
  `cph` varchar(50) DEFAULT NULL COMMENT '车牌号',
  `lx` varchar(32) DEFAULT NULL COMMENT '类型',
  `txrqq` varchar(32) DEFAULT NULL COMMENT '通行日期起',
  `txrqz` varchar(32) DEFAULT NULL COMMENT '通行日期止',
  `goods_num` varchar(50) DEFAULT NULL COMMENT '商品编码',
  `is_discount` varchar(10) DEFAULT NULL COMMENT '是否折扣行',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `unique` (`invoice_code`,`invoice_no`) USING BTREE,
  KEY `uuid` (`uuid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='底账明细表';

-- ----------------------------
-- Table structure for t_dx_record_invoice_detail_sales
-- ----------------------------
DROP TABLE IF EXISTS `t_dx_record_invoice_detail_sales`;
CREATE TABLE `t_dx_record_invoice_detail_sales` (
  `id` bigint(30) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(30) NOT NULL COMMENT '唯一标识(发票代码+发票号码)',
  `invoice_code` varchar(20) DEFAULT NULL COMMENT '发票代码',
  `invoice_no` varchar(10) DEFAULT NULL COMMENT '发票号码',
  `detail_no` varchar(20) DEFAULT NULL COMMENT '明细序号',
  `goods_name` varchar(255) DEFAULT NULL COMMENT '货物或应税劳务名称',
  `model` varchar(80) DEFAULT NULL COMMENT '规格型号',
  `unit` varchar(50) DEFAULT NULL COMMENT '单位',
  `num` varchar(50) DEFAULT NULL COMMENT '数量',
  `unit_price` varchar(50) DEFAULT NULL COMMENT '单价',
  `detail_amount` varchar(20) DEFAULT NULL COMMENT '金额',
  `tax_rate` varchar(20) DEFAULT NULL COMMENT '税率',
  `tax_amount` varchar(20) DEFAULT NULL COMMENT '税额',
  `cph` varchar(50) DEFAULT NULL COMMENT '车牌号',
  `lx` varchar(32) DEFAULT NULL COMMENT '类型',
  `txrqq` varchar(32) DEFAULT NULL COMMENT '通行日期起',
  `txrqz` varchar(32) DEFAULT NULL COMMENT '通行日期止',
  `goods_num` varchar(50) DEFAULT NULL COMMENT '商品编码',
  `is_discount` varchar(10) DEFAULT NULL,
  `incentive_flag` varchar(100) DEFAULT NULL COMMENT '优惠政策标识',
  `zero_taxrate_flag` varchar(20) DEFAULT NULL COMMENT '零税率标识',
  `added_tax_special` varchar(20) DEFAULT NULL COMMENT '增值税特殊管理',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `unique` (`invoice_code`,`invoice_no`) USING BTREE,
  KEY `uuid` (`uuid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1455386695937372163 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='底账明细表-销项';
