added is_virtual to tbl_points in database
parent
cefeef57db
commit
e45de9c394
|
@ -867,9 +867,10 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_points` (
|
||||||
`object_type` VARCHAR(32) NOT NULL,
|
`object_type` VARCHAR(32) NOT NULL,
|
||||||
`units` VARCHAR(32) NOT NULL,
|
`units` VARCHAR(32) NOT NULL,
|
||||||
`high_limit` DECIMAL(18, 3) NOT NULL,
|
`high_limit` DECIMAL(18, 3) NOT NULL,
|
||||||
`low_limit` DECIMAL(18, 3) DEFAULT 1.000 NOT NULL ,
|
`low_limit` DECIMAL(18, 3) NOT NULL ,
|
||||||
`ratio` DECIMAL(18, 3) DEFAULT 1.000 NOT NULL,
|
`ratio` DECIMAL(18, 3) DEFAULT 1.000 NOT NULL,
|
||||||
`is_trend` BOOL NOT NULL,
|
`is_trend` BOOL NOT NULL,
|
||||||
|
`is_virtual` BOOL DEFAULT FALSE NOT NULL,
|
||||||
`address` JSON NOT NULL,
|
`address` JSON NOT NULL,
|
||||||
`description` VARCHAR(255),
|
`description` VARCHAR(255),
|
||||||
PRIMARY KEY (`id`));
|
PRIMARY KEY (`id`));
|
||||||
|
@ -888,35 +889,35 @@ CREATE INDEX `tbl_points_index_3` ON `myems_system_db`.`tbl_points` (`id`, `o
|
||||||
-- USE `myems_system_db`;
|
-- USE `myems_system_db`;
|
||||||
|
|
||||||
-- INSERT INTO `myems_system_db`.`tbl_points`
|
-- INSERT INTO `myems_system_db`.`tbl_points`
|
||||||
-- (`id`, `name`, `data_source_id`, `object_type`, `units`, `low_limit`, `high_limit`, `ratio`, `is_trend`, `address`, `description` )
|
-- (`id`, `name`, `data_source_id`, `object_type`, `units`, `high_limit`, `low_limit`, `ratio`, `is_trend`, `address`, `description` )
|
||||||
-- VALUES
|
-- VALUES
|
||||||
-- (1, 'Active Energy Import Tariff 1', 1, 'ENERGY_VALUE', 'kWh', 0, 99999999999, 1.000, true,
|
-- (1, 'Active Energy Import Tariff 1', 1, 'ENERGY_VALUE', 'kWh', 99999999999, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":801, \"number_of_registers\":4, \"format\":\"=d\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":801, \"number_of_registers\":4, \"format\":\"=d\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (2, 'Working hours counter', 1, 'ANALOG_VALUE', 'S', 0, 999999999, 1.000, true,
|
-- (2, 'Working hours counter', 1, 'ANALOG_VALUE', 'S', 999999999, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":209, \"number_of_registers\":2, \"format\":\"=L\", \"swap_adjacent_bytes\":true}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":209, \"number_of_registers\":2, \"format\":\"=L\", \"swap_adjacent_bytes\":true}', null),
|
||||||
|
|
||||||
-- (3, 'Current a', 1, 'ANALOG_VALUE', 'A', 0, 5, 1.000, true,
|
-- (3, 'Current a', 1, 'ANALOG_VALUE', 'A', 5, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":13, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":13, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (4, 'Active Power a', 1, 'ANALOG_VALUE', 'W', 0, 3450, 1.000, true,
|
-- (4, 'Active Power a', 1, 'ANALOG_VALUE', 'W', 3450, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":25, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":25, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (5, 'Power Factor a', 1, 'ANALOG_VALUE', 'W', 0, 1, 1.000, true,
|
-- (5, 'Power Factor a', 1, 'ANALOG_VALUE', 'W', 1, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":37, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":37, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (6, '示例ModbusTCP数据点6', 2, 'ENERGY_VALUE', 'Wh', 0, 99999999999, 1.000, true,
|
-- (6, '示例ModbusTCP数据点6', 2, 'ENERGY_VALUE', 'Wh', 99999999999, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":40001, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":40001, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (7, '示例数据点7', 2, 'ANALOG_VALUE', 'V', 0, 690, 1.000, true,
|
-- (7, '示例数据点7', 2, 'ANALOG_VALUE', 'V', 690, 0, 1.000, true,
|
||||||
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":40002, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
-- '{\"slave_id\":1, \"function_code\":3, \"offset\":40002, \"number_of_registers\":2, \"format\":\"=f\", \"swap_adjacent_bytes\":false}', null),
|
||||||
|
|
||||||
-- (8, 'BACnet示例数据点1', 3, 'ANALOG_VALUE', 'V', 0, 690, 1.000, true,
|
-- (8, 'BACnet示例数据点1', 3, 'ANALOG_VALUE', 'V', 690, 0, 1.000, true,
|
||||||
-- '{\"object_type\":\"analogValue\", \"object_id\":3004860, \"property_name\":\"presentValue\", \"property_array_index\":null}', null),
|
-- '{\"object_type\":\"analogValue\", \"object_id\":3004860, \"property_name\":\"presentValue\", \"property_array_index\":null}', null),
|
||||||
-- BACnet Object Type
|
-- BACnet Object Type
|
||||||
-- analogValue, analogInput, analogOutput, binaryValue, binaryInput, binaryOutput
|
-- analogValue, analogInput, analogOutput, binaryValue, binaryInput, binaryOutput
|
||||||
|
|
||||||
-- (9, 'S7示例数据点1', 4, 'ANALOG_VALUE', 'kWh', 0, 99999999999, 1.000, true,
|
-- (9, 'S7示例数据点1', 4, 'ANALOG_VALUE', 'kWh', 99999999999, 0, 1.000, true,
|
||||||
-- '{\"area\":\"DB\", \"db_number\":700, \"start\":8, \"size\":4', null);
|
-- '{\"area\":\"DB\", \"db_number\":700, \"start\":8, \"size\":4', null);
|
||||||
-- # S7 Area
|
-- # S7 Area
|
||||||
-- 'PE', 'PA', 'MK', 'DB', 'CT', 'TM'
|
-- 'PE', 'PA', 'MK', 'DB', 'CT', 'TM'
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- UPDATE POINT TABLE
|
||||||
|
ALTER TABLE myems_system_db.tbl_points MODIFY COLUMN low_limit decimal(18,3) NOT NULL;
|
||||||
|
ALTER TABLE myems_system_db.tbl_points ADD is_virtual BOOL DEFAULT FALSE NOT NULL;
|
||||||
|
ALTER TABLE myems_system_db.tbl_points CHANGE is_virtual is_virtual BOOL DEFAULT FALSE NOT NULL AFTER is_trend;
|
||||||
|
|
||||||
|
|
||||||
|
-- UPDATE VERSION NUMBER
|
||||||
|
UPDATE myems_system_db.tbl_versions SET version='1.1.3', release_date='2021-05-05' WHERE id=1;
|
Loading…
Reference in New Issue