From 03ba1886bd2daaac6d2bc2a59548febdefdd2aaf Mon Sep 17 00:00:00 2001 From: b110212000 Date: Tue, 14 Sep 2021 11:48:58 +0800 Subject: [PATCH] =?UTF-8?q?sql=20=E7=95=B0=E5=B8=B8(=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Repository/Implement/OverviewRepository.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index c388607..daf943d 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -423,7 +423,7 @@ namespace SolarPower.Repository.Implement join alarmorion_orionalarmclass b on a.alarmclass = b.id left join ref_err_device c on trim(b.alarmClass) = c.deviceType left join ref_err_inv d on lower(b.alarmClass) = d.deviceType - and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode + # and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode left join power_station ps on ps.Code = site_id left join operation_record pr on pr.ErrorCode = a.id WHERE a.sourceState = @Status AND ps.Id IN @PowerStationId"; @@ -440,6 +440,8 @@ namespace SolarPower.Repository.Implement sql += @$" AND `timestamp` BETWEEN {startime * 1000} AND {endtime * 1000}"; } + sql += "order by errvalue "; + result = (await conn.QueryAsync(sql, new {