From 632a346f1fd07ab659bfc68e70bd6e254b0e8c51 Mon Sep 17 00:00:00 2001
From: lius <Lius2225@163.com>
Date: 星期三, 19 七月 2023 16:10:55 +0800
Subject: [PATCH] 统计分析接口

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEfficiencyReportMapper.xml |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEfficiencyReportMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEfficiencyReportMapper.xml
index 66aa54f..d5d3516 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEfficiencyReportMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEfficiencyReportMapper.xml
@@ -8,7 +8,7 @@
             t2.equipment_id equipmentId,
             t2.equipment_name equipmentName,
             t2.equipment_type equipmentType,
-            t1.the_date,
+            t1.the_date theDate,
             t1.process_long processLong,
             t1.process_long / 86400 utilizationRate,
             CASE
@@ -31,7 +31,41 @@
                 #{ id }
             </foreach>
         </if>
-        ORDER BY
-            t1.the_date
+        ORDER BY t1.the_date
+    </select>
+
+    <!--鏌ヨ寮�鍔ㄧ巼鏁版嵁-->
+    <select id="efficiencyPOList" resultType="org.jeecg.modules.mdc.dto.MdcEfficiencyDto">
+        SELECT
+            t2.equipment_id equipmentId,
+            t2.equipment_name equipmentName,
+            t2.equipment_type equipmentType,
+            t1.the_date theDate,
+            t1.process_long processLong,
+            CASE
+                WHEN t1.open_long > 0 THEN
+                t1.process_long / t1.open_long ELSE 0
+            END utilizationRate,
+            CASE
+                WHEN t1.open_long > 0 THEN
+                t1.process_long / t1.open_long ELSE 0
+            END startRate,
+            t1.open_long / 86400 openRate,
+            t1.open_long openLong,
+            t1.wait_long waitLong,
+            t1.close_long closeLong
+        FROM
+            mdc_equipment t2
+            LEFT JOIN mdc_equipment_statistical_info t1 ON t1.equipment_id = t2.equipment_id
+        WHERE
+            t1.the_date &lt;= #{ vo.endTime }
+            AND t1.the_date &gt;= #{ vo.startTime }
+        <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
+            AND t2.equipment_id IN
+            <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
+                #{ id }
+            </foreach>
+        </if>
+        ORDER BY t1.the_date
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3