-- 先创建一个表结构，避免程序启动时找不到数据库表导致报错或者启动失败
CREATE TABLE "LOWCODE_MASTER"."LC_POWER_ENV_DEVICE"
(
    "ID" number(38,0) NOT NULL,
    "DEVICE_UID" varchar2(128),
    "DEVICE_CODE" varchar2(128),
    "DEVICE_TYPE_CODE" varchar2(128),
    "DEVICE_TYPE_NAME" varchar2(128),
    "BUILDING_ID" varchar2(128),
    "BUILDING_NAME" varchar2(128),
    "CAMPUS_ID" varchar2(128),
    "CAMPUS_NAME" varchar2(128),
    "MONITOR_DATA" TEXT,
    "TENANT_ID" number(38,0),
    "CREATE_USER" number(38,0),
    "CREATE_TIME" timestamp(6),
    "CREATE_DEPT" number(38,0),
    "UPDATE_USER" number(38,0),
    "UPDATE_TIME" timestamp(6),
    "IS_DELETED" number(2,0) DEFAULT '0',
    NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE LOWCODE_MASTER.LC_POWER_ENV_DEVICE IS '动环设备信息表';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."BUILDING_ID" IS '楼宇编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."BUILDING_NAME" IS '楼宇名称';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."CAMPUS_ID" IS '园区编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."CAMPUS_NAME" IS '园区名称';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."CREATE_DEPT" IS '创建部门id';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."CREATE_USER" IS '创建人';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."DEVICE_CODE" IS '设备编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."DEVICE_TYPE_CODE" IS '设备类型编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."DEVICE_TYPE_NAME" IS '设备类型名称';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."DEVICE_UID" IS '动环编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."ID" IS '主键';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."IS_DELETED" IS '是否删除';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."MONITOR_DATA" IS '最新监控数据';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."TENANT_ID" IS '租户编号';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN LOWCODE_MASTER.LC_POWER_ENV_DEVICE."UPDATE_USER" IS '更新人';

-- 设备类型字典信息
delete from "LOWCODE_MASTER"."SYSTEM_DICT_TYPE" where "TYPE" = 'power_env_device_type';
insert into "LOWCODE_MASTER"."SYSTEM_DICT_TYPE"("NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED", "DELETED_TIME") values( '动环系统设备类型', 'power_env_device_type', 0, '', '1', '2025-12-03 11:51:41', '1', '2025-12-03 11:51:41', 0, '1970-01-01 00:00:00');
delete from "LOWCODE_MASTER"."SYSTEM_DICT_DATA" where "DICT_TYPE" = 'power_env_device_type';
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(0, 'UPS', '0', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:52:34', '1', '2025-12-03 11:52:34', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(1, '精密空调', '1', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:52:54', '1', '2025-12-03 11:52:54', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(2, '温湿度检测', '2', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:53:07', '1', '2025-12-03 11:53:07', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(3, '氢气检测', '3', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:53:19', '1', '2025-12-03 11:53:19', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(4, '粉尘检测', '4', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:53:36', '1', '2025-12-03 11:53:36', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(5, '漏水报警', '5', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:53:50', '1', '2025-12-03 11:53:50', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(6, '加湿器', '6', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:54:00', '1', '2025-12-03 11:54:00', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(7, '加湿除湿一体', '7', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:54:11', '1', '2025-12-03 11:54:11', 0);
insert into "LOWCODE_MASTER"."SYSTEM_DICT_DATA"("SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") values(8, '电量仪', '8', 'power_env_device_type', 0, '', '', '', '1', '2025-12-03 11:54:22', '1', '2025-12-03 11:54:22', 0);



