From 2deb6215d5791d05447b940275e00bf0142cae4f Mon Sep 17 00:00:00 2001 From: Kai Date: Mon, 27 Sep 2021 14:23:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=20=E5=94=AE?= =?UTF-8?q?=E9=9B=BB=E7=B4=80=E9=8C=84=20=E5=8F=8A=20=E7=99=BC=E9=9B=BB?= =?UTF-8?q?=E6=95=88=E8=83=BD=20=E5=B7=A6=E9=82=8A=E9=9B=BB=E7=AB=99?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Controllers/ElectricitySoldRecordController.cs | 2 +- SolarPower/Controllers/PowerGenerationController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SolarPower/Controllers/ElectricitySoldRecordController.cs b/SolarPower/Controllers/ElectricitySoldRecordController.cs index a1f9d7c..7d5b574 100644 --- a/SolarPower/Controllers/ElectricitySoldRecordController.cs +++ b/SolarPower/Controllers/ElectricitySoldRecordController.cs @@ -47,7 +47,7 @@ namespace SolarPower.Controllers } - var temp_solarType_where = $@" ps.SolarType = 0"; + var temp_solarType_where = $@" ps.SolarType != 2"; where.Add(temp_solarType_where); var powerStations = myPowerStationService.GetMyPowerStations(myUser, 1, null, where, where_entities); diff --git a/SolarPower/Controllers/PowerGenerationController.cs b/SolarPower/Controllers/PowerGenerationController.cs index 86c1cca..8afaaf4 100644 --- a/SolarPower/Controllers/PowerGenerationController.cs +++ b/SolarPower/Controllers/PowerGenerationController.cs @@ -47,7 +47,7 @@ namespace SolarPower.Controllers where_entities.Add("Filter", filter); } - var temp_solartype_where = @" ps.SolarType = 0"; + var temp_solartype_where = @" ps.SolarType != 2"; where.Add(temp_solartype_where); var powerStations = myPowerStationService.GetMyPowerStations(myUser, 1, null, where, where_entities); From c382980d66b217e465cf771548126a6e1f7ab569 Mon Sep 17 00:00:00 2001 From: Kai Date: Mon, 27 Sep 2021 14:58:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=20=E5=90=88=E4=BD=B5=E9=9B=BB=E7=AB=99bu?= =?UTF-8?q?g=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/AnalysisStationCombineRepository.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs index d6521d6..c7ebc26 100644 --- a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs +++ b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs @@ -38,7 +38,7 @@ namespace SolarPower.Repository.Implement SUM(TOTALMONEY) AS All_money, SUM(TOTALKWH) AS All_kwh, SUM(TOTALCARBON) AS All_Carbon - from (SELECT psm.PowerStationId, max(psm.TIMESTAMP) AS TIMESTAMP FROM power_station_history_month psm WHERE PowerStationId IN (8) GROUP BY PowerStationId) a + from (SELECT psm.PowerStationId, max(psm.TIMESTAMP) AS TIMESTAMP FROM power_station_history_month psm WHERE PowerStationId IN @ids GROUP BY PowerStationId) a LEFT JOIN power_station_history_month psm ON a.PowerStationId = psm.PowerStationId AND a.TIMESTAMP = psm.TIMESTAMP ) AS m, @@ -74,8 +74,8 @@ namespace SolarPower.Repository.Implement SUM(TOTALMONEY) AS All_money, SUM(TOTALKWH) AS All_kwh, SUM(TOTALCARBON) AS All_Carbon - from power_station_history_month - WHERE PowerStationId IN @ids + from (SELECT psm.PowerStationId, max(psm.TIMESTAMP) AS TIMESTAMP FROM power_station_history_month psm WHERE PowerStationId IN @ids GROUP BY PowerStationId) a + LEFT JOIN power_station_history_month psm ON a.PowerStationId = psm.PowerStationId AND a.TIMESTAMP = psm.TIMESTAMP ) AS m, ( @@ -105,8 +105,8 @@ namespace SolarPower.Repository.Implement SUM(TOTALMONEY) AS All_money, SUM(TOTALKWH) AS All_kwh, SUM(TOTALCARBON) AS All_Carbon - from power_station_history_month - WHERE PowerStationId IN @ids + from (SELECT psm.PowerStationId, max(psm.TIMESTAMP) AS TIMESTAMP FROM power_station_history_month psm WHERE PowerStationId IN @ids GROUP BY PowerStationId) a + LEFT JOIN power_station_history_month psm ON a.PowerStationId = psm.PowerStationId AND a.TIMESTAMP = psm.TIMESTAMP ) AS m, ( @@ -136,8 +136,8 @@ namespace SolarPower.Repository.Implement SUM(TOTALMONEY) AS All_money, SUM(TOTALKWH) AS All_kwh, SUM(TOTALCARBON) AS All_Carbon - from power_station_history_month - WHERE PowerStationId IN @ids + from (SELECT psm.PowerStationId, max(psm.TIMESTAMP) AS TIMESTAMP FROM power_station_history_month psm WHERE PowerStationId IN @ids GROUP BY PowerStationId) a + LEFT JOIN power_station_history_month psm ON a.PowerStationId = psm.PowerStationId AND a.TIMESTAMP = psm.TIMESTAMP ) AS m, (