From 1b1233fae35e9e28dbec5934858bf438ee519951 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 18 四月 2024 10:24:45 +0800
Subject: [PATCH] sql修改

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml
index 25e3308..8209fb6 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml
@@ -47,6 +47,7 @@
     <select id="getUtilizationByMonth" resultType="java.util.Map">
         SELECT
             SUM(process_long) processLong,
+            SUM(open_long) openLong,
             COUNT(*) processDay
         FROM
             mdc_equipment_statistical_info
@@ -122,24 +123,37 @@
             the_date
     </select>
 
-    <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo">
+    <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentStatisticalInfoDto">
         SELECT
-            equipment_id,
-            SUM ( process_long ) processLong,
-            SUM ( open_long ) openLong
+            t1.equipment_id,
+            t2.equipment_name,
+            SUM ( t1.process_long ) processLong,
+            SUM ( t1.open_long ) openLong
         FROM
-            mdc_equipment_statistical_info
+            mdc_equipment_statistical_info t1
+            LEFT JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id
         <where>
-            AND the_date BETWEEN #{start} AND #{end}
+            AND t1.the_date BETWEEN #{start} AND #{end}
             <if test="equipmentIdList != null and equipmentIdList.size() > 0 ">
-                AND equipment_id IN
+                AND t1.equipment_id IN
                 <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                     #{id}
                 </foreach>
             </if>
         </where>
         GROUP BY
-            equipment_id
+            t1.equipment_id,t2.equipment_name
+    </select>
+
+
+    <select id="getEquipmentList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
+        SELECT
+            t1.*
+        FROM
+            mdc_equipment t1
+                LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
+        WHERE
+            t2.production_id = #{productionId}
     </select>
 
 

--
Gitblit v1.9.3