From 2ce6aa8eee18b7436cfe144614074494cb11b551 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 17 二月 2025 16:36:20 +0800
Subject: [PATCH] 巡检时计算巡检距离
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml | 44 ++++++++++++++++++++++++++++++++------------
1 files changed, 32 insertions(+), 12 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 44bb383..088784e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml
@@ -8,10 +8,11 @@
<result column="inspector_id" jdbcType="BIGINT" property="inspectorId" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="stop_time" jdbcType="TIMESTAMP" property="stopTime" />
+ <result column="inspect_distance" jdbcType="FLOAT" property="inspectDistance" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, inspector_id, start_time, stop_time
+ id, inspector_id, start_time, stop_time, inspect_distance
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
@@ -28,9 +29,9 @@
<insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeInspect">
<!--@mbg.generated-->
insert into ope_inspect (id, inspector_id, start_time,
- stop_time)
+ stop_time, inspect_distance)
values (#{id,jdbcType=BIGINT}, #{inspectorId,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP},
- #{stopTime,jdbcType=TIMESTAMP})
+ #{stopTime,jdbcType=TIMESTAMP}, #{inspectDistance,jdbcType=FLOAT})
</insert>
<insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeInspect">
<!--@mbg.generated-->
@@ -48,6 +49,9 @@
<if test="stopTime != null">
stop_time,
</if>
+ <if test="inspectDistance != null">
+ inspect_distance,
+ </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -61,6 +65,9 @@
</if>
<if test="stopTime != null">
#{stopTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="inspectDistance != null">
+ #{inspectDistance,jdbcType=FLOAT},
</if>
</trim>
</insert>
@@ -77,6 +84,9 @@
<if test="stopTime != null">
stop_time = #{stopTime,jdbcType=TIMESTAMP},
</if>
+ <if test="inspectDistance != null">
+ inspect_distance = #{inspectDistance,jdbcType=FLOAT},
+ </if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@@ -85,10 +95,12 @@
update ope_inspect
set inspector_id = #{inspectorId,jdbcType=BIGINT},
start_time = #{startTime,jdbcType=TIMESTAMP},
- stop_time = #{stopTime,jdbcType=TIMESTAMP}
+ stop_time = #{stopTime,jdbcType=TIMESTAMP},
+ inspect_distance = #{inspectDistance,jdbcType=FLOAT}
where id = #{id,jdbcType=BIGINT}
</update>
-<!-- 鏌ヨ鎬绘暟 -->
+
+ <!-- 鏌ヨ鎬绘暟 -->
<select id="getInspectsCount" resultType="java.lang.Long">
SELECT
count(*)
@@ -109,15 +121,16 @@
AND oi.start_time BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
- </select>
-<!-- 鏌ヨ鍒楄〃 -->
+ </select>
+
+ <!-- 鏌ヨ鍒楄〃 -->
<select id="getInspects" resultType="com.dy.pipIrrGlobal.voOp.VoInspect">
SELECT
- oi.inspector_id AS inspectorId,
- ba_user.`name` AS inspectorName,
- oi.id AS inspectId,
- oi.start_time AS startTime,
- oi.stop_time AS stopTime
+ oi.inspector_id AS inspectorId,
+ ba_user.`name` AS inspectorName,
+ oi.id AS inspectId,
+ oi.start_time AS startTime,
+ oi.stop_time AS stopTime
FROM `ope_inspect` oi
INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id
<where>
@@ -141,4 +154,11 @@
</if>
</trim>
</select>
+
+ <!--鏇存柊鎸囧畾宸℃璁板綍鐨勫贰妫�璺濈-->
+ <update id="updateInspectDistance">
+ UPDATE ope_inspect
+ SET inspect_distance = #{distance}
+ WHERE id = #{inspectId}
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0