/*
SQLyog 企业版 - MySQL GUI v8.14 
MySQL - 8.0.28 : Database - data_center_aeon_admin
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`data_center_aeon_admin` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `data_center_aeon_admin`;

/*Table structure for table `admin_user` */

DROP TABLE IF EXISTS `admin_user`;

CREATE TABLE `admin_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(45) DEFAULT NULL,
  `password` varchar(45) DEFAULT NULL,
  `access_token` varchar(45) DEFAULT NULL,
  `token_expire_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `alert_handle_history` */

DROP TABLE IF EXISTS `alert_handle_history`;

CREATE TABLE `alert_handle_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `alert_history_id` bigint DEFAULT NULL COMMENT 'alert_history表主键',
  `device_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `last_status` int DEFAULT '0' COMMENT '0-未确认，1-确认了未对应，2-对应中，3-完成',
  `status` int DEFAULT '0' COMMENT '0-未确认，1-确认了未对应，2-对应中，3-完成，4-自动恢复',
  `handler` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '处理者',
  `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '处理备注',
  `alert_status` int DEFAULT '0' COMMENT '0-处于警报，1-警报解除',
  `handle_at` bigint DEFAULT NULL COMMENT '处理时间',
  PRIMARY KEY (`id`),
  KEY `device_id` (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='告警处理表';

/*Table structure for table `alert_history` */

DROP TABLE IF EXISTS `alert_history`;

CREATE TABLE `alert_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) DEFAULT NULL,
  `receive_ts` bigint DEFAULT NULL,
  `confirm_status` int DEFAULT '0' COMMENT '是否确认：0-未确认，1-确认',
  `handle_status` int DEFAULT '1' COMMENT '处理状态：1-未对应，2-对应中，3-完了，4-自动恢复',
  `alert_status` int DEFAULT '0' COMMENT '0-处于警报，1-警报解除',
  `retain_alert` int DEFAULT '0' COMMENT 'dashboard自动恢复是否保留告警：0-不保留，1-保留',
  PRIMARY KEY (`id`),
  KEY `device_id` (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='告警历史表';

/*Table structure for table `aurora_building_trend_stats` */

DROP TABLE IF EXISTS `aurora_building_trend_stats`;

CREATE TABLE `aurora_building_trend_stats` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sender_building_delta` int DEFAULT NULL,
  `created_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aurora_buliding_trend_stats_bt_index` (`created_time` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='aurora楼宇统计';

/*Table structure for table `aurora_device_trends_stats` */

DROP TABLE IF EXISTS `aurora_device_trends_stats`;

CREATE TABLE `aurora_device_trends_stats` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `reciever_device_id_delta` bigint DEFAULT NULL COMMENT '收到设备数据增量',
  `sender_device_id_delta` bigint DEFAULT NULL,
  `sender_dispatch_delta` bigint DEFAULT NULL COMMENT '转发数据量',
  `sender_alert_delta` int DEFAULT NULL,
  `sender_alert_cancel_delta` int DEFAULT NULL,
  `created_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aurora_device_trends_stats_time_index` (`created_time` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='aurora收到的设备统计信息';

/*Table structure for table `aurora_trends_stats_total` */

DROP TABLE IF EXISTS `aurora_trends_stats_total`;

CREATE TABLE `aurora_trends_stats_total` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增',
  `receiver_device_id` bigint DEFAULT NULL,
  `sender_device_id` bigint DEFAULT NULL,
  `sender_building` bigint DEFAULT NULL,
  `dispatch` bigint DEFAULT NULL,
  `alert` bigint DEFAULT NULL,
  `alert_cancel` bigint DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aurora_trends_stats_total_date_index` (`created_date` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Aurora统计信息总量';

/*Table structure for table `ba_status_history` */

DROP TABLE IF EXISTS `ba_status_history`;

CREATE TABLE `ba_status_history` (
 `id` bigint NOT NULL AUTO_INCREMENT,
 `device_info_id` int NOT NULL,
 `is_running` int DEFAULT NULL,
 `update_ts` varchar(45) DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `ba_status_statistics` */

DROP TABLE IF EXISTS `ba_status_statistics`;

CREATE TABLE `ba_status_statistics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_info_id` int DEFAULT NULL,
  `is_running` int DEFAULT NULL COMMENT '运行状态该，0停止，1运行',
  `latest_ts` varchar(45) DEFAULT NULL COMMENT '最新变化时间',
  `continuous_running_time` bigint DEFAULT NULL COMMENT '持续运行时间，精确到秒\n',
  `aggregated_running_time` bigint DEFAULT NULL COMMENT '累计运行时间，秒',
  `running_count` int DEFAULT NULL COMMENT '运行次数',
  `last_start_time` bigint DEFAULT NULL COMMENT '上次启动时间，毫秒级时间戳',
  `last_stop_time` bigint DEFAULT NULL COMMENT '上次停止时间，毫秒级时间戳',
  PRIMARY KEY (`id`),
  UNIQUE KEY `device_info_id_UNIQUE` (`device_info_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_asset_class_big` */

DROP TABLE IF EXISTS `basic_asset_class_big`;

CREATE TABLE `basic_asset_class_big` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `thumbnail_normal_base64` text COMMENT '普通图片转base64格式',
  `thumbnail_alarm_base64` text COMMENT '告警图片转base64格式',
  `thumbnail_dis_base64` text COMMENT '灰色图片转base64格式',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_asset_class_medium` */

DROP TABLE IF EXISTS `basic_asset_class_medium`;

CREATE TABLE `basic_asset_class_medium` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `class_big_id` bigint DEFAULT NULL,
  `class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_asset_class_small` */

DROP TABLE IF EXISTS `basic_asset_class_small`;

CREATE TABLE `basic_asset_class_small` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `class_medium_id` bigint DEFAULT NULL,
  `class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_building` */

DROP TABLE IF EXISTS `basic_building`;

CREATE TABLE `basic_building` (
  `building_id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '楼宇名称',
  `address` varchar(255) DEFAULT NULL COMMENT '地址',
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_building_id` varchar(200) DEFAULT NULL COMMENT '用户自定楼宇ID',
  `building_bucket` varchar(1000) DEFAULT NULL COMMENT 'Autodesk Cloud BIM Model Key',
  `floor_info_list` json DEFAULT NULL COMMENT '客户api文档自己加的参数floorInfoList',
  `thumbnail_num` int DEFAULT NULL COMMENT '楼宇图片序号',
  `show_switch_2d3d` int DEFAULT '0' COMMENT '是否在2d3d显示，0-显示，1-不显示',
  `brief_introduction` varchar(1000) DEFAULT NULL COMMENT '简介',
  `picture_introduction` json DEFAULT NULL COMMENT '图片详情',
  `latitude` varchar(20) DEFAULT NULL,
  `longitude` varchar(20) DEFAULT NULL,
  `retain_alert` int DEFAULT '0' COMMENT 'dashboard自动恢复告警时是否保留告警：0-不保留，1-保留',
  PRIMARY KEY (`building_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='楼宇表';

/*Table structure for table `basic_company` */

DROP TABLE IF EXISTS `basic_company`;

CREATE TABLE `basic_company` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `parent_id` bigint DEFAULT NULL COMMENT '父企业ID',
  `company_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `mfa_switch` int DEFAULT '0' COMMENT '谷歌mfa服务开关。0-关闭，1-开启',
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `apikey` varchar(255) DEFAULT NULL,
  `aurora_flag` int DEFAULT '0' COMMENT '0-未创建，1-创建中，2-创建成功，3-创建失败',
  `aurora_url` varchar(255) DEFAULT NULL,
  `aurora_read_url` varchar(255) DEFAULT NULL,
  `aurora_username` varchar(255) DEFAULT NULL,
  `aurora_password` varchar(255) DEFAULT NULL,
  `redis_db_id` int DEFAULT NULL COMMENT '使用的redis库id',
  `bearer_token` text,
  `third_api_host` varchar(1000) DEFAULT NULL COMMENT 'Third api地址域名，例如：https://api-sec.test-public-api.kanri-roid.app/api/public/v1/problem-reports/return-to-normal，则这里是https://api-sec.test-public-api.kanri-roid.app',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_floor` */

DROP TABLE IF EXISTS `basic_floor`;

CREATE TABLE `basic_floor` (
  `floor_id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `building_id` bigint DEFAULT NULL COMMENT '所属楼宇ID',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '楼层名称',
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_floor_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户自定义楼层ID',
  `revit_name` varchar(255) DEFAULT NULL,
  `offset_upper` varchar(255) DEFAULT NULL,
  `offset_lower` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`floor_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='楼层信息表';

/*Table structure for table `basic_menu` */

DROP TABLE IF EXISTS `basic_menu`;

CREATE TABLE `basic_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `parent_menu_id` bigint DEFAULT NULL,
  `menu_name` varchar(100) DEFAULT NULL,
  `menu_name_en` varchar(100) DEFAULT NULL,
  `menu_name_jp` varchar(100) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `menu_level` int DEFAULT '1' COMMENT '菜单级别',
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `basic_monitoring_asset` */

DROP TABLE IF EXISTS `basic_monitoring_asset`;

CREATE TABLE `basic_monitoring_asset` (
  `equipment_id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `space_id` bigint DEFAULT NULL COMMENT '所属房间ID',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '资产名称',
  `remark` varchar(255) DEFAULT NULL,
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_equipment_id` varchar(100) DEFAULT NULL COMMENT '用户手写资产ID',
  `class_big` varchar(255) DEFAULT NULL,
  `class_big_id` bigint DEFAULT NULL,
  `class_medium` varchar(255) DEFAULT NULL,
  `class_medium_id` bigint DEFAULT NULL,
  `class_small` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `class_small_id` bigint DEFAULT NULL,
  `symbol` varchar(255) DEFAULT NULL,
  `manufacturer` varchar(255) DEFAULT NULL,
  `model` varchar(255) DEFAULT NULL,
  `manufacturing_date` varchar(255) DEFAULT NULL,
  `specifications1` varchar(255) DEFAULT NULL,
  `specifications2` varchar(255) DEFAULT NULL,
  `specifications3` varchar(255) DEFAULT NULL,
  `specifications4` varchar(255) DEFAULT NULL,
  `specifications5` varchar(255) DEFAULT NULL,
  `specifications6` varchar(255) DEFAULT NULL,
  `s3_file_name` text COMMENT 's3存储的资料文件名',
  `mapper_file_name` text COMMENT 's3资料文件名与原始资料文件名的映射关系',
  `external_file` text COMMENT '关联外部文件url',
  `user_manual` text COMMENT '用户手册存放地址',
  `device_image` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '设备图片存放地址',
  `pdf_user_manual` json DEFAULT NULL COMMENT '用户手册pdf，{"s3文件key":"原文件名"}',
  `pdf_device_image` json DEFAULT NULL COMMENT '设备图片图片，{"s3文件key":"原文件名"}',
  `images_introduction` json DEFAULT NULL COMMENT '图片介绍，{"s3文件key":"原文件名"}',
  PRIMARY KEY (`equipment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监控资产表';

/*Table structure for table `basic_monitoring_asset_copy1` */

DROP TABLE IF EXISTS `basic_monitoring_asset_copy1`;

CREATE TABLE `basic_monitoring_asset_copy1` (
  `equipment_id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `space_id` bigint DEFAULT NULL COMMENT '所属房间ID',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '资产名称',
  `remark` varchar(255) DEFAULT NULL,
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_equipment_id` varchar(100) DEFAULT NULL COMMENT '用户手写资产ID',
  `class_big` varchar(255) DEFAULT NULL,
  `class_big_id` bigint DEFAULT NULL,
  `class_medium` varchar(255) DEFAULT NULL,
  `class_medium_id` bigint DEFAULT NULL,
  `class_small` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `class_small_id` bigint DEFAULT NULL,
  `symbol` varchar(255) DEFAULT NULL,
  `manufacturer` varchar(255) DEFAULT NULL,
  `model` varchar(255) DEFAULT NULL,
  `manufacturing_date` varchar(255) DEFAULT NULL,
  `specifications1` varchar(255) DEFAULT NULL,
  `specifications2` varchar(255) DEFAULT NULL,
  `specifications3` varchar(255) DEFAULT NULL,
  `specifications4` varchar(255) DEFAULT NULL,
  `specifications5` varchar(255) DEFAULT NULL,
  `specifications6` varchar(255) DEFAULT NULL,
  `s3_file_name` text COMMENT 's3存储的资料文件名',
  `mapper_file_name` text COMMENT 's3资料文件名与原始资料文件名的映射关系',
  `external_file` text COMMENT '关联外部文件url',
  `user_manual` text COMMENT '用户手册存放地址',
  `device_image` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '设备图片存放地址',
  PRIMARY KEY (`equipment_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监控资产表';

/*Table structure for table `basic_project` */

DROP TABLE IF EXISTS `basic_project`;

CREATE TABLE `basic_project` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `project_name` varchar(100) NOT NULL COMMENT '项目名称',
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_project_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户自定义项目ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='项目表';

/*Table structure for table `basic_role` */

DROP TABLE IF EXISTS `basic_role`;

CREATE TABLE `basic_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `role_name` varchar(100) DEFAULT NULL,
  `description` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `creator_id` bigint DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `basic_role_menu_relation` */

DROP TABLE IF EXISTS `basic_role_menu_relation`;

CREATE TABLE `basic_role_menu_relation` (
  `role_id` bigint DEFAULT NULL,
  `menu_id` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `create_time` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `basic_role_user_relation` */

DROP TABLE IF EXISTS `basic_role_user_relation`;

CREATE TABLE `basic_role_user_relation` (
  `user_id` bigint DEFAULT NULL,
  `role_id` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `create_time` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `basic_space` */

DROP TABLE IF EXISTS `basic_space`;

CREATE TABLE `basic_space` (
  `space_id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `floor_id` bigint DEFAULT NULL COMMENT '所属楼层ID',
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '房间名称',
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `udf_space_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户自定义空间ID',
  `pdf_user_manual` json DEFAULT NULL COMMENT '用户手册pdf，{"s3文件key":"原文件名"}',
  `pdf_device_image` json DEFAULT NULL COMMENT '设备图片图片，{"s3文件key":"原文件名"}',
  `images_introduction` json DEFAULT NULL COMMENT '图片介绍，{"s3文件key":"原文件名"}',
  `pdf_construction_equipment` json DEFAULT NULL COMMENT '建筑设备pdf，{"s3文件key":"原文件名"}',
  `pdf_electrical_equipment` json DEFAULT NULL COMMENT '电气设备pdf，{"s3文件key":"原文件名"}',
  `pdf_ventilation_equipment` json DEFAULT NULL COMMENT '给排气设备pdf，{"s3文件key":"原文件名"}',
  `pdf_sanitary_equipment` json DEFAULT NULL COMMENT '卫生设备pdf，{"s3文件key":"原文件名"}',
  `pdf_fire_protection_equipment` json DEFAULT NULL COMMENT '消防设备pdf，{"s3文件key":"原文件名"}',
  `pdf_other_equipment` json DEFAULT NULL COMMENT '其他设备pdf，{"s3文件key":"原文件名"}',
  `space_category` varchar(100) DEFAULT NULL COMMENT '空间类别',
  `area` varchar(50) DEFAULT NULL COMMENT '面积（㎡）',
  `usage` varchar(200) DEFAULT NULL COMMENT '用途',
  `risk_factor` varchar(200) DEFAULT NULL COMMENT '风险因素',
  `user_department_or_tenant` varchar(200) DEFAULT NULL COMMENT '使用部门/租户',
  `usage_start_date` varchar(100) DEFAULT NULL COMMENT '使用开始日期',
  `usage_status` varchar(200) DEFAULT NULL COMMENT '使用情况',
  `supporting_facilities` varchar(500) DEFAULT NULL COMMENT '配套设备',
  `power_capacity` varchar(100) DEFAULT NULL COMMENT '电源容量（kVA）',
  `remark1` varchar(500) DEFAULT NULL COMMENT '备注-1',
  `remark2` varchar(500) DEFAULT NULL COMMENT '备注-2',
  `remark3` varchar(500) DEFAULT NULL COMMENT '备注-3',
  `tenant_id` bigint DEFAULT NULL,
  PRIMARY KEY (`space_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='房间表';

/*Table structure for table `basic_tenant` */

DROP TABLE IF EXISTS `basic_tenant`;

CREATE TABLE `basic_tenant` (
  `tenant_id` bigint NOT NULL AUTO_INCREMENT,
  `tenant_udf_id` varchar(100) NOT NULL COMMENT '租户自定义id',
  `tenant_name` varchar(100) NOT NULL,
  `building_id` bigint NOT NULL,
  `company_id` bigint NOT NULL,
  `creator_id` bigint NOT NULL,
  `modifier_id` bigint NOT NULL,
  `create_time` bigint NOT NULL COMMENT '创建时间，毫秒时间戳',
  `modify_time` bigint NOT NULL COMMENT '更新时间，毫秒时间戳',
  `flag` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`tenant_id`),
  UNIQUE KEY `uk_tenant_udf_id` (`tenant_udf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `basic_user` */

DROP TABLE IF EXISTS `basic_user`;

CREATE TABLE `basic_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_type` int DEFAULT '0' COMMENT '0-未知，1-管理平台用户，2-普通平台用户',
  `company_id` bigint NOT NULL,
  `username` varchar(255) DEFAULT NULL,
  `login_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `salt` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码加密的盐',
  `email` varchar(255) DEFAULT NULL,
  `mfa_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `mfa_bind` int DEFAULT '0' COMMENT '用户是否绑定了mfa设备。0-未绑定，1-已绑定',
  `mobile_number` varchar(255) DEFAULT NULL,
  `last_login_time` bigint DEFAULT NULL COMMENT '最新登录时间',
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `expire_time` bigint DEFAULT '4114487556000' COMMENT '有效期',
  `create_time` bigint DEFAULT NULL COMMENT '创建时间',
  `creator_id` bigint DEFAULT NULL COMMENT '创建人',
  `modify_time` bigint DEFAULT NULL COMMENT '修改时间',
  `modifier_id` bigint DEFAULT NULL COMMENT '修改人',
  `super_role` int DEFAULT '0' COMMENT '超管权限，1超管，0普通',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `ble_history` */

DROP TABLE IF EXISTS `ble_history`;

CREATE TABLE `ble_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ble_gateway_mac` varchar(45) DEFAULT NULL,
  `ble_bluetooth_mac` varchar(45) DEFAULT NULL,
  `ts` varchar(45) DEFAULT NULL,
  `status` int DEFAULT NULL COMMENT '0：出\n1：进入',
  `is_deleted` int DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `building_trend_stats` */

DROP TABLE IF EXISTS `building_trend_stats`;

CREATE TABLE `building_trend_stats` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sender_building_delta` int DEFAULT NULL,
  `created_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `buliding_trend_stats_bt_index` (`created_time` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='楼宇统计';

/*Table structure for table `company` */

DROP TABLE IF EXISTS `company`;

CREATE TABLE `company` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_name` varchar(45) DEFAULT NULL,
  `apikey` varchar(45) DEFAULT NULL,
  `company_code` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `dashboard_aggregate_accumulate_30min` */

DROP TABLE IF EXISTS `dashboard_aggregate_accumulate_30min`;

CREATE TABLE `dashboard_aggregate_accumulate_30min` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `aggregate_value` varchar(20) DEFAULT NULL COMMENT '30分钟聚合值',
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `date_minute` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`,`date_day`,`date_hour`,`date_minute`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='30分钟聚合表';

/*Table structure for table `dashboard_aggregate_accumulate_day` */

DROP TABLE IF EXISTS `dashboard_aggregate_accumulate_day`;

CREATE TABLE `dashboard_aggregate_accumulate_day` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `aggregate_value` varchar(20) DEFAULT NULL COMMENT '日聚合值',
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`,`date_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='日聚合表';

/*Table structure for table `dashboard_aggregate_accumulate_hour` */

DROP TABLE IF EXISTS `dashboard_aggregate_accumulate_hour`;

CREATE TABLE `dashboard_aggregate_accumulate_hour` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `aggregate_value` varchar(20) DEFAULT NULL COMMENT '1小时聚合值',
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`,`date_day`,`date_hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='小时聚合表';

/*Table structure for table `dashboard_aggregate_accumulate_month` */

DROP TABLE IF EXISTS `dashboard_aggregate_accumulate_month`;

CREATE TABLE `dashboard_aggregate_accumulate_month` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `aggregate_value` varchar(20) DEFAULT NULL COMMENT '月聚合值',
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='月聚合表';

/*Table structure for table `dashboard_aggregate_accumulate_year` */

DROP TABLE IF EXISTS `dashboard_aggregate_accumulate_year`;

CREATE TABLE `dashboard_aggregate_accumulate_year` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `aggregate_value` varchar(20) DEFAULT NULL COMMENT '年聚合值',
  `date_year` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='年聚合表';

/*Table structure for table `dashboard_aggregate_measure_day` */

DROP TABLE IF EXISTS `dashboard_aggregate_measure_day`;

CREATE TABLE `dashboard_aggregate_measure_day` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL COMMENT '设备ID',
  `average_value` varchar(20) DEFAULT NULL COMMENT '日平均值',
  `max_value` varchar(20) DEFAULT NULL,
  `min_value` varchar(20) DEFAULT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '聚合时间',
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`,`date_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='日聚合表（测量值）';

/*Table structure for table `dashboard_aggregate_measure_hour` */

DROP TABLE IF EXISTS `dashboard_aggregate_measure_hour`;

CREATE TABLE `dashboard_aggregate_measure_hour` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL COMMENT '设备ID',
  `average_value` varchar(20) DEFAULT NULL COMMENT '小时平均值',
  `max_value` varchar(20) DEFAULT NULL,
  `min_value` varchar(20) DEFAULT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '聚合时间',
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`,`date_day`,`date_hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='小时聚合表（测量值）';

/*Table structure for table `dashboard_aggregate_measure_month` */

DROP TABLE IF EXISTS `dashboard_aggregate_measure_month`;

CREATE TABLE `dashboard_aggregate_measure_month` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL COMMENT '设备ID',
  `average_value` varchar(20) DEFAULT NULL COMMENT '月平均值',
  `max_value` varchar(20) DEFAULT NULL,
  `min_value` varchar(20) DEFAULT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '聚合时间',
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`,`date_month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='月聚合表（测量值）';

/*Table structure for table `dashboard_aggregate_measure_year` */

DROP TABLE IF EXISTS `dashboard_aggregate_measure_year`;

CREATE TABLE `dashboard_aggregate_measure_year` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL COMMENT '设备ID',
  `average_value` varchar(20) DEFAULT NULL COMMENT '年平均值',
  `max_value` varchar(20) DEFAULT NULL,
  `min_value` varchar(20) DEFAULT NULL,
  `date_year` int DEFAULT NULL,
  `time_start` bigint DEFAULT NULL,
  `time_end` bigint DEFAULT NULL,
  `aggregated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '聚合时间',
  PRIMARY KEY (`id`),
  KEY `idx_device_time` (`device_id`,`date_year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='年聚合表（测量值）';

/*Table structure for table `dashboard_device_group` */

DROP TABLE IF EXISTS `dashboard_device_group`;

CREATE TABLE `dashboard_device_group` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `building_id` bigint DEFAULT NULL COMMENT '所属楼宇ID',
  `class_id` int DEFAULT NULL COMMENT '2-积算、3-计测、4-状态',
  `name` varchar(500) NOT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='dashboard设备分组表';

/*Table structure for table `dashboard_device_group_relation` */

DROP TABLE IF EXISTS `dashboard_device_group_relation`;

CREATE TABLE `dashboard_device_group_relation` (
   `device_info_id` int NOT NULL COMMENT 'device_info表里的id',
   `device_group_id` bigint NOT NULL COMMENT 'dashboard_device_group表里的id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='dashboard设备分组归属关系';

/*Table structure for table `dashboard_level_area` */

DROP TABLE IF EXISTS `dashboard_level_area`;

CREATE TABLE `dashboard_level_area` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `company_id` bigint DEFAULT NULL,
    `name` varchar(255) NOT NULL,
    `remark` varchar(255) DEFAULT NULL,
    `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
    `created_by` bigint DEFAULT NULL,
    `created_at` bigint DEFAULT NULL,
    `updated_at` bigint DEFAULT NULL,
    `updated_by` bigint DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区域表';

/*Table structure for table `dashboard_level_branch` */

DROP TABLE IF EXISTS `dashboard_level_branch`;

CREATE TABLE `dashboard_level_branch` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  `updated_at` bigint DEFAULT NULL,
  `updated_by` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支社表';

/*Table structure for table `dashboard_level_relation_area_site` */

DROP TABLE IF EXISTS `dashboard_level_relation_area_site`;

CREATE TABLE `dashboard_level_relation_area_site` (
  `area_id` bigint NOT NULL,
  `site_id` bigint NOT NULL,
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  KEY `idx_area_site_area_id` (`area_id`),
  KEY `idx_area_site_site_id` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='区域-site关系表';

/*Table structure for table `dashboard_level_relation_branch_store` */

DROP TABLE IF EXISTS `dashboard_level_relation_branch_store`;

CREATE TABLE `dashboard_level_relation_branch_store` (
 `branch_id` bigint NOT NULL,
 `store_id` bigint NOT NULL,
 `created_by` bigint DEFAULT NULL,
 `created_at` bigint DEFAULT NULL,
 KEY `idx_branch_store_branch_id` (`branch_id`),
 KEY `idx_branch_store_store_id` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支社-支店关系表';

/*Table structure for table `dashboard_level_relation_site_building` */

DROP TABLE IF EXISTS `dashboard_level_relation_site_building`;

CREATE TABLE `dashboard_level_relation_site_building` (
  `site_id` bigint NOT NULL,
  `building_id` bigint NOT NULL,
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  KEY `idx_site_building_site_id` (`site_id`),
  KEY `idx_site_building_building_id` (`building_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='site-楼宇关系表';

/*Table structure for table `dashboard_level_relation_store_area` */

DROP TABLE IF EXISTS `dashboard_level_relation_store_area`;

CREATE TABLE `dashboard_level_relation_store_area` (
   `store_id` bigint NOT NULL,
   `area_id` bigint NOT NULL,
   `created_by` bigint DEFAULT NULL,
   `created_at` bigint DEFAULT NULL,
   KEY `idx_store_area_store_id` (`store_id`),
   KEY `idx_store_area_area_id` (`area_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支店-区域关系表';

/*Table structure for table `dashboard_level_role` */

DROP TABLE IF EXISTS `dashboard_level_role`;

CREATE TABLE `dashboard_level_role` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `company_id` bigint DEFAULT NULL,
    `name` varchar(100) NOT NULL,
    `remark` varchar(255) DEFAULT NULL,
    `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
    `created_by` bigint DEFAULT NULL,
    `created_at` bigint DEFAULT NULL,
    `updated_at` bigint DEFAULT NULL,
    `updated_by` bigint DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=utf8mb4 COMMENT='支社、分店等多层级控制角色';

/*Table structure for table `dashboard_level_role_object` */

DROP TABLE IF EXISTS `dashboard_level_role_object`;

CREATE TABLE `dashboard_level_role_object` (
   `level_role_id` bigint NOT NULL,
   `ref_type` enum('BRANCH','STORE','AREA','SITE','BUILDING') NOT NULL COMMENT '角色绑定的实体类型（指向哪个表）',
   `ref_id` bigint NOT NULL COMMENT '对应层级表中的实体ID，例如：ref_type=SITE, ref_id=15 表示绑定了id=15的site',
   `created_by` bigint DEFAULT NULL,
   `created_at` bigint DEFAULT NULL,
   `updated_at` bigint DEFAULT NULL,
   `updated_by` bigint DEFAULT NULL,
   UNIQUE KEY `ux_role_ref` (`ref_type`,`ref_id`,`level_role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色绑定的层级关系表';

/*Table structure for table `dashboard_level_role_user` */

DROP TABLE IF EXISTS `dashboard_level_role_user`;

CREATE TABLE `dashboard_level_role_user` (
 `id` bigint NOT NULL AUTO_INCREMENT,
 `user_id` bigint NOT NULL,
 `level_role_id` bigint NOT NULL,
 `ref_type` int NOT NULL DEFAULT '0' COMMENT '0-普通用户，1-管理员',
 `created_by` bigint DEFAULT NULL,
 `created_at` bigint DEFAULT NULL,
 `updated_at` bigint DEFAULT NULL,
 `updated_by` bigint DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `uk_user_role_ref` (`user_id`,`level_role_id`,`ref_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='层级角色和用户关系表';

/*Table structure for table `dashboard_level_site` */

DROP TABLE IF EXISTS `dashboard_level_site`;

CREATE TABLE `dashboard_level_site` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `company_id` bigint DEFAULT NULL,
    `name` varchar(255) NOT NULL,
    `remark` varchar(255) DEFAULT NULL,
    `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
    `created_by` bigint DEFAULT NULL,
    `created_at` bigint DEFAULT NULL,
    `updated_at` bigint DEFAULT NULL,
    `updated_by` bigint DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='site表';

/*Table structure for table `dashboard_level_store` */

DROP TABLE IF EXISTS `dashboard_level_store`;

CREATE TABLE `dashboard_level_store` (
 `id` bigint NOT NULL AUTO_INCREMENT,
 `company_id` bigint DEFAULT NULL,
 `name` varchar(255) NOT NULL,
 `remark` varchar(255) DEFAULT NULL,
 `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
 `created_by` bigint DEFAULT NULL,
 `created_at` bigint DEFAULT NULL,
 `updated_at` bigint DEFAULT NULL,
 `updated_by` bigint DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分店表';

/*Table structure for table `dashboard_notice_ignored` */

DROP TABLE IF EXISTS `dashboard_notice_ignored`;

CREATE TABLE `dashboard_notice_ignored` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `redis_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'alert_window_notice:ignore:%d，%d对应用户ID',
  `member_value` varchar(255) NOT NULL COMMENT '存告警ID',
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `redis_key` (`redis_key`,`member_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='平台告警通知已读表';

/*Table structure for table `dashboard_notification` */

DROP TABLE IF EXISTS `dashboard_notification`;

CREATE TABLE `dashboard_notification` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `company_id` bigint DEFAULT NULL COMMENT '公司ID',
  `demand_time` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '要求时间',
  `category` varchar(255) DEFAULT NULL COMMENT '分类',
  `category_id` bigint DEFAULT NULL,
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知内容',
  `flag` int DEFAULT '0',
  `created_at` bigint DEFAULT NULL COMMENT '创建时间',
  `created_by` bigint DEFAULT NULL COMMENT '创建人',
  `updated_at` bigint DEFAULT NULL COMMENT '更新时间',
  `updated_by` bigint DEFAULT NULL COMMENT '更新人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='通知表';

/*Table structure for table `dashboard_notification_category` */

DROP TABLE IF EXISTS `dashboard_notification_category`;

CREATE TABLE `dashboard_notification_category` (
   `id` bigint NOT NULL AUTO_INCREMENT,
   `company_id` bigint DEFAULT NULL,
   `name` varchar(255) NOT NULL,
   `remark` varchar(255) DEFAULT NULL,
   `flag` int NOT NULL DEFAULT '0' COMMENT '0-正常，1-删除',
   `created_by` bigint DEFAULT NULL,
   `created_at` bigint DEFAULT NULL,
   `updated_at` bigint DEFAULT NULL,
   `updated_by` bigint DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='通知表里的分类';

/*Table structure for table `dashboard_operation_log` */

DROP TABLE IF EXISTS `dashboard_operation_log`;

CREATE TABLE `dashboard_operation_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `company_id` bigint DEFAULT NULL,
  `operation` varchar(255) NOT NULL,
  `operation_remark` varchar(500) NOT NULL,
  `method_name` varchar(255) NOT NULL,
  `class_name` varchar(255) NOT NULL,
  `ip_address` varchar(50) DEFAULT NULL,
  `request_params` text,
  `execution_time_ms` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `dashboard_realtime_accumulate_day` */

DROP TABLE IF EXISTS `dashboard_realtime_accumulate_day`;

CREATE TABLE `dashboard_realtime_accumulate_day` (
  `device_id` varchar(100) NOT NULL COMMENT '设备ID',
  `date_year` int DEFAULT NULL COMMENT '年份',
  `date_month` int DEFAULT NULL COMMENT '月份',
  `date_day` int DEFAULT NULL COMMENT '日期',
  `upload_value` varchar(20) DEFAULT NULL COMMENT '上传值',
  `increment_today` varchar(20) DEFAULT NULL COMMENT '今天的增量',
  `upload_at` bigint DEFAULT NULL COMMENT '上传时间（时间戳）',
  UNIQUE KEY `uniq_device_date` (`device_id`,`date_year`,`date_month`,`date_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备每日累计数据表';

/*Table structure for table `dashboard_realtime_measure` */

DROP TABLE IF EXISTS `dashboard_realtime_measure`;

CREATE TABLE `dashboard_realtime_measure` (
  `device_id` varchar(100) NOT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `date_minute` int DEFAULT NULL,
  `date_second` int DEFAULT NULL,
  `upload_value` varchar(20) DEFAULT NULL,
  `min_value` varchar(20) DEFAULT NULL,
  `max_value` varchar(20) DEFAULT NULL,
  `upload_at` bigint DEFAULT NULL,
  PRIMARY KEY (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `dashboard_record_accumulate` */

DROP TABLE IF EXISTS `dashboard_record_accumulate`;

CREATE TABLE `dashboard_record_accumulate` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) DEFAULT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `date_minute` int DEFAULT NULL,
  `date_second` int DEFAULT NULL,
  `upload_value` varchar(20) DEFAULT NULL,
  `increment_today` varchar(20) DEFAULT NULL COMMENT '今天的增量',
  `increment_minute` varchar(20) DEFAULT NULL COMMENT '1分钟的增量',
  `upload_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `dashboard_record_measure` */

DROP TABLE IF EXISTS `dashboard_record_measure`;

CREATE TABLE `dashboard_record_measure` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `date_year` int DEFAULT NULL,
  `date_month` int DEFAULT NULL,
  `date_day` int DEFAULT NULL,
  `date_hour` int DEFAULT NULL,
  `date_minute` int DEFAULT NULL,
  `date_second` int DEFAULT NULL,
  `upload_value` varchar(20) DEFAULT NULL,
  `upload_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

/*Table structure for table `data_provider` */

DROP TABLE IF EXISTS `data_provider`;

CREATE TABLE `data_provider` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `flag` int NOT NULL DEFAULT '0' COMMENT '0=正常，1=删除',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
  `thumbnail_base64` text COMMENT '图片转base64格式',
  `remark` varchar(500) DEFAULT NULL,
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='数据提供方';

/*Table structure for table `data_provider_gateway_info` */

DROP TABLE IF EXISTS `data_provider_gateway_info`;

CREATE TABLE `data_provider_gateway_info` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `flag` int NOT NULL DEFAULT '0' COMMENT '0=正常，1=删除',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
  `remark` varchar(500) DEFAULT NULL,
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='网关情报';

/*Table structure for table `data_src_config` */

DROP TABLE IF EXISTS `data_src_config`;

CREATE TABLE `data_src_config` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `code` varchar(100) DEFAULT NULL COMMENT '数据来源识别代码',
  `api_key` varchar(100) DEFAULT NULL COMMENT 'api_key',
  `name` varchar(100) DEFAULT NULL COMMENT '数据来源名称',
  `method_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '来源方式(0:MQTT, 1:RESTFULL)',
  `params` varchar(1000) DEFAULT NULL COMMENT '链接参数',
  `state` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '状态 (0:激活, 1:冻结；)',
  `created_by` bigint DEFAULT NULL,
  `created_timestamp` timestamp NULL DEFAULT NULL,
  `updated_by` bigint DEFAULT NULL,
  `updated_timestamp` timestamp NULL DEFAULT NULL,
  `company_id` bigint NOT NULL,
  `device_id_position` varchar(100) DEFAULT NULL COMMENT '设备ID在JSON中的未知',
  `flag` int DEFAULT '0' COMMENT '0:正常；1:删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='数据来源配置表';

INSERT INTO data_src_config (`id`,`code`,`api_key`,`name`,`method_type`,`params`,`state`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`device_id_position`,`flag`) VALUES (1,'nittan-0001','nittan http interface','NITTANサーバ','1','{\"params\":{\"facility_info\":{\"facility_maker\":\"NITTAN\",\"facility_id\":\"Nihonbashi-Building\",\"facility_mode\":\"Maintenance\"},\"auth\":{\"code\":\"10001\",\"signature\":\"RvZYNReMpQBP13qTMfGVOLHYjY8=\",\"timestamp\":1681744941,\"subscription_id\":\"N22SHY3n\",\"version\":\"0.2\"},\"cmd\":\"notice\",\"notice_info\":[{\"device_info\":{\"device_name\":\"u696du52d9u7528u30acu30b9u906eu65adu5f01\",\"device_class\":\"Gas Detector\"},\"notice_level\":5,\"location_info\":{\"location_address\":\"01_B1_02_0002_76_TTEESSTT\"},\"notice_status\":\"GasAlarm\",\"notice_type\":\"Fire\"}]},\"type\":\"POST\",\"url\":\"/api/v2/to_dbm/nittan\"}','0',1,'2023-07-25 15:27:40',1,'2023-07-25 15:27:40',1,'$.notice_info[0].location_info.location_address',0);
INSERT INTO data_src_config (`id`,`code`,`api_key`,`name`,`method_type`,`params`,`state`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`device_id_position`,`flag`) VALUES (2,'data-0001','2738968','LOYTEC GateWay','0','{\"caPath\":\"66afa789-bdcd-4261-a031-11713c3a5e3a.pem\",\"clientCrtPath\":\"103e9305-f94f-454f-99d5-fe1539566e82.pem\",\"clientId\":\"loytechtest10_#{companyId}\",\"clientKeyPath\":\"2320d9d7-046f-47c9-b3dd-d9acf4539460.key\",\"connectionTimeout\":30000,\"description\":\"ssltest\",\"password\":\"a123456\",\"sslState\":false,\"topic\":\"loytech_publish_10_#{companyId}\",\"url\":\"tcp://tokyo-build-prod-nlb-7d7ae42ccf48709b.elb.ap-northeast-1.amazonaws.com:1883\",\"username\":\"mini\"}','0',1,'2023-07-31 12:47:33',1,'2024-01-10 10:14:51',1,'$.id',0);
INSERT INTO data_src_config (`id`,`code`,`api_key`,`name`,`method_type`,`params`,`state`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`device_id_position`,`flag`) VALUES (3,'IOServer-001','IOServer-001','IOServer-001','0','{\"caPath\":\"66afa789-bdcd-4261-a031-11713c3a5e3a.pem\",\"clientCrtPath\":\"103e9305-f94f-454f-99d5-fe1539566e82.pem\",\"clientId\":\"ioserver01_#{companyId}\",\"clientKeyPath\":\"2320d9d7-046f-47c9-b3dd-d9acf4539460.key\",\"connectionTimeout\":30000,\"description\":\"ioserver_01\",\"password\":\"a123456\",\"sslState\":false,\"topic\":\"ioserver_publish_01_#{companyId}\",\"url\":\"tcp://tokyo-build-prod-nlb-7d7ae42ccf48709b.elb.ap-northeast-1.amazonaws.com:1883\",\"username\":\"mini\"}','0',0,'2023-07-20 09:09:25',0,'2023-07-20 09:09:37',0,'$.Objs[0].N',0);



/*Table structure for table `device_alert_config` */

DROP TABLE IF EXISTS `device_alert_config`;

CREATE TABLE `device_alert_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_config_id` bigint NOT NULL COMMENT '设备类别配置ID',
  `alert_name` varchar(50) DEFAULT NULL COMMENT '设备告警名称',
  `level` varchar(20) DEFAULT NULL COMMENT '告警级别',
  `contents` varchar(200) DEFAULT NULL COMMENT '告警内容',
  `type` varchar(100) DEFAULT NULL COMMENT '告警类型',
  `message` varchar(999) DEFAULT NULL COMMENT '告警信息',
  `flag` int DEFAULT '0' COMMENT '0 开启，1关闭',
  `template_defs` varchar(999) DEFAULT NULL COMMENT '模板定义',
  `target_id` varchar(100) DEFAULT NULL COMMENT '用户自定义输入ID',
  `problem_report_category_id` varchar(100) DEFAULT NULL COMMENT '用户自定义输入ID2',
  `forward_type` varchar(20) DEFAULT NULL COMMENT '转发类型（  "api｜mail｜api&mail")    ',
  `building_id` varchar(100) DEFAULT NULL COMMENT '业务自定ID',
  `building_code` varchar(100) DEFAULT NULL COMMENT '用户自定义楼宇',
  `alert_cancel_template_defs` varchar(999) DEFAULT '' COMMENT '告警解除模板定义',
  `alert_cancel_message` varchar(999) DEFAULT '' COMMENT '告警解除模板初步填充后内容',
  `alert_title` varchar(999) DEFAULT NULL,
  `alert_cancel_title` varchar(999) DEFAULT NULL,
  PRIMARY KEY (`id`),
   KEY `idx_device_alert_config` (`device_config_id`,`flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备告警信息';

/*Table structure for table `device_alert_template` */

DROP TABLE IF EXISTS `device_alert_template`;

CREATE TABLE `device_alert_template` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `platform_type` int DEFAULT '0' COMMENT '0-third，1-dashboard',
  `tmpl_name` varchar(100) DEFAULT NULL,
  `level` varchar(20) DEFAULT NULL COMMENT '告警级别',
  `message` varchar(999) DEFAULT NULL COMMENT '告警信息',
  `flag` int DEFAULT '0' COMMENT '0 开启，1关闭',
  `template_defs` varchar(999) DEFAULT NULL COMMENT '模板定义',
  `forward_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转发类型api, mail, sms',
  `alert_cancel_template_defs` varchar(999) DEFAULT '' COMMENT '告警解除模板定义',
  `alert_cancel_message` varchar(999) DEFAULT '' COMMENT '告警解除模板初步填充后内容',
  `alert_title` varchar(999) DEFAULT NULL,
  `alert_cancel_title` varchar(999) DEFAULT NULL,
  `alert_recipient_mail` varchar(1000) DEFAULT NULL COMMENT '邮件通知对象',
  `alert_recipient_sms` varchar(1000) DEFAULT NULL COMMENT '短信通知对象',
  `effective_period` varchar(200) DEFAULT NULL COMMENT '告警有效时间段',
  `alert_recipient_slack_ids` varchar(500) DEFAULT NULL,
  `alert_recipient_teams_ids` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备告警模板';

/*Table structure for table `device_alert_template_bind` */

DROP TABLE IF EXISTS `device_alert_template_bind`;

CREATE TABLE `device_alert_template_bind` (
  `device_info_id` int NOT NULL COMMENT 'device_info表里的id',
  `device_alert_template_id` bigint NOT NULL,
   KEY `idx_device_alert_template_bind` (`device_info_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `device_buildin_functions` */

DROP TABLE IF EXISTS `device_buildin_functions`;

CREATE TABLE `device_buildin_functions` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `function_name` varchar(100) DEFAULT NULL COMMENT '函数名称',
  `function_description` varchar(200) DEFAULT NULL COMMENT '函数作用描述',
  `function_type` varchar(2) DEFAULT NULL COMMENT '函数类别',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备信息内置函数';

/*Table structure for table `device_category` */

DROP TABLE IF EXISTS `device_category`;

CREATE TABLE `device_category` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `category_name_cn` varchar(255) DEFAULT NULL,
  `category_name_jp` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '类别名',
  `category_name_en` varchar(255) DEFAULT NULL,
  `flag` int DEFAULT NULL COMMENT '0-正常，1-删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `device_forward_config` */

DROP TABLE IF EXISTS `device_forward_config`;

CREATE TABLE `device_forward_config` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` bigint NOT NULL COMMENT '设备信息ID',
  `target_forward_id` bigint DEFAULT NULL COMMENT '转发信息ID',
  `created_by` bigint DEFAULT NULL,
  `created_date` timestamp NULL DEFAULT NULL,
  `updated_by` bigint DEFAULT NULL,
  `updated_date` timestamp NULL DEFAULT NULL,
  `data_type` int DEFAULT NULL COMMENT '数据转发类型 0:general forward,  1:alert forward',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备与转发地址关系表';

/*Table structure for table `device_info` */

DROP TABLE IF EXISTS `device_info`;

CREATE TABLE `device_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_id` varchar(45) NOT NULL,
  `device_sn` varchar(99) DEFAULT NULL COMMENT '用于记录SN，当SN与deviceId不同时使用',
  `type_id` int DEFAULT NULL,
  `wsclient_id` int DEFAULT NULL,
  `space_id` bigint DEFAULT NULL COMMENT '空间ID',
  `device_name` varchar(200) DEFAULT NULL COMMENT '设备名称',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `building_id` bigint DEFAULT NULL COMMENT '楼宇ID',
  `asset_id` bigint DEFAULT NULL COMMENT '资产ID',
  `gateway_client_id` int DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0:正常；1:删除',
  `company_id` bigint DEFAULT NULL COMMENT '公司ID',
  `created_by` bigint DEFAULT NULL,
  `created_timestamp` timestamp NULL DEFAULT NULL,
  `updated_by` bigint DEFAULT NULL,
  `updated_timestamp` bigint DEFAULT NULL,
  `project_id` bigint DEFAULT NULL COMMENT '项目ID',
  `floor_id` bigint DEFAULT NULL COMMENT '楼宇ID',
  `update_interval` int DEFAULT NULL COMMENT '处理间隔',
  `monitoring_point_name` varchar(255) DEFAULT NULL COMMENT '监视点名称',
  `monitoring_point_category_id` bigint DEFAULT NULL COMMENT '监视点类别ID',
  `data_provider_id` bigint DEFAULT NULL COMMENT '数据提供方',
  `gateway_info_id` bigint DEFAULT NULL COMMENT '网关情报',
  `alarm_level` int DEFAULT NULL COMMENT 'dashboard警报的级别，1-正常，2-紧急，3-严重故障，4-中等故障，5-轻微故障',
  `retain_alert` int DEFAULT '0' COMMENT 'dashboard自动恢复告警时是否保留告警：0-不保留，1-保留',
  `unit` varchar(45) DEFAULT NULL,
  `data_mapping` json DEFAULT NULL COMMENT '数据映射关系，格式为：{"default":{"1":"漏水","2":"漏电","3":"起火"},"status":{"1":"开门","2":"关门"}}，默认只有default一个字段，预留多字段设计',
  `dashboard_decimal_places` int DEFAULT '2' COMMENT 'dashboard显示小数位数',
  PRIMARY KEY (`id`),
  KEY `idx_device_info` (`device_id`,`flag`,`type_id`),
  KEY `idx_device_info_query` (`device_id`,`flag`),
  KEY `idx_asset_flag_type` (`asset_id`,`flag`,`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='需要解析的zeta设备';

/*Table structure for table `device_rawdata_realtime` */

DROP TABLE IF EXISTS `device_rawdata_realtime`;

CREATE TABLE `device_rawdata_realtime` (
  `device_id` varchar(100) NOT NULL,
  `building_id` bigint DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '和aurora rawdata表的status一致，另外加【手动处理:manually_process】',
  `receive_ts` bigint DEFAULT NULL,
  `alert_title` varchar(200) DEFAULT NULL,
  `alert_content` text,
  `alert_cancel_title` varchar(200) DEFAULT NULL,
  `alert_cancel_content` text,
  `raw_data` text,
  `upload_year` int DEFAULT NULL,
  `upload_month` int DEFAULT NULL,
  `upload_day` int DEFAULT NULL,
  `dashboard_status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`device_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `device_threshold_config` */

DROP TABLE IF EXISTS `device_threshold_config`;

CREATE TABLE `device_threshold_config` (
  `id` int NOT NULL,
  `device_config_id` bigint NOT NULL COMMENT '设备配置信息ID',
  `threshold_name` varchar(200) DEFAULT NULL COMMENT '阈值名称',
  `threshold_condition` varchar(200) DEFAULT NULL COMMENT '阈值触发条件',
  `threshold_value` varchar(200) DEFAULT NULL COMMENT '阈值',
  `created_by` varchar(20) DEFAULT NULL COMMENT '创建人',
  `created_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` varchar(20) DEFAULT NULL COMMENT '更新人',
  `updated_timestamp` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备阈值';

/*Table structure for table `device_trends_stats` */

DROP TABLE IF EXISTS `device_trends_stats`;

CREATE TABLE `device_trends_stats` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `reciever_device_id_delta` bigint DEFAULT NULL COMMENT '收到设备数据增量',
  `sender_device_id_delta` bigint DEFAULT NULL,
  `sender_dispatch_delta` bigint DEFAULT NULL COMMENT '转发数据量',
  `sender_alert_delta` int DEFAULT NULL,
  `sender_alert_cancel_delta` int DEFAULT NULL,
  `created_time` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `device_trends_stats_time_index` (`created_time` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备统计信息';

/*Table structure for table `favorited_device` */

DROP TABLE IF EXISTS `favorited_device`;

CREATE TABLE `favorited_device` (
  `device_id` varchar(100) NOT NULL,
  `create_at` bigint DEFAULT NULL,
  PRIMARY KEY (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `flyway_schema_history` */

DROP TABLE IF EXISTS `flyway_schema_history`;

CREATE TABLE `flyway_schema_history` (
  `installed_rank` int NOT NULL,
  `version` varchar(50) DEFAULT NULL,
  `description` varchar(200) NOT NULL,
  `type` varchar(20) NOT NULL,
  `script` varchar(1000) NOT NULL,
  `checksum` int DEFAULT NULL,
  `installed_by` varchar(100) NOT NULL,
  `installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `execution_time` int NOT NULL,
  `success` tinyint(1) NOT NULL,
  PRIMARY KEY (`installed_rank`),
  KEY `flyway_schema_history_s_idx` (`success`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `gateway_client_status_history` */

DROP TABLE IF EXISTS `gateway_client_status_history`;

CREATE TABLE `gateway_client_status_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `client_id` varchar(100) DEFAULT NULL,
  `status` int DEFAULT NULL COMMENT '0:离线\\\\n1:在线\\\\n',
  `ts` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `gateway_clients` */

DROP TABLE IF EXISTS `gateway_clients`;

CREATE TABLE `gateway_clients` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(100) DEFAULT NULL,
  `client_name` varchar(45) DEFAULT NULL,
  `address` varchar(512) DEFAULT NULL COMMENT '安装地址',
  `online_status` int DEFAULT '-1' COMMENT '在线状态\\n-1:未知，0:离线，1:在线',
  `last_updata_ts` bigint DEFAULT NULL,
  `create_ts` bigint DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '是否删除\n0:正常\n1:删除',
  `company_id` bigint DEFAULT NULL,
  `data_amount_threshold` int DEFAULT NULL COMMENT '数据量阈值',
  `data_amount_threshold_alarm` int DEFAULT '0' COMMENT '数据量阈值告警，0=正常，1=告警',
  `data_accumulated_totals` int DEFAULT NULL COMMENT '累计数据量',
  `alert_switch` int DEFAULT '1' COMMENT '告警开关，1:开，0:关',
  `project_id` bigint DEFAULT '0',
  `building_id` bigint DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `gateway_clients_statistics` */

DROP TABLE IF EXISTS `gateway_clients_statistics`;

CREATE TABLE `gateway_clients_statistics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `client_id` varchar(100) DEFAULT NULL,
  `5_min_count` int DEFAULT NULL,
  `ts` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `client_id` (`client_id`,`ts`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='数据量统计';

/*Table structure for table `jg_ws_clients` */

DROP TABLE IF EXISTS `jg_ws_clients`;

CREATE TABLE `jg_ws_clients` (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` varchar(100) NOT NULL,
  `heartbeat` int DEFAULT NULL,
  `reconnect_interval` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `login_history` */

DROP TABLE IF EXISTS `login_history`;

CREATE TABLE `login_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `request_ip` varchar(255) DEFAULT NULL,
  `login_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `mail_sent_result` */

DROP TABLE IF EXISTS `mail_sent_result`;

CREATE TABLE `mail_sent_result` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` varchar(255) DEFAULT NULL,
  `log_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT 'roid1,roid2,mail',
  `status` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'Failed-失败，Successed-成功',
  `error_msg` text,
  `log_time` bigint DEFAULT NULL,
  `detail` text COMMENT '详情',
  `building_name` varchar(255) DEFAULT NULL COMMENT '楼宇名',
  `floor_name` varchar(255) DEFAULT NULL COMMENT '楼层名',
  `device_name` varchar(255) DEFAULT NULL COMMENT '设备名称',
  `device_sn` varchar(255) DEFAULT NULL COMMENT 'sn',
  `alert_type` int DEFAULT NULL COMMENT '1-告警，2-恢复告警，3-无效告警',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `metcom_ble_space_info` */

DROP TABLE IF EXISTS `metcom_ble_space_info`;

CREATE TABLE `metcom_ble_space_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `space_id` varchar(45) DEFAULT NULL,
  `ble_id` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `metcom_locate_record` */

DROP TABLE IF EXISTS `metcom_locate_record`;

CREATE TABLE `metcom_locate_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(45) DEFAULT NULL,
  `space_id` varchar(45) DEFAULT NULL,
  `ble_id` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid_UNIQUE` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `monitor_receiver_info` */

DROP TABLE IF EXISTS `monitor_receiver_info`;

CREATE TABLE `monitor_receiver_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `status` varchar(4) NOT NULL COMMENT '状态',
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '时间戳（支持时间查询）',
  `date_format` varchar(20) NOT NULL COMMENT '提供给前端，用于显示时间',
  `start_up_date` timestamp NULL DEFAULT NULL COMMENT '服务启动时间戳',
  `response_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `monitor_receiver_info_date_index` (`created_date` DESC) COMMENT '启动时间戳（倒序）'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监控monitor的服务';

/*Table structure for table `monitor_sender_info` */

DROP TABLE IF EXISTS `monitor_sender_info`;

CREATE TABLE `monitor_sender_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `status` varchar(4) NOT NULL COMMENT '状态',
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '时间戳（支持时间查询）',
  `date_format` varchar(20) NOT NULL COMMENT '提供给前端，用于显示时间',
  `start_up_date` timestamp NULL DEFAULT NULL COMMENT '服务启动时间戳',
  `response_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `monitor_sender_info_date_index` (`created_date` DESC) COMMENT '启动时间戳（倒序）'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监控monitor的服务';


/*Table structure for table `monitoring_point_category` */

DROP TABLE IF EXISTS `monitoring_point_category`;

CREATE TABLE `monitoring_point_category` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `name` varchar(500) NOT NULL,
  `thumbnail_normal_base64` text COMMENT '普通图片转base64格式',
  `thumbnail_alarm_base64` text COMMENT '告警图片转base64格式',
  `thumbnail_dis_base64` text COMMENT '灰色图片转base64格式',
  `remark` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监视点分类';

/*Table structure for table `monitoring_point_category_group` */

DROP TABLE IF EXISTS `monitoring_point_category_group`;

CREATE TABLE `monitoring_point_category_group` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `building_id` bigint DEFAULT NULL COMMENT '所属楼宇ID',
  `name` varchar(500) NOT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监视点分类分组表';

/*Table structure for table `monitoring_point_category_group_relation` */

DROP TABLE IF EXISTS `monitoring_point_category_group_relation`;

CREATE TABLE `monitoring_point_category_group_relation` (
  `monitoring_point_category_id` bigint NOT NULL COMMENT 'monitoring_point_category表里的id',
  `monitoring_point_category_group_id` bigint NOT NULL COMMENT 'monitoring_point_category_group表里的id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='监视点分类与分组关系表';



/*Table structure for table `mqtt_config` */

DROP TABLE IF EXISTS `mqtt_config`;

CREATE TABLE `mqtt_config` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `mqtt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `mqtt_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '格式为ip:port',
  `mqtt_username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'mqtt用户名',
  `mqtt_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'mqtt密码',
  `mqtt_client_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `mqtt_topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_enabled` int DEFAULT '0' COMMENT '0-启动，1-关闭',
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `apikey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  `creator_id` bigint DEFAULT NULL,
  `modify_time` bigint DEFAULT NULL,
  `modifier_id` bigint DEFAULT NULL,
  `purpose_type` int DEFAULT '1' COMMENT '1-告警转发，2-全部转发',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

/*Table structure for table `mqtt_device_relation` */

DROP TABLE IF EXISTS `mqtt_device_relation`;

CREATE TABLE `mqtt_device_relation` (
  `device_id` bigint NOT NULL COMMENT '设备信息ID',
  `mqtt_id` bigint DEFAULT NULL COMMENT 'MQTT的ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `mqtt_history` */

DROP TABLE IF EXISTS `mqtt_history`;

CREATE TABLE `mqtt_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content` text,
  `ts` varchar(14) DEFAULT NULL,
  `company` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `mqtt_history_2022_11_before` */

DROP TABLE IF EXISTS `mqtt_history_2022_11_before`;

CREATE TABLE `mqtt_history_2022_11_before` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content` text,
  `ts` varchar(14) DEFAULT NULL,
  `company` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `mqtt_publisher` */

DROP TABLE IF EXISTS `mqtt_publisher`;

CREATE TABLE `mqtt_publisher` (
  `id` int NOT NULL AUTO_INCREMENT,
  `host` varchar(999) NOT NULL,
  `username` varchar(45) NOT NULL,
  `password` varchar(45) NOT NULL,
  `topic` varchar(45) NOT NULL,
  `description` varchar(999) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `nittan_code_match` */

DROP TABLE IF EXISTS `nittan_code_match`;

CREATE TABLE `nittan_code_match` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_class` varchar(45) DEFAULT NULL,
  `notice_type` varchar(45) DEFAULT NULL,
  `notice_level` int DEFAULT NULL,
  `notice_status` varchar(45) DEFAULT NULL,
  `facility_mode` varchar(45) DEFAULT NULL,
  `dbm_code` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `notification_slack` */

DROP TABLE IF EXISTS `notification_slack`;

CREATE TABLE `notification_slack` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `identity` varchar(100) NOT NULL,
  `webhook` varchar(1000) NOT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `notification_teams` */

DROP TABLE IF EXISTS `notification_teams`;

CREATE TABLE `notification_teams` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `company_id` bigint DEFAULT NULL,
  `identity` varchar(100) NOT NULL,
  `webhook` varchar(1000) NOT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0-正常，1-删除',
  `created_by` bigint DEFAULT NULL,
  `created_at` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `ocr_history` */

DROP TABLE IF EXISTS `ocr_history`;

CREATE TABLE `ocr_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_sn` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `value` double DEFAULT NULL,
  `ts` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `restful_history` */

DROP TABLE IF EXISTS `restful_history`;

CREATE TABLE `restful_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content` varchar(9999) DEFAULT NULL,
  `company` varchar(45) DEFAULT NULL,
  `ts` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `rili_personnas_history` */

DROP TABLE IF EXISTS `rili_personnas_history`;

CREATE TABLE `rili_personnas_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `personnas_space_id` varchar(100) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `record_ts` varchar(45) DEFAULT NULL,
  `value` int DEFAULT NULL,
  `check_ts` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `rili_personnas_latest` */

DROP TABLE IF EXISTS `rili_personnas_latest`;

CREATE TABLE `rili_personnas_latest` (
  `personnas_space_id` varchar(100) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `latest_ts` bigint DEFAULT NULL,
  `latest_value` int DEFAULT NULL,
  PRIMARY KEY (`personnas_space_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `s3_file_mapping` */

DROP TABLE IF EXISTS `s3_file_mapping`;

CREATE TABLE `s3_file_mapping` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `file_key` varchar(255) DEFAULT NULL,
  `s3_path` varchar(255) DEFAULT NULL,
  `create_time` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `sky_env_history` */

DROP TABLE IF EXISTS `sky_env_history`;

CREATE TABLE `sky_env_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `device_id` varchar(45) DEFAULT NULL,
  `rain_fall` double DEFAULT NULL,
  `ts` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `sys_env` */

DROP TABLE IF EXISTS `sys_env`;

CREATE TABLE `sys_env` (
  `env_key` varchar(45) NOT NULL DEFAULT 'default',
  `env_value` varchar(1024) DEFAULT NULL,
  `company_id` bigint DEFAULT NULL,
  UNIQUE KEY `uk_env_key_company` (`env_key`,`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='存储系统通用的环境参数和值';

/*Table structure for table `target_forward_config` */

DROP TABLE IF EXISTS `target_forward_config`;

CREATE TABLE `target_forward_config` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `target_forward_code` varchar(100) DEFAULT NULL COMMENT '转发识别代码',
  `target_forward_type` int DEFAULT NULL COMMENT '转发方式 0:MQTT, 1：RESTFUL',
  `target_forward_params` varchar(300) DEFAULT NULL COMMENT '转发参数，JSON形式存储',
  `created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `created_by` bigint DEFAULT NULL COMMENT '创建人',
  `updated_by` bigint DEFAULT NULL COMMENT '修改人',
  `updated_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `company_id` bigint NOT NULL COMMENT '公司ID',
  `flag` int DEFAULT '0' COMMENT '状态 0:正常，1:删除',
  `name` varchar(100) DEFAULT NULL COMMENT '转发目标名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='转发表';

/*Table structure for table `target_id_check` */

DROP TABLE IF EXISTS `target_id_check`;

CREATE TABLE `target_id_check` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `target_id` varchar(255) DEFAULT NULL,
  `alert_config_id` bigint NOT NULL,
  `target_id_value` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `target_id_check_index` (`target_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='校验targetId唯一性';

/*Table structure for table `trends_stats_total` */

DROP TABLE IF EXISTS `trends_stats_total`;

CREATE TABLE `trends_stats_total` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增',
  `receiver_device_id` bigint DEFAULT NULL,
  `sender_device_id` bigint DEFAULT NULL,
  `sender_building` bigint DEFAULT NULL,
  `dispatch` bigint DEFAULT NULL,
  `alert` bigint DEFAULT NULL,
  `alert_cancel` bigint DEFAULT NULL,
  `created_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `trends_stats_total_date_index` (`created_date` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='统计信息总量';

/*Table structure for table `type` */

DROP TABLE IF EXISTS `type`;

CREATE TABLE `type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL COMMENT '设备ID',
  `description` varchar(999) DEFAULT NULL COMMENT '备注',
  `device_type` varchar(200) DEFAULT NULL COMMENT '设备类别',
  `device_data_src` varchar(200) DEFAULT NULL COMMENT '设备数据来源',
  `origin_json_format` varchar(10000) DEFAULT NULL COMMENT '原始数据来源',
  `expression_map` varchar(500) DEFAULT NULL COMMENT '表达式映射',
  `expression_variable_map` varchar(500) DEFAULT NULL COMMENT '表达式变量map',
  `target_json_format` varchar(2000) DEFAULT NULL COMMENT '转发数据格式',
  `target_forward_id` bigint DEFAULT NULL COMMENT '转发目标ID',
  `target_foward_code` varchar(100) DEFAULT NULL COMMENT '转发识别代码',
  `created_by` bigint DEFAULT NULL COMMENT '创建人',
  `created_timestamp` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_by` bigint DEFAULT NULL,
  `updated_timestamp` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `company_id` bigint DEFAULT NULL,
  `space_id` bigint DEFAULT NULL,
  `flag` int DEFAULT '0' COMMENT '0:正常；1:删除',
  `dbm_id` varchar(5000) DEFAULT NULL COMMENT 'dbmId,{"[deviceId][dbm_id]":value}',
  `name_zh` varchar(45) DEFAULT NULL COMMENT 'name中文',
  `name_en` varchar(45) DEFAULT NULL COMMENT 'name eng',
  `device_category_id` bigint DEFAULT NULL COMMENT '设备大类ID',
  `unit` varchar(255) DEFAULT NULL COMMENT '单位信息',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='设备类别及备注，帮助识别设备类型和解析方式';

INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (1,'4-20 カスタム版',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_ultrasonic_flow_420','4-20 カスタム版','4-20 カスタム版',1,'L/min,A,Map,℃,pa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (2,'ZETA-水位センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_water_level','ZiFiSense水位センサー','ZiFiSense水位センサー',1,'A');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (3,'ZETA-ドライ接点センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_dry_contact','ZiFiSenseドライ接点センサー','ZiFiSenseドライ接点センサー',1,'運転／停止');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (4,'ZETA-BLEGW-0903',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_bth_gateway','ZETA-BLEGW-0903','ZETA-BLEGW-0903',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (5,'ZETA-ドライ接点センサーマルチチャンネル',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'','ZiFiSenseドライ接点センサーマルチチャンネル','ZiFiSenseドライ接点センサーマルチチャンネル',1,'運転／停止');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (6,'ZiFiSense標準485センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'ZiFiSense標準485センサー','ZiFiSense標準485センサー',1,'V,W,状態,A,kWh');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (7,'4-20水圧センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_ultrasonic_flow_420','4-20水圧センサー','4-20水圧センサー',1,'mpa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (8,'Watcher Pro3',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'Watcher Pro3','Watcher Pro3',1,'℃,誘電率,pH,dS/m,％,μmol/m2•s,℃,％RH,lux');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (9,'BlueTooth GateWay',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'BlueTooth GateWay','BlueTooth GateWay',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (10,'SZT200傾斜センサー(高分解能品) ',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_tilt_x,[deviceId]_tilt_y,[deviceId]_tilt_z','SZT200傾斜センサー(高分解能品) ','SZT200傾斜センサー(高分解能品) ',1,'度');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (11,'CO2センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_co2','CO2センサー','CO2センサー',1,'ppm,℃,％');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (12,'NBI WatcherMini2',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'NBI WatcherMini2','NBI WatcherMini2',1,'℃,%,lux');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (13,'ZETA-ドアセンサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_gate_magnetism','ドアセンサー','ドアセンサー',1,'開／閉');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (14,'人感センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_human','人感センサー','人感センサー',1,'在／不在');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (15,'JAZE 超音波距離センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_ultrasonic_distance','JAZE 超音波距離センサー','JAZE 超音波距離センサー',1,'cm');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (16,'照度センサー2.X',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_illumination','照度センサー2.X','照度センサー2.X',1,'lux');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (17,'ZETA-温湿度センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_temperature,[deviceId]_humidity','ZETA温湿度センサー','ZETA温湿度センサー',1,'℃,％RH');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (18,'ZETA 温度センサー（接点タイプ）',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_TZZTZT92','ZETA 温度センサー（接点タイプ）','ZETA 温度センサー（接点タイプ）',1,'℃');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (19,'ZETA-電流センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_current','ZETA電流センサー','ZETA電流センサー',1,'A');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (20,'skytechマルチ環境センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_wind_direction,[deviceId]_wind_speed,[deviceId]_Instantaneous_wind_speed,_[deviceId]tempe','skytechマルチ環境センサー','skytechマルチ環境センサー',1,'0°- 359°,m/s,℃,％,lux,mm,μW/㎠,％RH');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (21,'ZETA-漏水センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_leakage','漏水センサー','漏水センサー',1,'正常／漏水');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (22,'ZETA-漏水センサー（ケーブルタイプ）',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_leakage','ZETA 漏水センサー（ケーブルタイプ）','ZETA 漏水センサー（ケーブルタイプ）',1,'正常／漏水');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (23,'ニッタン',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'ニッタン','ニッタン',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (24,'4-20 電流測定用　範囲：0-5A',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_current_420','4-20 電流測定用　範囲：0-5A','4-20 電流測定用　範囲：0-5A',1,'A');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (25,'420 テスト用',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_test_420','420 テスト用','420 テスト用',1,'A');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (26,'485テスト用',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_485','485テスト用','485テスト用',1,'状態');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (27,'Oviphone',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'Oviphone','Oviphone',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (28,'ZETA-4~20mA(圧力2.5Mpa)',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_pressure_M025_420','420圧力2.5Mpa','420圧力2.5Mpa',1,'Mpa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (29,'ZETA-4~20mA(圧力1Mpa)',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_pressure_M010_420','420压力1Mpa','420压力1Mpa',1,'Mpa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (30,'ZETA-電流センサー-東京建物','“detectorid\":\"ID\",”ID-currentValue:VALUE“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-currentValue','ZETA電流センサー-東京建物','ZETA電流センサー-東京建物',1,'A');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (31,'ZETA-4~20mA(圧力1Mpa)-取得値','“detectorid\":\"ID\",”ID-current“, 31与32类别相同，一同解析',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'420圧力1Mpa-取得値-東京建物','420圧力1Mpa-取得値-東京建物',1,'mA');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (32,'ZETA-4~20mA(圧力1Mpa)-圧力値','“detectorid\":\"ID\",”ID-keyence“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-current','420圧力1Mpa-圧力値-東京建物','420圧力1Mpa-圧力値-東京建物',1,'Mpa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (33,'ZETA-漏水センサー-東京建物(旧)','“detectorid\":\"ID\",”ID-waterIntrusionStatus“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-waterIntrusionStatus','漏水センサー-東京建物','漏水センサー-東京建物',1,'正常／漏水');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (34,'ZETA-ドアセンサー-東京建物','“detectorid\":\"ID\",”ID-doorStatus“，34与35类别相同，一同解析',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'','ドアセンサー-ドアの開閉状態-東京建物','ドアセンサー-ドアの開閉状態-東京建物',1,'開／閉');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (35,'ドアセンサー-開閉回数-東京建物','“detectorid\":\"ID\",”ID-openTimes“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-doorStatus','ドアセンサー-開閉回数-東京建物','ドアセンサー-開閉回数-東京建物',1,'回');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (36,'ZETA-人感センサー','“detectorid\":\"ID\",”ID-checkResult“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-checkResult','人感センサー-東京建物','人感センサー-東京建物',1,'在／不在');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (40,'OCR','ASIOT-OCR Camera',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'OCR','OCR',1,'数値');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (41,'ZETA-温湿度センサー-東京建物','“detectorid\":\"ID\",”ID-temperature““ID-humidity”',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-temperature,[deviceId]-humidity','ZETA温湿度センサー-東京建物','ZETA温湿度センサー-東京建物',1,'℃,%RH');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (42,'JAZE CO2+温湿度','JZCD91A1',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_co2,[deviceId]_temperature,[deviceId]_humidity','JAZE CO2+温湿度','JAZE CO2+温湿度',1,'ppm,℃,％');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (43,'OCR_差分値','本次数据减去上次数据，得出的差值转发给DBM',NULL,'zeta-data-src-code-1',NULL,'','','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'OCR_差分値','OCR_差分値',1,'数値');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (44,'BA中央管理システムーテスト環境','中央監視系統TEST Dummy Data',NULL,'zeta-data-src-code-1',NULL,'','','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'BA中央管理システムーテスト環境','BA中央管理システムーテスト環境',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (45,'Test Device','ForTest',NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',11,'2738911',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'Test Device','Test Device',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (46,'Delta 故障','','DELTA03','mc-01','[{\"id\":\"BA0029\",\"type\":\"Boolean\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":false}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"$.id\":{\"$.id\":\"\"},\"getDeltaDataString($.this)\":{\"$.this\":\"getDeltaDataString\"}}','{\"deviceId\":\"$.id\"}',1,'1111111',NULL,NULL,1,'2024-09-12 16:11:30',2,NULL,0,'[deviceSn]_delta_failure','Delta 故障','Delta 故障',2,'ON-1/OFF-0');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (47,'Delta 計測','',NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_measurement','Delta 計測','Delta 計測',3,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (48,'Delta 積算',NULL,NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_accrual','Delta 積算','Delta 積算',4,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (49,'BLE漏水センサー','BLEゲートウェイ链接的无电漏水传感器',NULL,NULL,NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'BLE漏水センサー','BLE漏水センサー',1,'正常／漏水');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (50,'BLEbeacon','BLEゲートウェイ链接的人员定位',NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'BLEbeacon','BLEbeacon',1,'入室/退室');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (51,'485 transceiver电流传感器','电流传感器',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_Voltage_485,[deviceId]_Current_485,[deviceId]_Instantaneous_485','485 transceiver电流传感器','485 transceiver电流传感器',1,'A,V,kWh');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (52,'Delta 積算 * 0.1','Delta 積算 * 0.1',NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_accrual','Delta 積算 * 0.1','Delta 積算 * 0.1',4,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (53,'Metcom beacon',NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'Metcom beacon','Metcom beacon',1,'入室/退室');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (54,'4-20mAトランシーバー+温度トランスミッター','4-20mAトランシーバー+温度トランスミッター',NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'4-20mAトランシーバー+温度トランスミッター','4-20mAトランシーバー+温度トランスミッター',1,'℃');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (55,'ZETA水圧センサー',NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'ZETA水圧センサー','ZETA水圧センサー',1,'Mpa');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (56,'OCRカメラ「FALCON501」',NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'OCRカメラ「FALCON501」','OCRカメラ「FALCON501」',1,'数値');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (57,'MEBS-警報',NULL,NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,'[deviceSn]_delta_failure','MEBS-警報','MEBS-警報',2,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (58,'MEBS-計測',NULL,NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,'[deviceSn]_delta_measurement','MEBS-計測','MEBS-計測',3,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (59,'MEBS-計量',NULL,NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,'[deviceSn]_delta_accrual','MEBS-計量','MEBS-計量',4,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (60,'JAZE-温湿度センサー',NULL,NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_jzth_temperature,[deviceId]_jzth_humidity','JAZE温湿度センサー','JAZE温湿度センサー',1,'℃,%');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (61,'D485ZT92+M5X-UNIT',NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'2738969',NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'D485ZT92+M5X-UNIT','D485ZT92+M5X-UNIT',1,'A,V,kWh');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (62,'XX-UAT',NULL,'XX-UAT','XX-UAT','{\"a\":\"1\",\"b\":\"2\"}','{\"$.x\":\"$.a+$.b\"}','{\"$.a+$.b\":{\"$.a\":\"1\",\"$.b\":\"1\"}}','{x:x}',14,'2738969',1,NULL,1,NULL,2,NULL,0,NULL,'XX-UAT','XX-UAT',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (63,'3867',NULL,'3867','3867','{\"msgDirect\":\"report\",\"msgPriority\":\"normal\",\"msgType\":\"real\",\"msgId\":0,\"apTime\":1681139922,\"msgEncrypt\":\"none\",\"msgUid\":\"ffff0317\",\"msgCmd\":\"ms\",\"apUid\":\"4F00C8E2\",\"msgParam\":{\"subCmd\":\"report\",\"subType\":\"uploadData\",\"msUid\":\"4F00C8E2\",\"data\":\"01\",\"dataEncrypt\":\"devEncrypt\"},\"deviceAlias\":\"踊り場６番目\",\"deviceaddr\":\"B1階_FE00750A指定\"}','{\"$.deviceId\":\"$.apUid\"}','{\"$.apUid\":{\"$.apUid\":\"4F00C8E2\"}}','{deviceId:apiUid,data:\"01\"}',14,'2738969',1,NULL,1,NULL,2,NULL,0,NULL,'3867','3867',NULL,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (64,'zetaxx-uat001',NULL,'zetaxx-uat001','zetaxx-uat001','{\"msgDirect\":\"report\",\"msgPriority\":\"normal\",\"msgType\":\"real\",\"msgId\":0,\"apTime\":1681139922,\"msgEncrypt\":\"none\",\"msgUid\":\"ffff0317\",\"msgCmd\":\"ms\",\"apUid\":\"4F00C8E2\",\"msgParam\":{\"subCmd\":\"report\",\"subType\":\"uploadData\",\"msUid\":\"4F00C8E2\",\"data\":\"01\",\"dataEncrypt\":\"devEncrypt\"},\"deviceAlias\":\"踊り場６番目\",\"deviceaddr\":\"B1階_FE00750A指定\"}','{\"$.deviceId\":\"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.apUid\":{\"$.apUid\":\"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid,data:\"01\"}',14,'2738969',1,NULL,1,NULL,2,NULL,0,NULL,'zetaxx-uat001','zetaxx-uat001',1,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (65,'nittan','nittan common','nittan','nittan-special','{\"facility_info\": {\"facility_maker\": \"NITTAN\", \"facility_id\": \"Nihonbashi-Building\", \"facility_mode\": \"Normal\"}, \"auth\": {\"code\": \"10001\", \"signature\": \"RvZYNReMpQBP13qTMfGVOLHYjY8=\", \"timestamp\": 1681744941, \"subscription_id\": \"N22SHY3n\", \"version\": \"0.2\"}, \"cmd\": \"notice\", \"notice_info\": [{\"device_info\": {\"device_name\": \"u696du52d9u7528u30acu30b9u906eu65adu5f01\", \"device_class\": \"Heat Detector\"}, \"notice_level\": 1, \"location_info\": {\"location_address\": \"01_B1_02_0002_76\"}, \"notice_status\": \"FireAlarm\", \"notice_type\": \"Fire\"}]}','{\"$.deviceId\":\"$.notice_info[0].location_info.location_address\",\"$.this\":\"getNittanDataString($.this)\"}','{\"getNittanDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,'111111',1,NULL,1,NULL,2,NULL,0,NULL,'nittan','nittan',6,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (66,'nittan-no-forward','nittan common','nittan','nittan-special','{\"facility_info\": {\"facility_maker\": \"NITTAN\", \"facility_id\": \"Nihonbashi-Building\", \"facility_mode\": \"Normal\"}, \"auth\": {\"code\": \"10001\", \"signature\": \"RvZYNReMpQBP13qTMfGVOLHYjY8=\", \"timestamp\": 1681744941, \"subscription_id\": \"N22SHY3n\", \"version\": \"0.2\"}, \"cmd\": \"notice\", \"notice_info\": [{\"device_info\": {\"device_name\": \"u696du52d9u7528u30acu30b9u906eu65adu5f01\", \"device_class\": \"Heat Detector\"}, \"notice_level\": 1, \"location_info\": {\"location_address\": \"01_B1_02_0002_76\"}, \"notice_status\": \"FireAlarm\", \"notice_type\": \"Fire\"}]}','{\"$.deviceId\":\"$.notice_info[0].location_info.location_address\",\"$.this\":\"getNittanDataString($.this)\"}','{\"getNittanDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,'111111',1,NULL,1,NULL,2,NULL,0,NULL,'nittan-no-forward','nittan-no-forward',6,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (67,'Delta 故障-no-forward','',NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',0,'',NULL,NULL,NULL,NULL,2,NULL,0,NULL,'Delta 故障-no-forward','Delta 故障-no-forward',4,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (77,'testType-01','For test',NULL,'test01','{\"deviceId\":\"testId\",\"value\":100}','{\"$.deviceId\":\"$.deviceId\",\"$.value\":\"$.value\"}','{\"$.deviceId\":\"$.deviceId\",\"$.value\":\"$.value\"}','{\"deviceId\":\"$.deviceId\",\"value\":\"$.value\"}',1,'111111',2,NULL,2,NULL,2,NULL,0,NULL,'testType-01','testType-01',NULL,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (78,'TEST',NULL,'TEST','nittan-special','{\"ab\":\"qw\"}','{\"$.deviceId\":\"$.ab\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"$.ab\":{\"$.ab\":\"\"},\"getDeltaDataString($.this)\":{\"$.this\":\"getDeltaDataString\"}}','{\"deviceId\":\"$.ab\"}',1,NULL,1,'2023-12-07 11:33:03',1,'2023-12-07 11:33:07',2,NULL,1,NULL,'TEST','TEST',NULL,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (79,'IOSERVER',NULL,'ioserver_common','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,NULL,1,'2023-12-07 11:33:03',1,'2023-12-07 11:33:07',2,NULL,0,'','IOSERVER','IOSERVER',NULL,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (80,'daikin-ios-on/off',NULL,'daikin-ios-on/off','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'onoffmonitor_ios_[deviceId]','daikin-ios-on/off','daikin-ios-on/off',5,'on/off');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (81,'daikin-ios-故障コード',NULL,'daikin-ios-故障コード','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'ConditionerFailurecode_ios_[deviceId]','daikin-ios-故障コード','daikin-ios-故障コード',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (82,'daikin-ios-室内ファン',NULL,'daikin-ios-室内ファン','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'fanoperationmonit_ios_[deviceId]','daikin-ios-室内ファン','daikin-ios-室内ファン',5,'停止/運転');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (83,'daikin-ios-風量モニタ',NULL,'daikin-ios-風量モニタ','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'Airflowmonitor_ios_[deviceId]','daikin-ios-風量モニタ','daikin-ios-風量モニタ',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (84,'daikin-ios-風量指令',NULL,'daikin-ios-風量指令','IOServer-001','{\"PNs\":{\"1\":\"V\",\"2\":\"T\",\"3\":\"Q\"},\"PVs\":{\"1\":26.0,\"2\":\"2023-12-07 16:24:37.967\",\"3\":192},\"Objs\":[{\"N\":\"Tag3101074\"}]}','{\"$.deviceId\":\"$.Objs[0].N\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"getKingIODataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'Airflowcomd_ios_[deviceId]','daikin-ios-風量指令','daikin-ios-風量指令',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (85,'JAZE-漏水センサー','“detectorid\":\"ID\",”ID_jzth_leakage“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_jzth_leakage','JAZE漏水センサー','JAZE漏水センサー',1,'正常／漏水');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (86,'ba-発停状態',NULL,NULL,'delta','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getDeltaDataString($.this)\"}','{\"getDeltaDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_status','BA状态','BA Status',7,NULL);
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (87,'测试',NULL,'测试0011','cus02','{\"name\":null}','{\"$.deviceId\":\"$.name\",\"$.this\":\"getOCRDataString($.this)\"}','{\"$.name\":{\"$.name\":\"\"},\"getOCRDataString($.this)\":{\"$.this\":\"getOCRDataString\"}}','{\"deviceId\":\"$.name\"}',1,NULL,1,'2024-07-02 21:51:13',1,'2024-07-02 21:51:44',2,NULL,1,'测试','测试',NULL,4,'测试');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (88,'测试',NULL,'10000test','cus02','{\"name\":null}','{\"$.deviceId\":\"$.name\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.name\":{\"$.name\":\"\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{\"deviceId\":\"$.name\"}',1,NULL,1,'2024-07-02 22:50:24',1,'2024-07-02 22:50:24',2,NULL,0,'','测试',NULL,2,'测试');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (89,'custom-01',NULL,'custom-01','mc-01','{\"id\":\"C-TEST-01\",\"type\":\"Analog\",\"reportedAt\":\"1717428882.4614446\",\"value\":333}','{\"$.deviceId\":\"$.id\",\"$.value\":\"getBooleanIntValue($.value)\"}','{\"$.id\":{\"$.id\":\"\"},\"getBooleanIntValue($.value)\":{\"getBooleanIntValue($.value)\":\"getBooleanIntValue($.value)\"}}','{\"deviceId\":\"$.id\",\"value\":\"getBooleanIntValue($.value)\"}',1,NULL,1,'2024-07-30 22:53:49',1,'2024-07-30 23:03:03',2,NULL,0,'',NULL,NULL,1,'%');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (90,'TEST6451CC',NULL,'TEST6451CC','nittan-special','{\"acCC\":\"bcCC\"}','{\"$.field\":\"$.ac\"}','{\"$.ac\":{\"$.ac\":\"\"}}','{\"field\":\"$.ac\"}',1,NULL,1,'2024-11-01 19:31:38',1,'2024-11-01 19:32:30',2,NULL,1,'66','TEST6451CC',NULL,2,'$');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (91,'振動センサー_updata',NULL,'ZAIoT-VTD01','kafka-001','{\"payload\": {\"data\": {\"upTime\": 1695176626061,\"apTime\": 1695176625000,\"parsedData\": \"{\\\"accelerationRms\\\":{\\\"name\\\":\\\"加速度RMS\\\",\\\"nameEn\\\":\\\"Acceleration RMS\\\",\\\"nameJp\\\":\\\"加速度RMS\\\",\\\"rawValue\\\":0.13,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.13},\\\"dataStatus\\\":\\\"normal\\\",\\\"displPeakValue\\\":{\\\"name\\\":\\\"位移峰峰值\\\",\\\"nameEn\\\":\\\"Displacement peak to peak\\\",\\\"nameJp\\\":\\\"変位ピーク・ツー・ピーク\\\",\\\"rawValue\\\":3.5,\\\"unit\\\":\\\"μm\\\",\\\"value\\\":3.5},\\\"envelopeHarmonicsFactor\\\":{\\\"name\\\":\\\"包络谐频因子\\\",\\\"nameEn\\\":\\\"Envelope harmonics factor\\\",\\\"nameJp\\\":\\\"エンベロープ高調波係数\\\",\\\"rawValue\\\":0.04,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.04},\\\"envelopeHarmonicsFreq\\\":{\\\"name\\\":\\\"包络谐频主频\\\",\\\"nameEn\\\":\\\"Envelope harmonics frequency\\\",\\\"nameJp\\\":\\\"エンベロープの高調マスター周波数\\\",\\\"rawValue\\\":419.5,\\\"unit\\\":\\\"Hz\\\",\\\"value\\\":419.5},\\\"envelopeRotationFactor\\\":{\\\"name\\\":\\\"包络转频因子\\\",\\\"nameEn\\\":\\\"Envelope rotation factor\\\",\\\"nameJp\\\":\\\"エンベロープ回転係数\\\",\\\"rawValue\\\":0.01,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.01},\\\"envelopeRotationFreq\\\":{\\\"name\\\":\\\"包络转频主频\\\",\\\"nameEn\\\":\\\"Envelope rotation frequency\\\",\\\"nameJp\\\":\\\"エンベロープの回転マスター周波数\\\",\\\"rawValue\\\":6.25,\\\"unit\\\":\\\"Hz\\\",\\\"value\\\":6.25},\\\"harmonicsFreq\\\":{\\\"name\\\":\\\"谐频主频\\\",\\\"nameEn\\\":\\\"Harmonics frequency\\\",\\\"nameJp\\\":\\\"高調マスター周波数\\\",\\\"rawValue\\\":314.06,\\\"unit\\\":\\\"Hz\\\",\\\"value\\\":314.06},\\\"harmonicsRms\\\":{\\\"name\\\":\\\"谐频RMS\\\",\\\"nameEn\\\":\\\"Harmonics RMS\\\",\\\"nameJp\\\":\\\"高調波RMS\\\",\\\"rawValue\\\":0.02,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.02},\\\"header\\\":\\\"01\\\",\\\"highFreqRms\\\":{\\\"name\\\":\\\"高频RMS\\\",\\\"nameEn\\\":\\\"High RMS\\\",\\\"nameJp\\\":\\\"高周波RMS\\\",\\\"rawValue\\\":0.08,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.08},\\\"kurtosis\\\":{\\\"name\\\":\\\"峭度\\\",\\\"nameEn\\\":\\\"kurtosis\\\",\\\"nameJp\\\":\\\"尖度\\\",\\\"rawValue\\\":2.94,\\\"unit\\\":\\\"\\\",\\\"value\\\":2.94},\\\"lowFreqRms\\\":{\\\"name\\\":\\\"低频RMS\\\",\\\"nameEn\\\":\\\"Low RMS\\\",\\\"nameJp\\\":\\\"低周波RMS\\\",\\\"rawValue\\\":0.03,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.03},\\\"lubricationFactor\\\":{\\\"name\\\":\\\"润滑因子\\\",\\\"nameEn\\\":\\\"Lubrication factor\\\",\\\"nameJp\\\":\\\"潤滑係数\\\",\\\"rawValue\\\":0.01,\\\"unit\\\":\\\"m/s²\\\",\\\"value\\\":0.01},\\\"medianRms\\\":{\\\"name\\\":\\\"中频RMS\\\",\\\"nameEn\\\":\\\"Median RMS\\\",\\\"','{\"$.deviceId\":\"$.payload.data.msUid\",\"$.this\":\"getZAIoTDataString($.this)\"}','{\"getZAIoTDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_LowRms,[deviceId]_MedianRms,[deviceId]_VelocityRms,[deviceId]_AccelerationRms,[deviceId]_','振动传感器_updata','ZAIoT-VTD01',1,NULL);
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (92,'振動センサー_alarmData',NULL,'ZAIoT-VTD01','kafka-001','{\"payload\": {\"data\": {\"upTime\": 1696846550673,\"parsedData\": \"{\\\"xRotationRMS_nameEn\\\":\\\"X-Rotation RMS\\\",\\\"voltage_value\\\":3.0,\\\"xLubricationFactor_rawValue\\\":4.24,\\\"temperature_unit\\\":\\\"℃\\\",\\\"temperature_value\\\":50.8,\\\"xHarmonicsRMS_rawValue\\\":8.49,\\\"voltage_name\\\":\\\"电压\\\",\\\"voltage_unit\\\":\\\"v\\\",\\\"ySpeedRMS_nameEn\\\":\\\"Y-velocity RMS\\\",\\\"temperature_name\\\":\\\"温度\\\",\\\"zHarmonicsRMS_value\\\":4.43,\\\"yAccelerationRMS_rawValue\\\":3.55,\\\"xRotationRMS_value\\\":3.6,\\\"xSpeedRMS_unit\\\":\\\"mm/s\\\",\\\"xMeshRMS_value\\\":4.92,\\\"xShockRMS_value\\\":3.35,\\\"zSpeedRMS_nameJp\\\":\\\"Z-速度rms\\\",\\\"temperature_rawValue\\\":50.8,\\\"zHarmonicsRMS_nameJp\\\":\\\"Z-高調波周波数rms\\\",\\\"yHarmonicsRMS_rawValue\\\":1.56,\\\"xAccelerationRMS_rawValue\\\":5.34,\\\"xMeshRMS_unit\\\":\\\"m/s²\\\",\\\"ySpeedRMS_rawValue\\\":4.05,\\\"zShockRMS_nameEn\\\":\\\"Z-Shock RMS\\\",\\\"xHarmonicsRMS_unit\\\":\\\"m/s²\\\",\\\"xHarmonicsRMS_value\\\":8.49,\\\"ySpeedRMS_name\\\":\\\"Y-速度rms\\\",\\\"yMeshRMS_unit\\\":\\\"m/s²\\\",\\\"dataStatus\\\":\\\"normal\\\",\\\"zLubricationFactor_value\\\":8.84,\\\"yMeshRMS_name\\\":\\\"Y-啮合rms\\\",\\\"xSpeedRMS_name\\\":\\\"X-速度rms\\\",\\\"zMeshRMS_unit\\\":\\\"m/s²\\\",\\\"zRotationRMS_rawValue\\\":7.58,\\\"zMeshRMS_name\\\":\\\"Z-啮合rms\\\",\\\"temperature_nameEn\\\":\\\"temperature\\\",\\\"xLubricationFactor_nameJp\\\":\\\"X-潤滑係数\\\",\\\"xSpeedRMS_value\\\":6.09,\\\"zHarmonicsRMS_unit\\\":\\\"m/s²\\\",\\\"yHarmonicsRMS_value\\\":1.56,\\\"xMeshRMS_name\\\":\\\"X-啮合rms\\\",\\\"xHarmonicsRMS_nameEn\\\":\\\"X-Harmonics RMS\\\",\\\"zAccelerationRMS_rawValue\\\":70.19,\\\"zHarmonicsRMS_name\\\":\\\"Z-谐频rms\\\",\\\"xMeshRMS_nameEn\\\":\\\"X-Mesh RMS\\\",\\\"xShockRMS_nameEn\\\":\\\"X-Shock RMS\\\",\\\"yRotationRMS_unit\\\":\\\"m/s²\\\",\\\"yLubricationFactor_name\\\":\\\"Y-润滑因子\\\",\\\"yLubricationFactor_value\\\":2.08,\\\"voltage_nameJp\\\":\\\"電圧\\\",\\\"yRotationRMS_name\\\":\\\"Y-转频rms\\\",\\\"ySpeedRMS_unit\\\":\\\"mm/s\\\",\\\"yLubricationFactor_nameEn\\\":\\\"Y-Lubrication factor\\\",\\\"zShockRMS_value\\\":66.41,\\\"yLubricationFactor_unit\\\":\\\"m/s²\\\",\\\"yShockRMS_nameJp\\\":\\\"Y-衝撃rms\\\",\\\"yRotationRMS_nameJp\\\":\\\"Y-回転周波数rms\\\",\\\"xAccelerationRMS_value\\\":5.34,\\\"ySpeedRMS_value\\\":4.05,\\\"xHarmonicsRMS_name\\\":\\\"X-谐频rms\\\",\\\"xMeshRMS_rawValu','{\"$.deviceId\":\"$.payload.data.msUid\",\"$.this\":\"getZAIoTDataString($.this)\"}','{\"getZAIoTDataString($.this)\":{\"$.this\":\"$.this\"}}','{deviceId:apiUid}',1,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_state','振动传感器_alarmData','ZAIoT-VTD01',1,NULL);
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (93,'ドアセンサー-状態','“detectorid\":\"ID\",”ID-doorStatus“，34与35类别相同，一同解析',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]_delta_status','ドアセンサー-状態','ドアセンサー-ドアの開閉状態-東京建物',7,NULL);
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (94,'ドアセンサー-givtech','“detectorid\":\"ID\",”ID-openTimes“',NULL,'zeta-data-src-code-1',NULL,'{\"$.deviceId\": \"$.msgParam.msUid\",\"$.this\":\"getZetaDataString($.this)\"}','{\"$.deviceAlias\": {\"$.deviceAlias\": \"4F00C8E2\"},\"getZetaDataString($.this)\":{\"$.this\":\"getZetaDataString\"}}','{deviceId:apiUid}',14,'2738969',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceId]-doorStatus','ドアセンサー-givtech','ドアセンサー-givtech',1,'回');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (110,'kiol故障','','DELTA03','kiol','[{\"id\":\"BA0029\",\"type\":\"Boolean\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":false}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"$.id\":{\"$.id\":\"\"},\"getKingIODataString($.this)\":{\"$.this\":\"getDeltaDataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,1,'2024-09-12 16:11:30',2,NULL,0,'[deviceSn]_delta_failure','kiol故障','kiol故障',5,'ON-1/OFF-0');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (111,'kiol計測','',NULL,'kiol','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_measurement','kiol計測','kiol計測',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (112,'kiol積算',NULL,NULL,'kiol','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_accrual','kiol積算','kiol積算',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (113,'kiol状態',NULL,NULL,'kiol','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getKingIODataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_status','kiol状态','kiol Status',7,NULL);
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (120,'st150故障','','st150-01','st150','[{\"id\":\"BA0029\",\"type\":\"Boolean\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":false}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"$.id\":{\"$.id\":\"\"},\"getSt150DataString($.this)\":{\"$.this\":\"getDeltaDataString\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,1,'2024-09-12 16:11:30',2,NULL,0,'[deviceSn]_delta_failure','st150故障','st150故障',5,'ON-1/OFF-0');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (121,'st150計測','','st150-02','st150','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getSt150DataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_measurement','st150計測','st150計測',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (122,'st150積算',NULL,'st150-03','st150','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getSt150DataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,'1111111',NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_accrual','st150積算','st150積算',5,' ');
INSERT INTO `type` (`id`,`name`,`description`,`device_type`,`device_data_src`,`origin_json_format`,`expression_map`,`expression_variable_map`,`target_json_format`,`target_forward_id`,`target_foward_code`,`created_by`,`created_timestamp`,`updated_by`,`updated_timestamp`,`company_id`,`space_id`,`flag`,`dbm_id`,`name_zh`,`name_en`,`device_category_id`,`unit`) VALUES (123,'st150状態',NULL,'st150-04','st150','[{\"id\":\"BA0029\",\"type\":\"Analog\",\"reportedAt\":\"2022-12-11T13:50:00+09:00\",\"value\":67}]','{\"$.deviceId\":\"$.id\",\"$.this\":\"getKingIODataString($.this)\"}','{\"getSt150DataString($.this)\":{\"$.this\":\"$.this\"}}','{\"deviceId\":\"$.Objs[0].N\"}',1,NULL,NULL,NULL,NULL,NULL,2,NULL,0,'[deviceSn]_delta_status','st150状態','st150状態',7,NULL);


update `type` set company_id = newCompanyId;

/*Table structure for table `user_building_relation` */

DROP TABLE IF EXISTS `user_building_relation`;

CREATE TABLE `user_building_relation` (
  `user_id` bigint NOT NULL,
  `building_id` bigint NOT NULL,
  `create_time` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='用户楼宇关系表';

/*Table structure for table `user_operation_logs` */

DROP TABLE IF EXISTS `user_operation_logs`;

CREATE TABLE `user_operation_logs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint NOT NULL,
  `company_id` bigint DEFAULT NULL,
  `operation` varchar(255) NOT NULL,
  `description_jp` text,
  `detail_log` mediumtext,
  `result` varchar(50) NOT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` bigint NOT NULL,
  `description_cn` text,
  `description_en` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `version_info` */

DROP TABLE IF EXISTS `version_info`;

CREATE TABLE `version_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `version_num` varchar(255) DEFAULT NULL COMMENT '版本号',
  `content` text COMMENT '内容',
  `date` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

/*Table structure for table `worker_node` */

DROP TABLE IF EXISTS `worker_node`;

CREATE TABLE `worker_node` (
  `ID` bigint NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
  `HOST_NAME` varchar(64) NOT NULL COMMENT 'host name',
  `PORT` varchar(64) NOT NULL COMMENT 'port',
  `TYPE` int NOT NULL COMMENT 'node type: ACTUAL or CONTAINER',
  `LAUNCH_DATE` date NOT NULL COMMENT 'launch date',
  `MODIFIED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modified time',
  `CREATED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='DB WorkerID Assigner for UID Generator';

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
