/*
Navicat MySQL Data Transfer

Source Server         : 197.68.24.40
Source Server Version : 50739
Source Host           : 197.68.24.40:3306
Source Database       : cctp_mobile_business

Target Server Type    : MYSQL
Target Server Version : 50739
File Encoding         : 65001

Date: 2023-12-22 10:06:12
*/
DROP DATABASE IF EXISTS `cctp_mobile_business`;
CREATE DATABASE `cctp_mobile_business` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS=0;
USE `cctp_mobile_business`;
-- ----------------------------
-- Table structure for `app`
-- ----------------------------
DROP TABLE IF EXISTS `app`;
CREATE TABLE `app` (
  `ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'ID',
  `APP_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '应用名称',
  `APP_SIZE` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '应用大小',
  `PACKAGE_NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '包名称',
  `BUILD_VERSION` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '构建版本',
  `PLATFORM` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台类型',
  `APP_URL` varchar(4096) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '脚本文件地址',
  `VERSION_MARK` varchar(1028) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '版本说明',
  `OWNER_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '设备归属对象ID',
  `TENANT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '租户ID',
  `APP_ICON` blob COMMENT 'app图标',
  `REMARKS` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '备注',
  `VERSION_CODE` int(8) DEFAULT NULL COMMENT '版本号',
  `ACTIVITY` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'activity',
  `CREATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '上传人',
  `CREATED_TIME` datetime DEFAULT NULL COMMENT '上传时间',
  `UPDATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '更新人',
  `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='应用表';

-- ----------------------------
-- Records of app
-- ----------------------------

-- ----------------------------
-- Table structure for `device_online_record`
-- ----------------------------
DROP TABLE IF EXISTS `device_online_record`;
CREATE TABLE `device_online_record` (
  `id` varchar(32) NOT NULL COMMENT '主键',
  `report_id` varchar(32) NOT NULL COMMENT '报告id，对应的',
  `type` char(1) NOT NULL COMMENT '类型，0上线，1下线',
  `device_id` varchar(128) NOT NULL COMMENT '设备号',
  `date` datetime NOT NULL COMMENT '上线时间，下线时间',
  `order_num` int(11) NOT NULL DEFAULT '0' COMMENT '上线下线的排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='此表记录设备使用中掉线上线记录';

-- ----------------------------
-- Records of device_online_record
-- ----------------------------

-- ----------------------------
-- Table structure for `device_owner`
-- ----------------------------
DROP TABLE IF EXISTS `device_owner`;
CREATE TABLE `device_owner` (
  `ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'ID',
  `RELATED_TYPE` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '关联类型',
  `RELATED_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '关联ID',
  `OWNER_NAME` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '归属对象名称',
  `CREATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
  `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '更新人',
  `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
  `TENANT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '租户ID',
  `related_path` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '关联对象路径',
  `is_deleted` tinyint(4) DEFAULT NULL COMMENT '逻辑删除',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备归属对象表';

-- ----------------------------
-- Records of device_owner
-- ----------------------------

-- ----------------------------
-- Table structure for `device_owner_time`
-- ----------------------------
DROP TABLE IF EXISTS `device_owner_time`;
CREATE TABLE `device_owner_time` (
  `ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'ID',
  `DEVICE_ID` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '设备ID',
  `OWNER_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '归属ID',
  `STATE_DATE` date DEFAULT NULL COMMENT '开始日期',
  `SCHEDULE_END_DATE` datetime DEFAULT NULL COMMENT '计划到期日期',
  `RECYCLE_DATE` date DEFAULT NULL COMMENT '实际回收日期',
  `RECYCLE_TYPE` char(1) DEFAULT NULL COMMENT '回收方式',
  `STATUS` char(1) DEFAULT NULL COMMENT '状态',
  `CREATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '创建人',
  `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '更新人',
  `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
  `TENANT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '租户ID',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备分配归属对象级时间表';

-- ----------------------------
-- Records of device_owner_time
-- ----------------------------

-- ----------------------------
-- Table structure for `device_use_report`
-- ----------------------------
DROP TABLE IF EXISTS `device_use_report`;
CREATE TABLE `device_use_report` (
  `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '使用记录ID',
  `TYPE` char(1) NOT NULL COMMENT '使用类型',
  `DEVICE_IDS` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '使用设备',
  `USED_BY` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '使用人',
  `PLATFORM` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '平台类型',
  `OWNER_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '设备归属对象ID',
  `VIDEO_URL` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '录屏文件地址',
  `START_TIME` datetime DEFAULT NULL COMMENT '开始时间',
  `END_TIME` datetime DEFAULT NULL COMMENT '结束时间',
  `TENANT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '租户ID',
  `RECORD_NAME` varchar(64) DEFAULT '' COMMENT '任务名称',
  `VIDEO_REF` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备使用报告表';

-- ----------------------------
-- Records of device_use_report
-- ----------------------------

-- ----------------------------
-- Table structure for `device_use_report_detail`
-- ----------------------------
DROP TABLE IF EXISTS `device_use_report_detail`;
CREATE TABLE `device_use_report_detail` (
  `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '操作ID',
  `RECORD_ID` bigint(20) NOT NULL DEFAULT '0' COMMENT '使用记录ID',
  `OWNER_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '归属对象ID',
  `OPER_TYPE` char(1) NOT NULL COMMENT '操作类型',
  `DEVICE_ID` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '操作设备',
  `OPER_TIME` datetime DEFAULT NULL COMMENT '操作时间',
  `OPER_CONTENT` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '操作内容',
  `OPER_RET` char(1) DEFAULT '1' COMMENT '操作结果',
  `TENANT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '租户ID',
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `record_index` (`RECORD_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备报告详情表';

-- ----------------------------
-- Records of device_use_report_detail
-- ----------------------------
