From 56e8ccde7c982bc2a5b9746edb2e596c895f63e6 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期三, 13 十二月 2023 15:20:07 +0800
Subject: [PATCH] 利用率页面添加平均值和合计值

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentSparesMapper.xml |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentSparesMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentSparesMapper.xml
index d9259f6..b09668f 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentSparesMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentSparesMapper.xml
@@ -12,8 +12,8 @@
             t2.name,
             t2.model,
             t2.specification,
-            t3.`name` as constructorName,
-            t4.`name` as mainUnitName,
+            t3.name as constructorName,
+            t4.name as mainUnitName,
             t1.mating_quantity as matingQuantity,
             t1.life_span as lifeSpan,
             t1.change_cycle as changeCycle,
@@ -44,4 +44,25 @@
         </if>
         ORDER BY t1.create_time desc
     </select>
-</mapper>
\ No newline at end of file
+    <select id="getPagesByEquipmentId" resultType="org.jeecg.modules.eam.entity.EquipmentSpares">
+      select
+      t1.id id,
+      t2.id sparePartId,
+      t2.name name,
+      t2.num num,
+      t2.model model,
+      t2.specification specification,
+      t2.main_unit_id unitId,
+      t3.name unitName,
+      t1.equipment_id equipmentId
+      from mom_eam_equipment_spares t1
+      left join mom_eam_spare_part t2
+      on t1.spare_part_id = t2.id
+      left join mom_base_unit t3
+      on t2.main_unit_id = t3.id
+      where
+      t1.del_flag = 0
+      and
+      t1.equipment_id=#{equipmentId}
+    </select>
+</mapper>

--
Gitblit v1.9.3