搬移部分每小時更新電站資訊至 winform

This commit is contained in:
cesar liu 2022-07-18 09:30:08 +08:00
parent 090c5770aa
commit ff7f6e368c

View File

@ -2126,7 +2126,7 @@ namespace SolarPower.Repository.Implement
{
var sql = $"SELECT * FROM {db_name}.{table_name} WHERE {where}";
result = await conn.QueryFirstOrDefaultAsync<A>(sql);
result = await conn.QueryFirstOrDefaultAsync<A>(sql, commandTimeout: 600);
}
catch (Exception exception)
{
@ -6147,10 +6147,10 @@ namespace SolarPower.Repository.Implement
{
var sql = $@"SELECT * FROM
(SELECT a.SITEID AS Avg FROM {dbname}.s{code}01_sensoravg a ORDER BY a.ID DESC LIMIT 1) a,
(SELECT 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 a.SITEID AS Station FROM {dbname}.s{code}01_station a ORDER BY a.ID DESC LIMIT 1) c,
(SELECT a.SITEID AS Sensor FROM {dbname}.s{code}01_sensor a ORDER BY a.ID DESC LIMIT 1) d
(SELECT count(*) ctAvg, a.SITEID AS Avg FROM {dbname}.s{code}01_sensoravg a ORDER BY a.ID DESC LIMIT 1) a,
(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,
(SELECT count(*) ctSensor, a.SITEID AS Sensor FROM {dbname}.s{code}01_sensor a ORDER BY a.ID DESC LIMIT 1) d
";
resule = await conn.QueryFirstOrDefaultAsync<Check4table>(sql);