From 0c2f647ff5c441be1e33e5a5c108badd05886e01 Mon Sep 17 00:00:00 2001 From: cesar liu Date: Fri, 21 Oct 2022 18:27:09 +0800 Subject: [PATCH] =?UTF-8?q?for=20=E5=A9=89=E4=BC=B6=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Quartz/Jobs/CalcInverter15minJob.cs | 3 ++- .../Implement/PowerStationRepository.cs | 19 +++++++++++++++++++ .../Interface/IPowerStationRepository.cs | 6 ++++++ 3 files changed, 27 insertions(+), 1 deletion(-) 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();// + /// /// 取得當前使用者可操作的電站 ///