上游MySQL表结构:
CREATE TABLE t_busi_detail
(
did
varchar(100) NOT NULL COMMENT ‘交易明细id’,
ewb_no
varchar(100) NOT NULL COMMENT ‘运单号’,
serial_no
varchar(100) DEFAULT NULL COMMENT ‘流水号’,
account_id
varchar(100) NOT NULL COMMENT ‘帐号id’,
deposit_site_id
bigint(20) NOT NULL COMMENT ‘开户行id’,
deposit_site_name
varchar(100) NOT NULL COMMENT ‘开户行名’,
site_id
bigint(20) NOT NULL COMMENT ‘开户网点id’,
site_name
varchar(100) NOT NULL COMMENT ‘开户网点名’,
distribution_site_id
bigint(20) NOT NULL COMMENT ‘开户户名所属分拨id’,
distribution_site_name
varchar(100) NOT NULL COMMENT ‘开户户名所属分拨名’,
account_type
int(11) NOT NULL COMMENT ‘账户类型’,
data_source
tinyint(4) NOT NULL COMMENT ‘数据来源(用户:1,系统:0)’,
busi_id
varchar(100) NOT NULL COMMENT ‘流水号(存储发生业务的数据id,计费业务则存储账单id)’,
charge_calculate_id
varchar(100) NOT NULL COMMENT ‘账单计费的业务id,非计费数据存储0’,
amount
decimal(10,2) NOT NULL,
fines_amount
decimal(10,2) DEFAULT NULL COMMENT ‘赔付金额’,
transaction_type
tinyint(4) NOT NULL COMMENT ‘交易类型(0:收入,1:支出)’,
balance
decimal(20,2) NOT NULL COMMENT ‘交易后的余额’,
charge_itme_id
bigint(8) NOT NULL COMMENT ‘费用项目id’,
parent_charge_item_id
bigint(8) DEFAULT NULL COMMENT ‘所属费用项目id’,
send_time
datetime DEFAULT NULL COMMENT ‘寄件时间’,
send_site_id
bigint(8) DEFAULT NULL COMMENT ‘寄件网点id’,
send_site_name
varchar(300) DEFAULT NULL COMMENT ‘寄件网点名’,
send_site_id_1
bigint(8) DEFAULT NULL COMMENT ‘寄件网点所属一级网点id’,
send_site_name_1
varchar(300) DEFAULT NULL COMMENT ‘寄件网点所属一级网点名’,
dispatch_site_id
bigint(8) DEFAULT NULL COMMENT ‘派件网点id’,
dispatch_site_name
varchar(300) DEFAULT NULL COMMENT ‘派件网点名’,
sign_site_id
bigint(8) DEFAULT NULL COMMENT ‘签收网点id’,
sign_site_name
varchar(300) DEFAULT NULL COMMENT ‘签收网点名’,
sign_site_id_1
bigint(8) DEFAULT NULL COMMENT ‘签收一级网点id’,
sign_site_id_name
varchar(300) DEFAULT NULL COMMENT ‘签收一级网点名称’,
sign_time
datetime DEFAULT NULL COMMENT ‘签收时间’,
fill_storehouse
tinyint(1) DEFAULT NULL COMMENT ‘填仓’,
weight
decimal(8,2) DEFAULT NULL COMMENT ‘运单实际重量’,
calc_weight
decimal(8,2) DEFAULT NULL COMMENT ‘运单结算重量’,
piece
bigint(5) DEFAULT NULL COMMENT ‘件数’,
goods_type_id
bigint(8) DEFAULT NULL COMMENT ‘产品类型(字典表services_type)’,
send_customer_id
varchar(100) DEFAULT NULL COMMENT ‘寄件客户id’,
send_customer_name
varchar(300) DEFAULT NULL COMMENT ‘寄件客户名称’,
hedge_flag
tinyint(4) DEFAULT NULL COMMENT ‘对冲(1:正常,0:对冲)’,
modify_time
datetime DEFAULT NULL COMMENT ‘修改时间’,
created_by
bigint(8) NOT NULL COMMENT ‘创建人id’,
created_name
varchar(300) DEFAULT NULL COMMENT ‘创建人名称’,
created_time
datetime NOT NULL COMMENT ‘创建时间’,
valid_flag
tinyint(4) NOT NULL COMMENT ‘关联费用(1:与开户户名有关,0:只是经过开户行)’,
remark
varchar(1000) DEFAULT NULL COMMENT ‘备注’,
sys_remark
varchar(1000) DEFAULT NULL COMMENT ‘系统备注’,
ts
datetime DEFAULT NULL COMMENT ‘时间戳’,
var_standby_1
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_2
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_3
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_4
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_5
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_6
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_7
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_8
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_9
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_10
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
goods_category
int(10) DEFAULT NULL COMMENT ‘易碎品标识,1:易碎品 0:否’,
var_standby_12
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_13
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_14
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_15
int(10) DEFAULT NULL COMMENT ‘备用字段’,
wd_balance
decimal(20,2) NOT NULL DEFAULT ‘0.00’ COMMENT ‘当次提现余额’,
PRIMARY KEY (did
,created_time
),
KEY idx_t_busi_detail_1
(busi_id
,charge_itme_id
,site_id
) USING BTREE,
KEY idx_t_busi_detail_2
(site_id
,created_time
,charge_itme_id
) USING BTREE,
KEY idx_t_busi_detail_3
(ewb_no
) USING BTREE,
KEY I_t_busi_detail_04
(deposit_site_id
,created_time
),
KEY idx_t_busi_detail_4
(serial_no
) USING BTREE,
KEY idx_t_busi_detail_5
(deposit_site_id
,account_type
,charge_itme_id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=‘交易明细表’
/*!50500 PARTITION BY RANGE COLUMNS(created_time)
(PARTITION P20220401 VALUES LESS THAN (‘2022-04-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220402 VALUES LESS THAN (‘2022-04-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220403 VALUES LESS THAN (‘2022-05-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20220501 VALUES LESS THAN (‘2022-05-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220502 VALUES LESS THAN (‘2022-05-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220503 VALUES LESS THAN (‘2022-06-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20220601 VALUES LESS THAN (‘2022-06-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220602 VALUES LESS THAN (‘2022-06-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220603 VALUES LESS THAN (‘2022-07-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20220701 VALUES LESS THAN (‘2022-07-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220702 VALUES LESS THAN (‘2022-07-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220703 VALUES LESS THAN (‘2022-08-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20220801 VALUES LESS THAN (‘2022-08-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220802 VALUES LESS THAN (‘2022-08-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220803 VALUES LESS THAN (‘2022-09-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20220901 VALUES LESS THAN (‘2022-09-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20220902 VALUES LESS THAN (‘2022-09-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20220903 VALUES LESS THAN (‘2022-10-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20221001 VALUES LESS THAN (‘2022-10-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20221002 VALUES LESS THAN (‘2022-10-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20221003 VALUES LESS THAN (‘2022-11-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20221101 VALUES LESS THAN (‘2022-11-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20221102 VALUES LESS THAN (‘2022-11-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20221103 VALUES LESS THAN (‘2022-12-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20221201 VALUES LESS THAN (‘2022-12-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20221202 VALUES LESS THAN (‘2022-12-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20221203 VALUES LESS THAN (‘2023-01-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230101 VALUES LESS THAN (‘2023-01-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230102 VALUES LESS THAN (‘2023-01-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230103 VALUES LESS THAN (‘2023-02-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230201 VALUES LESS THAN (‘2023-02-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230202 VALUES LESS THAN (‘2023-02-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230203 VALUES LESS THAN (‘2023-03-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230301 VALUES LESS THAN (‘2023-03-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230302 VALUES LESS THAN (‘2023-03-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230303 VALUES LESS THAN (‘2023-04-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230401 VALUES LESS THAN (‘2023-04-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230402 VALUES LESS THAN (‘2023-04-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230403 VALUES LESS THAN (‘2023-05-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230501 VALUES LESS THAN (‘2023-05-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230502 VALUES LESS THAN (‘2023-05-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230503 VALUES LESS THAN (‘2023-06-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230601 VALUES LESS THAN (‘2023-06-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230602 VALUES LESS THAN (‘2023-06-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230603 VALUES LESS THAN (‘2023-07-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230701 VALUES LESS THAN (‘2023-07-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230702 VALUES LESS THAN (‘2023-07-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230703 VALUES LESS THAN (‘2023-08-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230801 VALUES LESS THAN (‘2023-08-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230802 VALUES LESS THAN (‘2023-08-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230803 VALUES LESS THAN (‘2023-09-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20230901 VALUES LESS THAN (‘2023-09-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20230902 VALUES LESS THAN (‘2023-09-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20230903 VALUES LESS THAN (‘2023-10-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20231001 VALUES LESS THAN (‘2023-10-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20231002 VALUES LESS THAN (‘2023-10-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20231003 VALUES LESS THAN (‘2023-11-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20231101 VALUES LESS THAN (‘2023-11-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20231102 VALUES LESS THAN (‘2023-11-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20231103 VALUES LESS THAN (‘2023-12-01 00:00:00’) ENGINE = InnoDB,
PARTITION P20231201 VALUES LESS THAN (‘2023-12-10 00:00:00’) ENGINE = InnoDB,
PARTITION P20231202 VALUES LESS THAN (‘2023-12-20 00:00:00’) ENGINE = InnoDB,
PARTITION P20231203 VALUES LESS THAN (‘2024-01-01 00:00:00’) ENGINE = InnoDB,
PARTITION P_MAX VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */
下游TiDB表结构:
CREATE TABLE t_busi_detail
(
id
bigint(20) unsigned NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
did
varchar(100) NOT NULL COMMENT ‘交易明细id’,
ewb_no
varchar(100) NOT NULL COMMENT ‘运单号’,
serial_no
varchar(100) DEFAULT NULL COMMENT ‘流水号’,
account_id
varchar(100) NOT NULL COMMENT ‘帐号id’,
deposit_site_id
bigint(20) NOT NULL COMMENT ‘开户行id’,
deposit_site_name
varchar(100) NOT NULL COMMENT ‘开户行名’,
site_id
bigint(20) NOT NULL COMMENT ‘开户网点id’,
site_name
varchar(100) NOT NULL COMMENT ‘开户网点名’,
distribution_site_id
bigint(20) NOT NULL COMMENT ‘开户户名所属分拨id’,
distribution_site_name
varchar(100) NOT NULL COMMENT ‘开户户名所属分拨名’,
account_type
int(11) NOT NULL COMMENT ‘账户类型’,
data_source
tinyint(4) NOT NULL COMMENT ‘数据来源(用户:1,系统:0)’,
busi_id
varchar(100) NOT NULL COMMENT ‘流水号(存储发生业务的数据id,计费业务则存储账单id)’,
charge_calculate_id
varchar(100) NOT NULL COMMENT ‘账单计费的业务id,非计费数据存储0’,
amount
decimal(10,2) NOT NULL,
fines_amount
decimal(10,2) DEFAULT NULL COMMENT ‘赔付金额’,
transaction_type
tinyint(4) NOT NULL COMMENT ‘交易类型(0:收入,1:支出)’,
balance
decimal(20,2) NOT NULL COMMENT ‘交易后的余额’,
charge_itme_id
bigint(8) NOT NULL COMMENT ‘费用项目id’,
parent_charge_item_id
bigint(8) DEFAULT NULL COMMENT ‘所属费用项目id’,
send_time
datetime DEFAULT NULL COMMENT ‘寄件时间’,
send_site_id
bigint(8) DEFAULT NULL COMMENT ‘寄件网点id’,
send_site_name
varchar(300) DEFAULT NULL COMMENT ‘寄件网点名’,
send_site_id_1
bigint(8) DEFAULT NULL COMMENT ‘寄件网点所属一级网点id’,
send_site_name_1
varchar(300) DEFAULT NULL COMMENT ‘寄件网点所属一级网点名’,
dispatch_site_id
bigint(8) DEFAULT NULL COMMENT ‘派件网点id’,
dispatch_site_name
varchar(300) DEFAULT NULL COMMENT ‘派件网点名’,
sign_site_id
bigint(8) DEFAULT NULL COMMENT ‘签收网点id’,
sign_site_name
varchar(300) DEFAULT NULL COMMENT ‘签收网点名’,
sign_site_id_1
bigint(8) DEFAULT NULL COMMENT ‘签收一级网点id’,
sign_site_id_name
varchar(300) DEFAULT NULL COMMENT ‘签收一级网点名称’,
sign_time
datetime DEFAULT NULL COMMENT ‘签收时间’,
fill_storehouse
tinyint(1) DEFAULT NULL COMMENT ‘填仓’,
weight
decimal(8,2) DEFAULT NULL COMMENT ‘运单实际重量’,
calc_weight
decimal(8,2) DEFAULT NULL COMMENT ‘运单结算重量’,
piece
bigint(5) DEFAULT NULL COMMENT ‘件数’,
goods_type_id
bigint(8) DEFAULT NULL COMMENT ‘产品类型(字典表services_type)’,
send_customer_id
varchar(100) DEFAULT NULL COMMENT ‘寄件客户id’,
send_customer_name
varchar(300) DEFAULT NULL COMMENT ‘寄件客户名称’,
hedge_flag
tinyint(4) DEFAULT NULL COMMENT ‘对冲(1:正常,0:对冲)’,
modify_time
datetime DEFAULT NULL COMMENT ‘修改时间’,
created_by
bigint(8) NOT NULL COMMENT ‘创建人id’,
created_name
varchar(300) DEFAULT NULL COMMENT ‘创建人名称’,
created_time
datetime NOT NULL COMMENT ‘创建时间’,
valid_flag
tinyint(4) NOT NULL COMMENT ‘关联费用(1:与开户户名有关,0:只是经过开户行)’,
remark
varchar(1000) DEFAULT NULL COMMENT ‘备注’,
sys_remark
varchar(1000) DEFAULT NULL COMMENT ‘系统备注’,
ts
datetime DEFAULT NULL COMMENT ‘时间戳’,
var_standby_1
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_2
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_3
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_4
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_5
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_6
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_7
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_8
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_9
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_10
varchar(50) DEFAULT NULL COMMENT ‘备用字段’,
goods_category
int(10) DEFAULT NULL COMMENT ‘易碎品标识,1:易碎品 0:否’,
var_standby_12
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_13
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_14
int(10) DEFAULT NULL COMMENT ‘备用字段’,
var_standby_15
int(10) DEFAULT NULL COMMENT ‘备用字段’,
wd_balance
decimal(20,2) NOT NULL DEFAULT ‘0.00’ COMMENT ‘当次提现余额’,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */,
KEY idx_t_busi_detail_1
(did
,created_time
),
KEY idx_t_busi_detail_2
(busi_id
,charge_itme_id
,site_id
),
KEY idx_t_busi_detail_3
(site_id
,created_time
,charge_itme_id
),
KEY idx_t_busi_detail_4
(ewb_no
),
KEY idx_t_busi_detail_5
(deposit_site_id
,created_time
),
KEY idx_t_busi_detail_6
(serial_no
),
KEY idx_t_busi_detail_7
(deposit_site_id
,account_type
,charge_itme_id
),
KEY idx_t_busi_detail_8
(created_time
,modify_time
),
KEY idx_t_busi_detail_9
(modify_time
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![auto_rand_base] AUTO_RANDOM_BASE=1673240265 */ COMMENT=‘交易明细表’