From f6962c0ede2f18b8aaeaf69f84b39d459a5a59f4 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 06 八月 2024 13:41:12 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml |  115 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 61 insertions(+), 54 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml
index f0ba647..0f4282c 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml
@@ -15,35 +15,37 @@
     <result column="operator" jdbcType="BIGINT" property="operator" />
     <result column="result" jdbcType="TINYINT" property="result" />
     <result column="result_time" jdbcType="TIMESTAMP" property="resultTime" />
-    <result column="result_text" property="resultText" jdbcType="JAVA_OBJECT" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
+    <result column="result_text" jdbcType="LONGVARCHAR" property="resultText" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    com_id, command_code, command_name, intake_id, rtu_addr, protocol, param, send_time, `operator`,
-    `result`, result_time, result_text
+    com_id, command_code, command_name, intake_id, rtu_addr, protocol, param, send_time, 
+    `operator`, `result`, result_time, result_text
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     select 
     <include refid="Base_Column_List" />
     from rm_command_history
-    where com_id = #{id,jdbcType=BIGINT}
+    where com_id = #{comId,jdbcType=BIGINT}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     delete from rm_command_history
-    where com_id = #{id,jdbcType=BIGINT}
+    where com_id = #{comId,jdbcType=BIGINT}
   </delete>
   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory">
     <!--@mbg.generated-->
-    insert into rm_command_history (com_id, command_code, command_name,
-      intake_id, rtu_addr, protocol, param,
-      send_time, `operator`, `result`, 
-      result_time, result_text)
-    values (#{comId,jdbcType=BIGINT}, #{commandCode,jdbcType=VARCHAR}, #{commandName,jdbcType=VARCHAR}, #{intakeId,jdbcType=BIGINT},
-      #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
-      #{sendTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT}, #{result,jdbcType=TINYINT}, 
-      #{resultTime,jdbcType=TIMESTAMP}, #{resultText,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler})
+    insert into rm_command_history (com_id, command_code, command_name, 
+      intake_id, rtu_addr, protocol, 
+      param, send_time, `operator`, 
+      `result`, result_time, result_text
+      )
+    values (#{comId,jdbcType=BIGINT}, #{commandCode,jdbcType=VARCHAR}, #{commandName,jdbcType=VARCHAR}, 
+      #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},
+      #{param,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}, #{sendTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT},
+      #{result,jdbcType=TINYINT}, #{resultTime,jdbcType=TIMESTAMP}, #{resultText,jdbcType=LONGVARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandHistory">
     <!--@mbg.generated-->
@@ -121,7 +123,7 @@
         #{resultTime,jdbcType=TIMESTAMP},
       </if>
       <if test="resultText != null">
-        #{resultText,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
+        #{resultText,jdbcType=LONGVARCHAR},
       </if>
     </trim>
   </insert>
@@ -160,7 +162,7 @@
         result_time = #{resultTime,jdbcType=TIMESTAMP},
       </if>
       <if test="resultText != null">
-        result_text = #{resultText,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler},
+        result_text = #{resultText,jdbcType=LONGVARCHAR},
       </if>
     </set>
     where com_id = #{comId,jdbcType=BIGINT}
@@ -178,7 +180,7 @@
       `operator` = #{operator,jdbcType=BIGINT},
       `result` = #{result,jdbcType=TINYINT},
       result_time = #{resultTime,jdbcType=TIMESTAMP},
-      result_text = #{resultText,jdbcType= JAVA_OBJECT, typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler}
+      result_text = #{resultText,jdbcType=LONGVARCHAR}
     where com_id = #{comId,jdbcType=BIGINT}
   </update>
 
@@ -218,41 +220,44 @@
   <!--鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟-->
   <select id="getUncloseParam" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedParam">
     SELECT
-      com.rtu_addr AS rtuAddr,
-      com.param ->>'$.orderNo' AS orderNo,
-      com.param ->>'$.icCardNo' AS vcNum
+        com.rtu_addr AS rtuAddr,
+        com.param ->>'$.orderNo' AS orderNo,
+        com.param ->>'$.icCardNo' AS vcNum
     FROM rm_command_history com
-      INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr
-      INNER JOIN pr_intake inta ON con.intakeId = inta.id
-      INNER JOIN JSON_TABLE(
-<!--      '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
-        #{onLineMap},
-      '$[*]' COLUMNS(
-      rtuAddr VARCHAR(20) PATH '$.rtuAddr',
-      isOnLine BOOLEAN PATH '$.isOnLine'
-      )
-      ) rtus ON com.rtu_addr = rtus.rtuAddr
+        INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr
+        INNER JOIN pr_intake inta ON con.intakeId = inta.id
+        INNER JOIN JSON_TABLE(
+            <!--      '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
+            #{onLineMap},
+            '$[*]' COLUMNS(
+                rtuAddr VARCHAR(20) PATH '$.rtuAddr',
+                isOnLine BOOLEAN PATH '$.isOnLine'
+            )
+        ) rtus ON com.rtu_addr = rtus.rtuAddr
     WHERE (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') AND con.intakeId = #{intakeId}
-      AND NOT EXISTS (
-      SELECT *
-      FROM rm_command_history
-      WHERE (result IS NULL OR result = 1 )
-      AND (command_code = '93' OR command_code = 'A3' OR command_code = '98')
-      AND param ->>'$.orderNo' = com.param ->>'$.orderNo'
-      )
+    AND NOT EXISTS (
+        SELECT *
+        FROM rm_command_history
+        WHERE (result IS NULL OR result = 1 )
+            AND (command_code = '93' OR command_code = 'A3' OR command_code = '98')
+            AND param ->>'$.orderNo' = com.param ->>'$.orderNo'
+    )
     ORDER BY com.send_time DESC
-      LIMIT 0,1
+    LIMIT 0,1
   </select>
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍鎬绘暟-->
   <select id="getCommandHistoriesCount" resultType="java.lang.Long">
     SELECT
-      COUNT(*) AS recordCount
+        COUNT(*) AS recordCount
     FROM rm_command_history his
       INNER JOIN pr_intake inta ON inta.id = his.intake_id
       LEFT JOIN se_client cli ON cli.id = his.operator
       LEFT JOIN ba_user  user ON user.id = his.operator
     <where>
+      <if test="intakeId != null">
+        AND his.intake_id = #{intakeId}
+      </if>
       <if test = "commandName != null and commandName !=''">
         AND his.command_name LIKE CONCAT('%',#{commandName},'%')
       </if>
@@ -268,24 +273,27 @@
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍-->
   <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand">
     SELECT
-      his.com_id AS comId,
-      his.command_name AS commandName,
-      inta.name AS intakeName,
-      his.rtu_addr AS rtuAddr,
-      his.protocol,
-      his.send_time AS sendTime,
-      his.result_time AS resultTime,
-      (CASE
-         WHEN his.result = 1 THEN "鎴愬姛"
-         ELSE "澶辫触"
+        his.com_id AS comId,
+        his.command_name AS commandName,
+        inta.name AS intakeName,
+        his.rtu_addr AS rtuAddr,
+        his.protocol,
+        his.send_time AS sendTime,
+        his.result_time AS resultTime,
+        (CASE
+        WHEN his.result = 1 THEN "鎴愬姛"
+        ELSE "澶辫触"
         END) AS result,
-      his.result_text,
-      IFNULL(cli.name, user.name) AS userName
+        his.result_text,
+        IFNULL(cli.name, user.name) AS userName
     FROM rm_command_history his
-     INNER JOIN pr_intake inta ON inta.id = his.intake_id
-     LEFT JOIN se_client cli ON cli.id = his.operator
-     LEFT JOIN ba_user  user ON user.id = his.operator
+        INNER JOIN pr_intake inta ON inta.id = his.intake_id
+        LEFT JOIN se_client cli ON cli.id = his.operator
+        LEFT JOIN ba_user  user ON user.id = his.operator
     <where>
+      <if test="intakeId != null">
+        AND his.intake_id = #{intakeId}
+      </if>
       <if test = "commandName != null and commandName !=''">
         AND his.command_name LIKE CONCAT('%',#{commandName},'%')
       </if>
@@ -304,5 +312,4 @@
       </if>
     </trim>
   </select>
-
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0