From 9552a061aa27b05f6044d60efd265553a275b58e Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期四, 09 五月 2024 13:43:19 +0800
Subject: [PATCH] 流浪控制器增加、删除、查询接口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
index 3753a1b..877c01d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
@@ -15,7 +15,7 @@
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
-    select 
+    select
     <include refid="Base_Column_List" />
     from pr_controller_tramp
     where id = #{id,jdbcType=BIGINT}
@@ -36,7 +36,7 @@
   </delete>
   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrControllerTramp">
     <!--@mbg.generated-->
-    insert into pr_controller_tramp (id, rtuAddr, protocol, 
+    insert into pr_controller_tramp (id, rtuAddr, protocol,
       findDt)
     values (#{id,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},
       #{findDt,jdbcType=TIMESTAMP})
@@ -107,4 +107,43 @@
   <select id="getTrampControllerInfo" resultMap="BaseResultMap">
     SELECT rtuAddr, protocol, findDt FROM pr_controller_tramp WHERE id = ${controllerId}
   </select>
+
+    <!--    鏍规嵁鏉′欢鑾峰彇娴佹氮鎺у埗鍣ㄤ俊鎭�-->
+    <select id="getTrampControllers" resultMap="BaseResultMap">
+        select CAST(id AS char)AS id,
+        rtuAddr,
+        protocol,
+        findDt
+        FROM pr_controller_tramp
+        <where>
+            <if test="id != null and id !=''">
+                id = #{id,jdbcType=VARCHAR}
+            </if>
+            <if test="rtuAddr != null and rtuAddr != ''">
+                AND   rtuAddr = #{rtuAddr,jdbcType=VARCHAR}
+            </if>
+            <if test="protocol != null and protocol != ''">
+                AND  protocol = #{protocol,jdbcType=VARCHAR}
+            </if>
+
+        </where>
+    </select>
+    <!--    鏍规嵁鏉′欢鑾峰彇娴佹氮鎺у埗鍣ㄦ暟閲�-->
+    <select id="getTrampControllersCount" resultType="java.lang.Long">
+        select
+        COUNT(*) AS recordCount
+        FROM pr_controller_tramp
+        <where>
+            <if test="id != null and id !=''">
+                  id = #{id,jdbcType=VARCHAR}
+            </if>
+            <if test="rtuAddr != null and rtuAddr != ''">
+                AND   rtuAddr = #{rtuAddr,jdbcType=VARCHAR}
+            </if>
+            <if test="protocol != null and protocol != ''">
+                AND  protocol = #{protocol,jdbcType=VARCHAR}
+            </if>
+
+        </where>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0