1. 背景執行 逆便器檢測 抓取所有電站

This commit is contained in:
Kai 2022-01-12 16:27:09 +08:00
parent 355ad96330
commit f5be10dc0c
3 changed files with 23 additions and 0 deletions

View File

@ -134,6 +134,8 @@ namespace SolarPower.Quartz.Jobs
try
{
powerStations = await powerStationRepository.GetAllNoStatusAsync();
logger.LogInformation("【CalcInverter15minJob】開始檢測逆變器狀態");
var ps_groupby_SitDB = powerStations.GroupBy(x => x.SiteDB).ToList();

View File

@ -416,6 +416,25 @@ namespace SolarPower.Repository.Implement
}
}
public async Task<List<PowerStation>> GetAllNoStatusAsync()
{
List<PowerStation> result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0";
result = (await conn.QueryAsync<PowerStation>(sql)).ToList();
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 透過電站編號,取得單一電站資訊(覆寫)
/// </summary>

View File

@ -612,5 +612,7 @@ namespace SolarPower.Repository.Interface
Task<int> CheckSensorAvgTableColumn(string dbname, string code);
Task AlertColInvTableColumn(string dbname, string code);
Task AlertColSensoravgTableColumn(string dbname, string code);
Task<List<PowerStation>> GetAllNoStatusAsync();
}
}