DROP TABLE IF EXISTS `passenger_equipment`;
DROP TABLE IF EXISTS `passenger_equipment_people`;
DROP TABLE IF EXISTS `equipment_passenger`;
CREATE TABLE `equipment_passenger`
(
    `id`                 BIGINT(20) NOT NULL COMMENT 'ID',
    `place_base_info_id` BIGINT(20) NULL DEFAULT NULL COMMENT '点位ID',
    `brief`              VARCHAR(500) NULL DEFAULT NULL COMMENT '说明',
    `litpics`            VARCHAR(500) NULL DEFAULT NULL COMMENT '图片',
    `lng`                DECIMAL(20, 12) NOT NULL DEFAULT '0.000000000000' COMMENT '经度（坐标）',
    `lat`                DECIMAL(20, 12) NOT NULL DEFAULT '0.000000000000' COMMENT '纬度（坐标）',
    `created_time`       DATETIME NULL DEFAULT NULL COMMENT '创建时间',
    `created_by`         BIGINT(20) NULL DEFAULT NULL COMMENT '创建人',
    `updated_time`       DATETIME NULL DEFAULT NULL COMMENT '修改时间',
    `updated_by`         BIGINT(20) NULL DEFAULT NULL COMMENT '修改人',
    PRIMARY KEY (`id`)
) COMMENT ='人流设备点位分布信息' ENGINE = InnoDB;

DROP TABLE IF EXISTS `equipment_passenger_people`;
CREATE TABLE `equipment_passenger_people`
(
    `id`                 BIGINT(20) NOT NULL COMMENT 'ID',
    `place_base_info_id` BIGINT(20) NULL DEFAULT NULL COMMENT '点位ID',
    `equipment_id`       BIGINT(20) NULL DEFAULT NULL COMMENT '设备ID',
    `face_id`            VARCHAR(32) NULL DEFAULT NULL COMMENT '面容ID',
    `passenger_type`     INT(1) NULL DEFAULT NULL COMMENT '进出类型',
    `created_time`       DATETIME NULL DEFAULT NULL COMMENT '创建时间',
    `gender`             INT(1) NULL DEFAULT NULL COMMENT '性别',
    `from_source`        VARCHAR(32) NULL DEFAULT NULL COMMENT '来源地区',
    PRIMARY KEY (`id`)
) COMMENT ='人流监测详细数据信息' ENGINE = InnoDB;


REPLACE
INTO `authority_info` (`id`, `parent_id`, `name`, `remark`)
VALUES (1700, 0, 'equipment.passenger', '客户监控设备管理'),
       (1701, 1700, 'equipment.passenger.find', '查询'),
       (1702, 1700, 'equipment.passenger.add', '添加'),
       (1703, 1700, 'equipment.passenger.edit', '修改'),
       (1704, 1700, 'equipment.passenger.delete', '删除');
