alter table wx_energy_meter       drop COLUMN floor_id;
alter table wx_energy_meter       drop COLUMN shop_id;
alter table wx_energy_meter       drop COLUMN building_id;
alter table wx_energy_meter       drop COLUMN is_public;
ALTER TABLE wx_energy_meter       ADD COLUMN physics_type INT(1) NOT NULL COMMENT '表物理类型';

CREATE TABLE `wx_energy_meter_shop_floor` (
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
  `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID',
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `type` int(3) NOT NULL COMMENT '表类型',
  `meter_id` bigint(20) NOT NULL COMMENT '表编号',
  `alise_id` bigint(20) NOT NULL COMMENT '关联的id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  UNIQUE KEY `T_T_M_A` (`tenant_id`,`type`,`meter_id`,`alise_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表';

CREATE TABLE `wx_energy_meter_child` (
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
  `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID',
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `parent_meter_id` bigint(20) NOT NULL COMMENT '表编号',
  `child_meter_id` bigint(20) NOT NULL COMMENT '关联的id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  UNIQUE KEY `P_C` (`parent_meter_id`,`child_meter_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表';

CREATE TABLE `wx_energy_fees_calcute` (
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
  `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID',
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `fees_id` bigint(20) NOT NULL COMMENT '科目',
  `price` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '价格',
  `physics_type` int(1) NOT NULL COMMENT '用户表，公摊总表',
  `formula` text COLLATE utf8mb4_unicode_ci COMMENT '计算公式',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  UNIQUE KEY `T_F` (`tenant_id`,`fees_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表';







