From 25db770e621f1259b8d5b7fd514207f7481c2d0f Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 30 十月 2024 11:25:37 +0800
Subject: [PATCH] blade_cps路径改为smis

---
 smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml |   46 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml b/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml
index 82bf9cc..86b829b 100644
--- a/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml
+++ b/smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml
@@ -39,7 +39,7 @@
         </where>
         order by ts asc
     </select>
-
+	<!-- 
     <select id="pageProcessParameter" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
         select ts as time,
         ts as realTime,
@@ -55,7 +55,18 @@
         order by ts asc
         limit #{current}, #{size}
     </select>
-
+     -->
+     <select id="pageProcessParameter" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
+        select 
+        n as collectItem,
+        v as value_collect
+        from root.f2.process_param_${workstationId}_${item}
+        where time &gt;= #{startTime}
+            and time &lt;= #{endTime}
+        order by time asc
+        limit #{size} offset #{current}
+    </select>
+	<!-- 
     <select id="countProcessParameter" resultType="java.lang.Long">
         select count(*)
         from iot_data.super_collect_data
@@ -66,7 +77,15 @@
             and workstation_id = #{workstationId}
         </where>
     </select>
-
+ -->
+   <select id="countProcessParameter" resultType="java.lang.Long">
+        select count(*)
+        from root.f2.process_param_${workstationId}_${item}
+        <where>
+            and time &gt;= #{startTime}
+            and time &lt;= #{endTime}
+        </where>
+    </select>
     <select id="getOneDate" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
         select ts as time,
         ts as realTime,
@@ -179,5 +198,26 @@
         order by time
         align by device
     </select>
+    
+    <select id="lastParameterNotEqValue" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
+        select n as collectItem,v as valueCollect
+        from root.f2.process_param_${workstationId}_${item}
+        where v&lt;&gt;"#{value}"
+        order by time desc limit 1
+    </select>
+    
+    <select id="firstParameterEqValueGtTime" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
+        select n as collectItem,v as valueCollect
+        from root.f2.process_param_${workstationId}_${item}
+        where v="#{value}" and time &gt; #{time}
+        order by time limit 1
+    </select>
+    
+    <select id="firstParameterEqValue" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
+        select n as collectItem,v as valueCollect
+        from root.f2.process_param_${workstationId}_${item}
+        where v="#{value}"
+        order by time limit 1
+    </select>
 </mapper>
 

--
Gitblit v1.9.3