|
|
|
@ -46,8 +46,9 @@ public class EmeterEnergyChangeService : BaseServices<EmeterEnergyChange>
|
|
|
|
|
d.`code`,
|
|
|
|
|
d.`UploadTime`,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN d.`Count` = 1 THEN d.`MaxValue` - d.`PreviousMaxValue`
|
|
|
|
|
ELSE d.`MaxValue` - d.`MinValue`
|
|
|
|
|
WHEN d.`Count` > 1 THEN d.`MaxValue` - d.`MinValue`
|
|
|
|
|
WHEN d.`Count` = 1 AND d.`PreviousMaxValue` IS NOT NULL THEN d.`MaxValue` - d.`PreviousMaxValue`
|
|
|
|
|
ELSE 0
|
|
|
|
|
END AS `DailyValue`
|
|
|
|
|
FROM
|
|
|
|
|
previous_day_max d
|
|
|
|
@ -65,6 +66,7 @@ ORDER BY
|
|
|
|
|
`UploadTime`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
List<EmeterEnergyChange> emeterEnergies = await _emeterEnergyChangeRep.SqlQueryable(sql);
|
|
|
|
|