From c7c8554e2b9809bc90ac4a43fdaa39dfe16f4ab0 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 09 五月 2025 14:09:32 +0800
Subject: [PATCH] “远程测控”功能返回数据中增加protocol和protocolVersion属性,以备前端做多协议兼容。

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml |   83 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
index a578e97..cf9d2c9 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
@@ -5,6 +5,8 @@
     <!--@mbg.generated-->
     <!--@Table ir_intake_operate-->
     <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="plan_id" jdbcType="BIGINT" property="planId" />
+    <result column="operate_type" jdbcType="TINYINT" property="operateType" />
     <result column="command_id" jdbcType="BIGINT" property="commandId" />
     <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
@@ -14,7 +16,8 @@
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, command_id, intake_id, start_time, duration, command_result, failure_factors
+    id, plan_id, operate_type, command_id, intake_id, start_time, duration, command_result, 
+    failure_factors
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -30,12 +33,14 @@
   </delete>
   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
     <!--@mbg.generated-->
-    insert into ir_intake_operate (id, command_id, intake_id, 
-      start_time, duration, command_result, 
-      failure_factors)
-    values (#{id,jdbcType=BIGINT}, #{commandId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, 
-      #{startTime,jdbcType=TIMESTAMP}, #{duration,jdbcType=INTEGER}, #{commandResult,jdbcType=TINYINT}, 
-      #{failureFactors,jdbcType=VARCHAR})
+    insert into ir_intake_operate (id, plan_id, operate_type, 
+      command_id, intake_id, start_time, 
+      duration, command_result, failure_factors
+      )
+    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{operateType,jdbcType=TINYINT}, 
+      #{commandId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, 
+      #{duration,jdbcType=INTEGER}, #{commandResult,jdbcType=TINYINT}, #{failureFactors,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
     <!--@mbg.generated-->
@@ -43,6 +48,12 @@
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
+      </if>
+      <if test="planId != null">
+        plan_id,
+      </if>
+      <if test="operateType != null">
+        operate_type,
       </if>
       <if test="commandId != null">
         command_id,
@@ -66,6 +77,12 @@
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
         #{id,jdbcType=BIGINT},
+      </if>
+      <if test="planId != null">
+        #{planId,jdbcType=BIGINT},
+      </if>
+      <if test="operateType != null">
+        #{operateType,jdbcType=TINYINT},
       </if>
       <if test="commandId != null">
         #{commandId,jdbcType=BIGINT},
@@ -91,6 +108,12 @@
     <!--@mbg.generated-->
     update ir_intake_operate
     <set>
+      <if test="planId != null">
+        plan_id = #{planId,jdbcType=BIGINT},
+      </if>
+      <if test="operateType != null">
+        operate_type = #{operateType,jdbcType=TINYINT},
+      </if>
       <if test="commandId != null">
         command_id = #{commandId,jdbcType=BIGINT},
       </if>
@@ -115,7 +138,9 @@
   <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
     <!--@mbg.generated-->
     update ir_intake_operate
-    set command_id = #{commandId,jdbcType=BIGINT},
+    set plan_id = #{planId,jdbcType=BIGINT},
+      operate_type = #{operateType,jdbcType=TINYINT},
+      command_id = #{commandId,jdbcType=BIGINT},
       intake_id = #{intakeId,jdbcType=BIGINT},
       start_time = #{startTime,jdbcType=TIMESTAMP},
       duration = #{duration,jdbcType=INTEGER},
@@ -130,4 +155,46 @@
     set command_result = #{commandResult}, failure_factors = #{failureFactors}
     where command_id = #{commandId}
   </update>
+
+  <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍙栨按鍙D锛堝凡鍙戝竷寮�鍙戝懡浠わ紝鏃犺鏄惁鎴愬姛锛�-->
+  <select id="getToTerminateIntakeIds" resultType="java.lang.Long">
+    SELECT
+      intake_id AS intakeId
+    FROM ir_intake_operate
+    WHERE operate_type = 1 AND plan_id = #{planId}
+  </select>
+
+  <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍛戒护ID-->
+  <select id="getTerminateCommandIds" resultType="java.lang.Long">
+    SELECT command_id AS commandId FROM ir_intake_operate WHERE operate_type = 1 AND plan_id = #{planId}
+  </select>
+
+  <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍙栨按鍙e垪琛紙寮�闃�鎴愬姛鐨勶級-->
+  <select id="getToTerminateIntakes" resultType="com.dy.pipIrrGlobal.voIr.VoToTerminateIntakes">
+    SELECT
+      command_id AS commandId,
+      intake_id AS intakeId,
+      start_time AS startTime
+    FROM ir_intake_operate
+    WHERE operate_type = 1 AND command_result = 1 AND plan_id = #{planId}
+  </select>
+
+  <!--鏍规嵁璁″垝ID鍙婄杞粍ID鑾峰彇鍙栨按鍙e彂甯冨彂甯冪粨鏋�-->
+  <select id="getIntakeResult" resultType="com.dy.pipIrrGlobal.voIr.VoIntakeResult">
+    SELECT
+        IF(io.command_result = 1, 0, 1) AS code,
+        (SELECT name FROM pr_intake WHERE id = io.intake_id) AS intakeName,
+        io.failure_factors AS result
+    FROM ir_intake_operate io
+        inner JOIN ir_group_intake gi ON gi.intake_id = io.intake_id
+    WHERE io.plan_id = #{planId} AND gi.group_id = #{groupId} AND operate_type = 1;
+  </select>
+
+  <!--鏍规嵁璁″垝ID鑾峰彇鍙栨按鍙e懡浠ゅ彂甯冨け璐ユ暟閲忥紝鐏屾簤璁″垝璇︽儏椤典娇鐢�-->
+  <select id="getFailureCount" resultType="java.lang.Integer">
+    SELECT
+      COUNT(1) AS failureCount
+    FROM ir_intake_operate
+    WHERE operate_type = 1 AND command_result != 1 AND plan_id = #{planId}
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0