From 9202857ee48a0d1101919fbed30d59b65d29bba5 Mon Sep 17 00:00:00 2001 From: GiteaAdmin Date: Wed, 1 Feb 2023 00:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E4=BD=8D=E7=AE=A1=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/OverviewRepository.cs | 6 +-- .../StationOverviewInfo.cshtml | 4 +- solarApp/Service/archiveLowData.cs | 43 +++++++++++++------ solarApp/Service/getStationSvc.cs | 2 +- solarApp/Service/procSensorSvc.cs | 15 ++++--- solarApp/Service/procSyncError.cs | 2 +- solarApp/fmArchive.cs | 1 + solarApp/solarApp.csproj | 1 - 8 files changed, 46 insertions(+), 28 deletions(-) diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index 876ed87..da9db0c 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -237,7 +237,7 @@ namespace SolarPower.Repository.Implement { var startDay = Convert.ToDateTime(nowDay).AddDays(-7).ToString("yyyy-MM-dd"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.IrrDayHour AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_day ps LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d') WHERE ps.PowerStationId = @PowerStationId @@ -262,7 +262,7 @@ namespace SolarPower.Repository.Implement { var startDay = Convert.ToDateTime(nowDay).ToString("yyyy-MM-01"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.IrrDayHour AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_day ps LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d') WHERE ps.PowerStationId = @PowerStationId @@ -288,7 +288,7 @@ namespace SolarPower.Repository.Implement { var startyear = Convert.ToDateTime(nowDay).ToString("yyyy"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.IrrDay AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_month ps LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(pyr.timestamp, '%Y-%m') WHERE ps.PowerStationId = @PowerStationId diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 62c1bb2..af188e6 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -31,7 +31,7 @@

-

27°C
降雨幾率: 0%

+

27°C
降雨機率: 0%