From fe98cf73031f9736b13c70f4c877d680e0ae3ecb Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期四, 10 四月 2025 08:52:02 +0800
Subject: [PATCH] *

---
 src/main/resources/mapper/DeviceErrorMapper.xml |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/DeviceErrorMapper.xml b/src/main/resources/mapper/DeviceErrorMapper.xml
index 9188ec0..199c16e 100644
--- a/src/main/resources/mapper/DeviceErrorMapper.xml
+++ b/src/main/resources/mapper/DeviceErrorMapper.xml
@@ -11,6 +11,18 @@
         <result column="CREATE_TIME" property="createTime" />
     </resultMap>
 
+    <sql id="batchSeq">
+        <if test="id != null and id != 0">
+            and a.ID = #{id}
+        </if>
+        <if test="device != null and device != ''">
+            and a.DEVICE = #{device}
+        </if>
+        <if test="deviceId != null and deviceId != 0">
+            and a.DEVICE_ID = #{deviceId}
+        </if>
+    </sql>
+
     <select id="selectByDeviceAndDeviceId" resultMap="BaseResultMap">
         select top 1 * from "SOURCE"."wcs_device_error"
         where "DEVICE" = #{device}
@@ -23,4 +35,18 @@
         and "DEVICE_ID" = #{deviceId}
     </delete>
 
+    <select id="selectDeviceErrorList" resultMap="BaseResultMap">
+        SELECT * FROM "SOURCE"."wcs_device_error"
+        WHERE 1=1
+        <include refid="batchSeq"></include>
+        ORDER BY CREATE_TIME DESC
+        LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize});
+    </select>
+
+    <select id="selectDeviceErrorListTotal" resultType="Long">
+        SELECT count(1) FROM "SOURCE"."wcs_device_error"
+        WHERE 1=1
+        <include refid="batchSeq"></include>
+    </select>
+
 </mapper>

--
Gitblit v1.9.1