diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index a7b9d08..8254c88 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -1257,27 +1257,18 @@ namespace Backend.Controllers private async Task ResetDeviceGroup() { //先刪除整個device_group - var delete_group_sql = @"IF EXISTS(SELECT* FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[device_group]') AND type in (N'U')) - BEGIN - DROP TABLE[dbo].[device_group] - END - - CREATE TABLE [dbo].[device_group]( - [id] [int] IDENTITY(1,1) NOT NULL, - [device_disaster] [varchar](50) NULL, - [device_building_guid] [varchar](36) NULL, - [device_floor_guid] [varchar](36) NULL, - [device_system_category_layer2] [varchar](50) NULL, - [device_system_category_layer3] [varchar](50) NULL, - [device_amount] [int] NOT NULL, - CONSTRAINT [PK_device_group] PRIMARY KEY CLUSTERED - ( - [id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] - ) - - ALTER TABLE [dbo].[device_group] ADD CONSTRAINT [DF_device_group_device_amount] DEFAULT ((0)) FOR [device_amount] - "; + var delete_group_sql = @"DROP TABLE IF EXISTS `device_group` ; + CREATE TABLE `device_group` ( + `id` int(11) NOT NULL, + `device_disaster` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '災類', + `device_building_guid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '設備東別guid', + `device_floor_guid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '設備樓層guid', + `device_area_tag` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '設備區域', + `device_system_category_layer2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '系統大類device_system_tag', + `device_system_category_layer3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '系統小類device_name_tag', + `device_amount` int(11) NOT NULL DEFAULT '0' COMMENT '設備總計', + PRIMARY KEY (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='設備類別 - UI 過濾用';"; await backendRepository.ExecuteSql(delete_group_sql); //更新整個device_group diff --git a/Backend/Views/BuildMenu/Index.cshtml b/Backend/Views/BuildMenu/Index.cshtml index 3fabb76..9aee64f 100644 --- a/Backend/Views/BuildMenu/Index.cshtml +++ b/Backend/Views/BuildMenu/Index.cshtml @@ -131,103 +131,246 @@ -