From 9619e60e3075a432d692f3cd8b76787568c53aad Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 07 五月 2025 15:56:58 +0800
Subject: [PATCH] 1、完善代码;2、禁止输出SpringBoot启动时Banner。
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeInspectMapper.xml | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 107 insertions(+), 4 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 888dd76..c11b0d3 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,7 +95,100 @@
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(*)
+ FROM `ope_inspect` oi
+ INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id
+ <where>
+ ba_user.deleted = 0
+ <if test="inspectorId != null">
+ AND oi.inspector_id = #{inspectorId}
+ </if>
+ <if test="inspectId != null">
+ AND oi.id = #{inspectId}
+ </if>
+ <if test="inspectorName != null">
+ AND ba_user.`name` LIKE CONCAT('%',#{inspectorName},'%')
+ </if>
+ <if test="timeStart != null and timeStop != null">
+ AND oi.start_time BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ </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.inspect_distance AS inspectDistance
+ FROM `ope_inspect` oi
+ INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id
+ <where>
+ ba_user.deleted = 0
+ <if test="inspectorId != null">
+ AND oi.inspector_id = #{inspectorId}
+ </if>
+ <if test="inspectId != null">
+ AND oi.id = #{inspectId}
+ </if>
+ <if test="inspectorName != null">
+ AND ba_user.`name` LIKE CONCAT('%',#{inspectorName},'%')
+ </if>
+ <if test="timeStart != null and timeStop != null">
+ AND oi.start_time BETWEEN #{timeStart} AND #{timeStop}
+ </if>
+ </where>
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+ </if>
+ </trim>
+ </select>
+
+ <!--鏇存柊鎸囧畾宸℃璁板綍鐨勫贰妫�璺濈-->
+ <update id="updateInspectDistance">
+ UPDATE ope_inspect
+ 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