diff --git a/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs b/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs index f5b8840..573acbf 100644 --- a/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs +++ b/SolarPower/Quartz/Jobs/CalcInverter15minJob.cs @@ -55,7 +55,8 @@ namespace SolarPower.Quartz.Jobs #region step1. 找出所有電站 logger.LogInformation("【CalcInverter15minJob】【開始取得電站資料】"); - var powerStations = await powerStationRepository.GetAllAsync(); + //var powerStations = await powerStationRepository.GetAllAsync(); + var powerStations = await powerStationRepository.Get_station_4_debug(); logger.LogInformation("【CalcInverter15minJob】【取得成功電站資料】"); //logger.LogInformation("【CalcInverter15minJob】【電站資料】 - {0}", System.Text.Json.JsonSerializer.Serialize(powerStations)); #endregion diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 8a7a479..67527ef 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -425,6 +425,25 @@ namespace SolarPower.Repository.Implement } } + public async Task> Get_station_4_debug() + { + List result; + using (IDbConnection conn = this._databaseHelper.GetConnection()) + { + try + { + var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0 AND Status = 1 and `code` = '030010003'"; // + + result = (await conn.QueryAsync(sql)).ToList(); + } + catch (Exception exception) + { + throw exception; + } + return result; + } + } + public async Task> GetAllNoStatusAsync() { List result; diff --git a/SolarPower/Repository/Interface/IPowerStationRepository.cs b/SolarPower/Repository/Interface/IPowerStationRepository.cs index fbb84f7..0b17c95 100644 --- a/SolarPower/Repository/Interface/IPowerStationRepository.cs +++ b/SolarPower/Repository/Interface/IPowerStationRepository.cs @@ -18,6 +18,12 @@ namespace SolarPower.Repository.Interface /// List GetMyCities(MyUser myUser, byte showEnable); + /// + /// 獲取單一電站 - 臨時測試用 + /// + /// + Task> Get_station_4_debug();// + /// /// 取得當前使用者可操作的電站 ///