From 86d777aff8412b49fa83f51a1d9e0524e58f6059 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 18 三月 2026 14:31:13 +0800
Subject: [PATCH] fix: 删除生产订单未回退下发数量与更新下发状态
---
src/main/resources/mapper/energy/EnergyConsumptionDetailMapper.xml | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/energy/EnergyConsumptionDetailMapper.xml b/src/main/resources/mapper/energy/EnergyConsumptionDetailMapper.xml
index 32f2f40..50f4e2f 100644
--- a/src/main/resources/mapper/energy/EnergyConsumptionDetailMapper.xml
+++ b/src/main/resources/mapper/energy/EnergyConsumptionDetailMapper.xml
@@ -41,7 +41,9 @@
</where>
</select>
<select id="calculateEnergy" resultType="java.util.Map">
- select SUM(ecd.dosage) totalEnergyConsumption,
+ select COALESCE(t.totalEnergyConsumption, 0) AS totalEnergyConsumption,
+ COALESCE(t.totalEnergyCost, 0) AS totalEnergyCost
+ from (select SUM(ecd.dosage) totalEnergyConsumption,
SUM(ecd.dosage * e.unit_price) totalEnergyCost
from energy_consumption_detail ecd
left join energy e on ecd.energy_id = e.id
@@ -49,6 +51,7 @@
<if test="c.type != null and c.type != ''">
and ecd.type =#{c.type}
</if>
+ )t
</select>
<select id="energyConsumptionTypeProportion"
resultType="com.ruoyi.energy.dto.EnergyConsumptionTypeDto">
--
Gitblit v1.9.3