From c8673cbde4538b109e43042dc93cf33c46dca37e Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 31 十二月 2024 10:56:57 +0800
Subject: [PATCH] 每日排产计划修改

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentXYZMapper.xml |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentXYZMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentXYZMapper.xml
index 2aa8691..a7ae619 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentXYZMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentXYZMapper.xml
@@ -2,4 +2,32 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.mdc.mapper.EquipmentXYZMapper">
 
+    <select id="findByEquipmentId" resultType="org.jeecg.modules.mdc.entity.EquipmentXYZ">
+        SELECT TOP
+            1 *
+        FROM
+            EquipmentXYZ
+        WHERE
+            EquipmentID = #{equipmentId}
+        ORDER BY
+            CollectTime DESC
+    </select>
+
+    <select id="getNearAxisType" resultType="org.jeecg.modules.mdc.dto.MachineXYZHistoryDto">
+        SELECT TOP 1
+            CollectTime collectTime,
+            EquipmentID equipmentID,
+            Xmachine xMachine,
+            Ymachine yMachine,
+            Zmachine zMachine,
+            Amachine aMachine,
+            Bmachine bMachine
+        FROM
+            EquipmentXYZ
+        WHERE
+            EquipmentID = #{equipmentId}
+          AND CollectTime BETWEEN #{startDate} AND #{endDate}
+        ORDER BY
+            ABS( DATEDIFF( SECOND, CollectTime, #{nearDate} ) )
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3