From c480e9ef3d5e1a0597e56fcadca92fec09b8f3c4 Mon Sep 17 00:00:00 2001 From: dev02 Date: Mon, 17 Oct 2022 17:45:27 +0800 Subject: [PATCH 1/3] fix sql --- Backend/Controllers/BuildMenuController.cs | 2 +- Backend/Controllers/DeviceManageController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Backend/Controllers/BuildMenuController.cs b/Backend/Controllers/BuildMenuController.cs index ff1db9e..22bdc87 100644 --- a/Backend/Controllers/BuildMenuController.cs +++ b/Backend/Controllers/BuildMenuController.cs @@ -29,7 +29,7 @@ namespace Backend.Controllers try { - var sqlString = @$"select building_guid as Value, full_name as Name from building a where a.deleted = 0 and a.status = 0 ORDER BY A.priority ASC, A.created_at DESC"; + var sqlString = @$"select building_guid as Value, full_name as Name from building a where a.deleted = 0 and a.status = 0 ORDER BY a.priority ASC, a.created_at DESC"; KeyValue = await backendRepository.GetAllAsync(sqlString); apiResult.Code = "0000"; diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index 701cdbf..00c8da0 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -179,7 +179,7 @@ namespace Backend.Controllers dk.device_close_flashing, dk.device_error_flashing, (SELECT - STRING_AGG( ISNULL(system_key, ' '), ',') + GROUP_CONCAT( IFNULL(system_key, ' '), ',') FROM device_disaster dd JOIN variable v ON v.deleted = 0 AND v.system_type = 'disaster' AND v.system_value = dd.device_system_value WHERE dd.device_guid = d.device_guid From d4f0add911b4222ca480297e9f13c907ef8d24b2 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 18 Oct 2022 18:22:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E5=BE=8C=E5=8F=B0]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=8D=B2=E5=8F=96table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/DeviceManageController.cs | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index 00c8da0..4325c9a 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -805,7 +805,7 @@ namespace Backend.Controllers try { - var rawDatas = await backendRepository.GetAllAsync("device_import_ckeck_temp", "is_correct = 1 ORDER BY device_building_tag, device_system_tag, device_floor_tag, device_name_tag"); + var rawDatas = await backendRepository.GetAllAsync("import_niagara_tag", null, null, "device_building_tag, device_system_tag, device_floor_tag, device_name_tag"); var rawDatas_Group_Building_tag = rawDatas.GroupBy(x => x.Device_building_tag).ToList(); List tempFilters = new List(); @@ -871,37 +871,34 @@ namespace Backend.Controllers try { - string sql = @"SELECT - di.device_building_tag, - di.device_system_tag, - di.device_floor_tag, - di.device_name_tag, - di.device_serial_tag, - di.device_number, - di.device_system_category_layer3, - STRING_AGG( ISNULL(v.system_value, ' '), ',') AS Device_disasters, - STRING_AGG( ISNULL(v.system_key, ' '), ',') AS Device_disaster_type_text - FROM - (SELECT - * - FROM device_import_ckeck_temp di - WHERE device_building_tag = @Device_building_tag - AND device_system_tag = @Device_system_tag - AND device_floor_tag = @Device_floor_tag - AND device_name_tag = @Device_name_tag - AND is_correct = 1 - AND device_number NOT IN (SELECT d.device_number FROM device d WHERE d.deleted = 0) - ) di - CROSS APPLY STRING_SPLIT(di.device_disaster, ',') dd - LEFT JOIN variable v ON v.system_type = 'disaster' AND v.system_value = dd.value - GROUP BY di.device_building_tag, - di.device_system_tag, - di.device_floor_tag, - di.device_name_tag, - di.device_serial_tag, - di.device_number, - di.device_system_category_layer3"; - + string sql = @"SELECT + di.device_building_tag, + di.device_system_tag, + di.device_floor_tag, + di.device_last_name_tag as device_name_tag, + di.device_serial_tag, + 0 as device_disaster, + di.niagara_tags as device_number + FROM + ( + SELECT + * + FROM + import_niagara_tag intag + WHERE + device_building_tag = @Device_building_tag + AND device_system_tag = @Device_system_tag + AND device_floor_tag = @Device_floor_tag + AND device_name_tag = @Device_name_tag + AND convert(intag.niagara_tags, nchar) NOT IN ( SELECT convert(d.device_number, nchar) FROM device d WHERE d.deleted = 0 ) + ) di + GROUP BY + di.device_building_tag, + di.device_system_tag, + di.device_floor_tag, + di.device_last_name_tag, + di.device_serial_tag, + di.niagara_tags"; var deviceImports = await backendRepository.GetAllAsync(sql, post); From 240dc6ec25d032f98cf7d87a498768d02a26459b Mon Sep 17 00:00:00 2001 From: dev01 Date: Wed, 19 Oct 2022 09:41:03 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E5=8D=80=E5=9F=9F=E9=81=B8=E5=96=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86]=20=E5=B7=A6=E5=8F=B3=E9=82=8A=E9=A0=90?= =?UTF-8?q?=E8=A8=AD=E9=A0=81=E9=9D=A2=E7=A8=8B=E5=BA=8F=E5=BB=BA=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Views/BuildMenu/Index.cshtml | 407 ++++++++++++++++++--------- Backend/wwwroot/css/site.css | 9 + 2 files changed, 286 insertions(+), 130 deletions(-) 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 @@ -
- -
-
- - -
-
- - -
- -
-
-
-
- - -
-
-
- - -
-
- - @*
+ +
+ +
+ +
+ +
- -
- -
+ +
+ + +
+
+ + +
+
+
+
+
+ + +
+
+
+ + +
+
+ + +
+
+ + @*
+
+ + +
+
+ + +
*@ -
-