電站管理: 延長sql執行的時間
This commit is contained in:
parent
3d518658c3
commit
c50f3b50c7
@ -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<Check4table>(sql);
|
||||
resule = await conn.QueryFirstOrDefaultAsync<Check4table>(sql, commandTimeout: 600);
|
||||
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user