DROP TABLE IF EXISTS wx_merchant_power_bill_config;
CREATE TABLE wx_merchant_power_bill_config(
	`id` bigint(20) NOT NULL COMMENT '主键ID',
	`tenant_id` varchar(10) NOT NULL COMMENT '租户ID',
	`merchant_id` bigint(20) NOT NULL COMMENT '商户ID',
	`merchant_name` varchar(50) NOT NULL COMMENT '商户名称',
	`merchant_type` smallint(2) NOT NULL COMMENT '商户类型1店铺2点位',
	`build_way`  tinyint(2) NOT NULL default 0 COMMENT '生成方式1按电表2固定金额',
	`price` varchar(10) NOT NULL COMMENT '金额(电表计费时为单价)',
	`create_date` datetime NOT NULL COMMENT '创建时间',
	`update_date` datetime NOT NULL COMMENT '更新时间',
	PRIMARY KEY (`id`)
) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电费自动生成规则' CHECKSUM=0 DELAY_KEY_WRITE=0;

DROP TABLE IF EXISTS wx_power_bill_auto_config;
CREATE TABLE wx_power_bill_auto_config(
	`id` bigint(20) NOT NULL COMMENT '主键ID',
	`tenant_id` varchar(10) NOT NULL COMMENT '租户ID',
	`unit_price` varchar(10) NOT NULL COMMENT '单价',
	`build_day` tinyint(3) NOT NULL COMMENT '每月多少日拉取上月数据',
	`receive_day` tinyint(3) NOT NULL COMMENT '截止缴款日',
	`create_date` datetime NOT NULL COMMENT '创建时间',
	`update_date` datetime NOT NULL COMMENT '更新时间',
	PRIMARY KEY (`id`)
) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电费自动生成规则' CHECKSUM=0 DELAY_KEY_WRITE=0;
