ALTER TABLE mortals_xhx_device ADD COLUMN `skinId` bigint (20)     COMMENT '皮肤id' AFTER productName;
ALTER TABLE mortals_xhx_device ADD COLUMN `skinName` varchar (512)     COMMENT '皮肤名称' AFTER skinId;
ALTER TABLE mortals_xhx_device ADD COLUMN `homeUrl` varchar (512)     COMMENT '首页地址' AFTER skinName;

ALTER TABLE mortals_xhx_device ADD COLUMN `deviceSN` varchar (512)     COMMENT '设备SN码' AFTER deviceCode;


ALTER TABLE mortals_xhx_product ADD COLUMN `skinId` bigint (20)     COMMENT '皮肤id' AFTER productCode;
ALTER TABLE mortals_xhx_product ADD COLUMN `skinName` varchar (512)     COMMENT '皮肤名称' AFTER skinId;
ALTER TABLE mortals_xhx_product ADD COLUMN `eventUrl` varchar (512)     COMMENT '事件地址' AFTER homeUrl;



-- ----------------------------
2022-08-20
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64)     COMMENT '设备版本' AFTER deleted;

-- ----------------------------
2023-02-2
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `productCode` varchar (64)  default ''   COMMENT '产品编码' AFTER productId;


-- ----------------------------
2023-04-26
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN  `hallId` bigint(20)      COMMENT '大厅Id' AFTER skinName;
ALTER TABLE mortals_xhx_device ADD COLUMN  `hallName` varchar(256)  default ''   COMMENT '大厅名称' AFTER hallId;

ALTER TABLE mortals_xhx_device_alarm_info ADD COLUMN  `deviceCode` varchar(256)   default ''   COMMENT '设备编码' AFTER alarmDevice;
ALTER TABLE mortals_xhx_device_alarm_info ADD COLUMN  `deviceName` varchar(256)   default ''   COMMENT '设备名称' AFTER deviceCode;


-- ----------------------------
2023-05-11
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN  `showSms` tinyint(2)    DEFAULT '1'  COMMENT '是否显示短信(0.否，1.是)' AFTER hallName;
ALTER TABLE mortals_xhx_device ADD COLUMN  `showPrint` tinyint(2)    DEFAULT '1'  COMMENT '是否显示打印机(0.否，1.是)' AFTER showSms;
ALTER TABLE mortals_xhx_device ADD COLUMN  `showWechatQrCode` tinyint(2)    DEFAULT '1'  COMMENT '是否显示小程序二维码(0.否，1.是)' AFTER showPrint;



ALTER TABLE mortals_xhx_device ADD COLUMN  `orgName` varchar(128)      COMMENT '所属机构' AFTER showWechatQrCode;


ALTER TABLE mortals_xhx_device_alarm_info
ADD COLUMN  `push` tinyint(2)    DEFAULT '0'  COMMENT '是否推送',
ADD COLUMN   `productId` bigint(20)   DEFAULT '0'   COMMENT '产品Id',
ADD COLUMN  `productCode` varchar(256)   DEFAULT ''   COMMENT '产品编码',
ADD COLUMN  `productName` varchar(256)  DEFAULT ''    COMMENT '产品名称'


-- ----------------------------
2023-08-17
-- ----------------------------

ALTER TABLE mortals_xhx_device_module_distribute ADD COLUMN   `siteId` bigint(20)  default '1'   COMMENT '站点Id，来源基础服务平台';
ALTER TABLE mortals_xhx_device_module_distribute ADD COLUMN   `siteCode` varchar(256)  default ''    COMMENT '站点编号，来源基础服务平台';
ALTER TABLE mortals_xhx_device_module_distribute ADD COLUMN   `siteName` varchar(256)  default ''    COMMENT '站点名称';

ALTER TABLE mortals_xhx_product_version ADD COLUMN   `siteId` bigint(20) default '1'      COMMENT '站点Id，来源基础服务平台';
ALTER TABLE mortals_xhx_product_version ADD COLUMN   `siteCode` varchar(256)  default ''    COMMENT '站点编号，来源基础服务平台';
ALTER TABLE mortals_xhx_product_version ADD COLUMN   `siteName` varchar(256)  default ''    COMMENT '站点名称';

-- ----------------------------
2023-08-21
-- ----------------------------
ALTER TABLE mortals_xhx_device_module_distribute ADD COLUMN  `selected` tinyint(2) NOT NULL default '0'     COMMENT '是否默认选择分辨率(0.否，1.是)';




ALTER TABLE mortals_xhx_role_auth ADD COLUMN  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间';
ALTER TABLE mortals_xhx_role_user ADD COLUMN  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间';
ALTER TABLE mortals_xhx_idgenerator ADD COLUMN  `createTime` datetime(0) NULL DEFAULT NULL COMMENT '创建时间';


-- ----------------------------
2024-02-28
-- ----------------------------

ALTER TABLE mortals_xhx_device ADD COLUMN   `resolution` varchar(64)   DEFAULT ''  COMMENT '设备分辨率'   AFTER deviceInFloor;
ALTER TABLE mortals_xhx_device ADD COLUMN   `resolutionValue` varchar(64)   DEFAULT ''  COMMENT '设备分辨率'   AFTER resolution;

UPDATE mortals_xhx_device_module_distribute SET imageResolution =imageResolutionValue


-- ----------------------------
    2024-03-26
-- ----------------------------
-- ----------------------------
-- 设备消息统计表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_device_message_stat`;
CREATE TABLE mortals_xhx_device_message_stat(
    `id` bigint(20)   AUTO_INCREMENT   COMMENT 'ID',
    `siteId` bigint(20)      COMMENT '站点Id，来源基础服务平台',
    `productId` bigint(20)      COMMENT '产品Id',
    `productCode` varchar(256)      COMMENT '产品编码',
    `productName` varchar(256)      COMMENT '产品名称',
    `alarmTotalCount` int(9) NOT NULL   DEFAULT '0'  COMMENT '今日告警数量',
    `pushTotalCount` int(9) NOT NULL   DEFAULT '0'  COMMENT '今日消息推送数量',
    `uploadMessageTotalCount` int(9) NOT NULL   DEFAULT '0'  COMMENT '今日上行消息数量',
    `downloadMessageTotalCount` int(9) NOT NULL   DEFAULT '0'  COMMENT '今日下行消息数量',
    `year` int(9) NOT NULL     COMMENT '年',
    `month` int(9) NOT NULL     COMMENT '月',
    `day` int(9) NOT NULL     COMMENT '日',
    `createTime` datetime NOT NULL     COMMENT '创建时间',
    `updateUserId` bigint(20)      COMMENT '更新用户',
    `updateTime` datetime      COMMENT '更新时间',
PRIMARY KEY  (`id`)
,KEY `siteId` (`siteId`) USING BTREE
,KEY `productId` (`productId`) USING BTREE
,KEY `productCode` (`productCode`) USING BTREE
,KEY `productName` (`productName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备消息统计';


