From 34e795bedc57454c43b00cdf8e2cc2d9eb5a932a Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 11 四月 2025 14:59:50 +0800
Subject: [PATCH] 优化轮灌组分页查询接口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml
index 088784e..c11b0d3 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml
@@ -130,7 +130,8 @@
     ba_user.`name` AS inspectorName,
     oi.id AS inspectId,
     oi.start_time AS startTime,
-    oi.stop_time AS stopTime
+    oi.stop_time AS stopTime,
+    oi.inspect_distance AS inspectDistance
     FROM	`ope_inspect` oi
     INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id
     <where>
@@ -161,4 +162,33 @@
     SET inspect_distance = #{distance}
     WHERE id = #{inspectId}
   </update>
+
+  <!--鏍规嵁宸℃鍛業D鑾峰彇宸℃璁板綍鏁伴噺-->
+  <select id="getInstectsCountByInspectorId" resultType="java.lang.Long">
+    SELECT
+        count(*)
+    FROM ope_inspect ins
+    LEFT JOIN ba_user user ON user.id = ins.inspector_id
+    WHERE ins.inspector_id = #{inspectorId}
+  </select>
+
+  <!--鏍规嵁宸℃鍛業D鑾峰彇宸℃鍒楄〃-->
+  <select id="getInstectsByInspectorId" resultType="com.dy.pipIrrGlobal.voOp.VoInspect">
+    SELECT
+        user.id AS inspectorId,
+        user.name AS inspectorName,
+        ins.id AS inspectId,
+        ins.start_time AS startTime,
+        ins.stop_time AS stopTime,
+        ins.inspect_distance AS inspectDistance
+    FROM ope_inspect ins
+        LEFT JOIN ba_user user ON user.id = ins.inspector_id
+    WHERE ins.inspector_id = #{inspectorId}
+    ORDER BY ins.start_time DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0