From c50f3b50c743e264d7cff0e7b9987bc0676b3bd2 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Thu, 18 Aug 2022 19:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=BB=E7=AB=99=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=BB=B6=E9=95=B7sql=E5=9F=B7=E8=A1=8C=E7=9A=84=E6=99=82?= =?UTF-8?q?=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repository/Implement/PowerStationRepository.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 5d1a34b..6ce7be3 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -6090,7 +6090,7 @@ namespace SolarPower.Repository.Implement case when ISNULL(a.Name) = 0 then Null else '電站名稱為空' end error_reason from power_station a where a.`Code` = '{code}' ;"; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // # 檢查電站缺少的欄位(編號)# sql = $@"insert power_station_enable_check(siteID, check_type, check_item, isError, check_Date, error_reason) @@ -6116,7 +6116,7 @@ namespace SolarPower.Repository.Implement case when ISNULL(a.Coordinate) = 0 then Null else '電站座標為空' end error_reason from power_station a where a.`Code` = '{code}' ;"; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // #檢查電站歸屬公司狀態(刪除)# sql = $@"insert power_station_enable_check(siteID, check_type, check_item, isError, check_Date, error_reason) @@ -6148,7 +6148,7 @@ namespace SolarPower.Repository.Implement from power_station a join company b on a.CompanyId = b.Id where a.`Code` = '{code}' ;"; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // #檢查電站歸屬公司狀態(存在)# sql = $@"insert power_station_enable_check(siteID, check_type, check_item, isError, check_Date, error_reason) @@ -6169,7 +6169,7 @@ namespace SolarPower.Repository.Implement from power_station_operation_personnel b join power_station a on a.Id = b.PowerStationId where b.Deleted = 0 and a.`Code` = '{code}' ;"; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // #檢查設備DBName是否填寫# sql = $@" insert power_station_enable_check(siteID, check_type, check_item, isError, check_Date, error_reason) @@ -6190,7 +6190,7 @@ namespace SolarPower.Repository.Implement from {DBname}.device b join power_station a on a.Id = b.PowerStationId where b.Deleted = 0 and b.Enabled = 1 and b.Status = 1 and b.TableName Is Null and a.`Code` = '{code}' "; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // #檢查設備ColName是否填寫# sql = $@" insert power_station_enable_check(siteID, check_type, check_item, isError, check_Date, error_reason) @@ -6222,7 +6222,7 @@ namespace SolarPower.Repository.Implement join {DBname}.controller b on a.id = b.PowerStationId join {DBname}.inverter c on b.id = c.ControllerId where a.`Code` = '{code}' and c.Deleted = 0 and c.Enabled = 1 and c.Status > 0 ;"; - await conn.ExecuteAsync(sql); + await conn.ExecuteAsync(sql, commandTimeout: 600); // # 回傳結果 sql = $@" select error_reason from power_station_enable_check @@ -6352,7 +6352,7 @@ namespace SolarPower.Repository.Implement (SELECT count(*) ctInv_site, a.SITEID AS Inv_site,a.INVERTERID as Inv_inveter FROM {dbname}.s{code}01_inv a ORDER BY a.ID DESC LIMIT 1) b, (SELECT count(*) ctStation, a.SITEID AS Station FROM {dbname}.s{code}01_station a ORDER BY a.ID DESC LIMIT 1) c "; - resule = await conn.QueryFirstOrDefaultAsync(sql); + resule = await conn.QueryFirstOrDefaultAsync(sql, commandTimeout: 600); } catch (Exception exception)