From 80a4c2dee40aa6ed9ee750ebc431c0b4a3d8758f Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 16 一月 2024 16:08:12 +0800
Subject: [PATCH] 2024-01-16 朱宝民 重构流浪控制器表和控制器表

---
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java                     |   11 +
 /dev/null                                                                                                         |   24 ----
 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/rtuData/p206V1_0_0/TkPreGenObjs.java |   11 +-
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerTrampMapper.java                |    4 
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java   |   20 ++-
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java                            |   11 -
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml                               |   12 +-
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrControllerTramp.java                     |   11 +
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java                          |   26 ++--
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml                                    |  119 ++++++++++-------------
 10 files changed, 114 insertions(+), 135 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java
index 59d64ac..09f9ae0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerMapper.java
@@ -45,11 +45,18 @@
     List<VoController> getControllers(Map<?, ?> params);
 
     /**
-     * 鏍规嵁鎺у埗鍣ㄥ湴鍧�鑾峰彇鎺у埗鍣ㄥ垪琛�
+     * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨帶鍒跺櫒鍒楄〃
      * @param rtuAddr
      * @return
      */
-    List<Map<String, Object>> getControllersByAddr(@Param("rtuAddr") String rtuAddr);
+    List<Map<String, Object>> getControllersByCode(@Param("rtuAddr") String rtuAddr);
+
+    /**
+     * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨帶鍒跺櫒鍒楄〃
+     * @param rtuAddr
+     * @return
+     */
+    List<PrController> getControllersByRtuAddr(@Param("rtuAddr") String rtuAddr);
 
     /**
      * 鏍规嵁鎺у埗鍣ㄧ紪鍙烽�昏緫鍒犻櫎鎺у埗
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerTrampMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerTrampMapper.java
index 9e86073..61ef71d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerTrampMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrControllerTrampMapper.java
@@ -11,7 +11,7 @@
  * @Date 2024/1/15 15:27
  * @LastEditTime 2024/1/15 15:27
  * @Description
- */   
+ */
 @Mapper
 public interface PrControllerTrampMapper extends BaseMapper<PrControllerTramp> {
     /**
@@ -47,7 +47,7 @@
      * @param rutAddr 鎺у埗鍣ㄥ湴鍧�
      * @return object by 鎺у埗鍣ㄥ湴鍧�
      */
-    List<PrControllerTramp> selectPrControllerTrampByRtuAddr(String rutAddr);
+    List<PrControllerTramp> getPrControllerTrampByRtuAddr(String rutAddr);
 
     /**
      * update record selective
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java
index ed77806..0000ebb 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrController.java
@@ -8,6 +8,7 @@
 import com.dy.common.po.BaseEntity;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.*;
 import org.hibernate.validator.constraints.Length;
 
@@ -43,12 +44,19 @@
     private Long id;
 
     /**
+     * 鍙栨按鍙D
+     */
+    @Schema(description = "鍙栨按鍙D", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "鍙栨按鍙D涓嶈兘涓虹┖")
+    private Long intakeId;
+
+    /**
      * 鎺у埗鍣ㄥ湴鍧�
      */
     @Schema(description = "鎺у埗鍣ㄥ湴鍧�", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotBlank(message = "鎺у埗鍣ㄥ湴鍧�涓嶈兘涓虹┖")
     @Length(message = "鎺у埗鍣ㄥ湴鍧�涓嶅ぇ浜巤max}瀛�",max = 11)
-    private String rtuaddr;
+    private String rtuAddr;
 
     /**
      * 閫氳鍗忚
@@ -59,22 +67,16 @@
     private String protocol;
 
     /**
-     * 鍦ㄧ嚎鐘舵��;1-鍦ㄧ嚎锛�2-绂荤嚎
+     * 鍙戠幇鏃ユ湡鏃堕棿
      */
-    @Schema(description = "鍦ㄧ嚎鐘舵��", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Byte onlinestate;
-
-    /**
-     * 鏈�杩戜笂鎶ユ椂闂�
-     */
-    @Schema(description = "鏈�杩戜笂鎶ユ椂闂�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Date reporttime;
+    @Schema(description = "鍙戠幇鏃ユ湡鏃堕棿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+    private Date findDt;
 
     /**
      * 娣诲姞鏂瑰紡;1-绯荤粺鑷姩锛�2-鎵嬪姩
      */
     @Schema(description = "娣诲姞鏂瑰紡", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Byte addways;
+    private Byte addWays;
 
     /**
      * 鎿嶄綔浜篒D
@@ -86,7 +88,7 @@
      * 鎿嶄綔鏃堕棿
      */
     @Schema(description = "鎿嶄綔鏃堕棿", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Date operatedt;
+    private Date operateDt;
 
     /**
      * 閫昏緫鍒犻櫎鏍囪瘑;0-鏈垹闄わ紝1-鍒犻櫎
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrControllerTramp.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrControllerTramp.java
index 05ac965..02e942e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrControllerTramp.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrControllerTramp.java
@@ -15,8 +15,11 @@
 import com.dy.common.po.BaseEntity;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.*;
 import org.hibernate.validator.constraints.Length;
+
+import java.util.Date;
 
 /**
  * 娴佹氮鎺у埗鍣�
@@ -39,7 +42,7 @@
     public Long id;
 
     /**
-     * 閫氳鍗忚
+     * 鎺у埗鍣ㄥ湴鍧�
      */
     @Schema(description = "鎺у埗鍣ㄥ湴鍧�", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotBlank(message = "鎺у埗鍣ㄥ湴鍧�涓嶈兘涓虹┖")
@@ -55,10 +58,10 @@
     public String protocol;
 
     /**
-     * 閫氳鍗忚
+     * 鍙戠幇鏃堕棿
      */
     @Schema(description = "鍙戠幇鏃堕棿", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotBlank(message = "鍙戠幇鏃堕棿涓嶈兘涓虹┖")
-    public String findDt;//鍙戠幇鏃堕棿锛� yyyy-mm-dd HH:MM:SS锛�
+    @NotNull(message = "鍙戠幇鏃堕棿涓嶈兘涓虹┖")
+    public Date findDt;//鍙戠幇鏃堕棿锛� yyyy-mm-dd HH:MM:SS锛�
 
 }
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java
index 2a35b3c..cdc8a43 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoController.java
@@ -32,11 +32,6 @@
     @ColumnWidth(15)
     private String rtuAddr;
 
-    @Schema(title = "鍦ㄧ嚎鐘舵��")
-    @ExcelProperty("鍦ㄧ嚎鐘舵��")
-    @ColumnWidth(15)
-    private String onlineState;
-
     @Schema(title = "缁戝畾鍙栨按鍙�")
     @ExcelProperty("缁戝畾鍙栨按鍙�")
     @ColumnWidth(10)
@@ -49,8 +44,8 @@
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @Schema(title = "鏈�杩戜笂鎶ユ椂闂�")
-    @ExcelProperty("鏈�杩戜笂鎶ユ椂闂�")
+    @Schema(title = "鍙戠幇鏃ユ湡鏃堕棿")
+    @ExcelProperty("鍙戠幇鏃ユ湡鏃堕棿")
     @ColumnWidth(30)
-    private Date reportTime;
+    private Date findDt;
 }
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
index 5c5ef10..9227924 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
@@ -5,18 +5,18 @@
     <!--@mbg.generated-->
     <!--@Table pr_controller-->
     <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="rtuAddr" jdbcType="VARCHAR" property="rtuaddr" />
+    <result column="intakeId" jdbcType="BIGINT" property="intakeId" />
+    <result column="rtuAddr" jdbcType="VARCHAR" property="rtuAddr" />
     <result column="protocol" jdbcType="VARCHAR" property="protocol" />
-    <result column="onlineState" jdbcType="TINYINT" property="onlinestate" />
-    <result column="reportTime" jdbcType="TIMESTAMP" property="reporttime" />
-    <result column="addWays" jdbcType="TINYINT" property="addways" />
+    <result column="findDt" jdbcType="TIMESTAMP" property="findDt" />
+    <result column="addWays" jdbcType="TINYINT" property="addWays" />
     <result column="operator" jdbcType="BIGINT" property="operator" />
-    <result column="operateDt" jdbcType="TIMESTAMP" property="operatedt" />
+    <result column="operateDt" jdbcType="TIMESTAMP" property="operateDt" />
     <result column="deleted" jdbcType="TINYINT" property="deleted" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, rtuAddr, protocol, onlineState, reportTime, addWays, `operator`, operateDt, deleted
+    id, intakeId, rtuAddr, protocol, findDt, addWays, `operator`, operateDt, deleted
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -32,13 +32,13 @@
   </delete>
   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
     <!--@mbg.generated-->
-    insert into pr_controller (id, rtuAddr, protocol, 
-      onlineState, reportTime, addWays, 
+    insert into pr_controller (id, intakeId, rtuAddr, 
+      protocol, findDt, addWays, 
       `operator`, operateDt, deleted
       )
-    values (#{id,jdbcType=BIGINT}, #{rtuaddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}, 
-      #{onlinestate,jdbcType=TINYINT}, #{reporttime,jdbcType=TIMESTAMP}, #{addways,jdbcType=TINYINT}, 
-      #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}, #{deleted,jdbcType=TINYINT}
+    values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR},
+      #{protocol,jdbcType=VARCHAR}, #{findDt,jdbcType=TIMESTAMP}, #{addWays,jdbcType=TINYINT},
+      #{operator,jdbcType=BIGINT}, #{operateDt,jdbcType=TIMESTAMP}, #{deleted,jdbcType=TINYINT}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
@@ -48,25 +48,25 @@
       <if test="id != null">
         id,
       </if>
-      <if test="rtuaddr != null">
+      <if test="intakeId != null">
+        intakeId,
+      </if>
+      <if test="rtuAddr != null">
         rtuAddr,
       </if>
       <if test="protocol != null">
         protocol,
       </if>
-      <if test="onlinestate != null">
-        onlineState,
+      <if test="findDt != null">
+        findDt,
       </if>
-      <if test="reporttime != null">
-        reportTime,
-      </if>
-      <if test="addways != null">
+      <if test="addWays != null">
         addWays,
       </if>
       <if test="operator != null">
         `operator`,
       </if>
-      <if test="operatedt != null">
+      <if test="operateDt != null">
         operateDt,
       </if>
       <if test="deleted != null">
@@ -77,26 +77,26 @@
       <if test="id != null">
         #{id,jdbcType=BIGINT},
       </if>
-      <if test="rtuaddr != null">
-        #{rtuaddr,jdbcType=VARCHAR},
+      <if test="intakeId != null">
+        #{intakeId,jdbcType=BIGINT},
+      </if>
+      <if test="rtuAddr != null">
+        #{rtuAddr,jdbcType=VARCHAR},
       </if>
       <if test="protocol != null">
         #{protocol,jdbcType=VARCHAR},
       </if>
-      <if test="onlinestate != null">
-        #{onlinestate,jdbcType=TINYINT},
+      <if test="findDt != null">
+        #{findDt,jdbcType=TIMESTAMP},
       </if>
-      <if test="reporttime != null">
-        #{reporttime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="addways != null">
-        #{addways,jdbcType=TINYINT},
+      <if test="addWays != null">
+        #{addWays,jdbcType=TINYINT},
       </if>
       <if test="operator != null">
         #{operator,jdbcType=BIGINT},
       </if>
-      <if test="operatedt != null">
-        #{operatedt,jdbcType=TIMESTAMP},
+      <if test="operateDt != null">
+        #{operateDt,jdbcType=TIMESTAMP},
       </if>
       <if test="deleted != null">
         #{deleted,jdbcType=TINYINT},
@@ -107,26 +107,26 @@
     <!--@mbg.generated-->
     update pr_controller
     <set>
-      <if test="rtuaddr != null">
-        rtuAddr = #{rtuaddr,jdbcType=VARCHAR},
+      <if test="intakeId != null">
+        intakeId = #{intakeId,jdbcType=BIGINT},
+      </if>
+      <if test="rtuAddr != null">
+        rtuAddr = #{rtuAddr,jdbcType=VARCHAR},
       </if>
       <if test="protocol != null">
         protocol = #{protocol,jdbcType=VARCHAR},
       </if>
-      <if test="onlinestate != null">
-        onlineState = #{onlinestate,jdbcType=TINYINT},
+      <if test="findDt != null">
+        findDt = #{findDt,jdbcType=TIMESTAMP},
       </if>
-      <if test="reporttime != null">
-        reportTime = #{reporttime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="addways != null">
-        addWays = #{addways,jdbcType=TINYINT},
+      <if test="addWays != null">
+        addWays = #{addWays,jdbcType=TINYINT},
       </if>
       <if test="operator != null">
         `operator` = #{operator,jdbcType=BIGINT},
       </if>
-      <if test="operatedt != null">
-        operateDt = #{operatedt,jdbcType=TIMESTAMP},
+      <if test="operateDt != null">
+        operateDt = #{operateDt,jdbcType=TIMESTAMP},
       </if>
       <if test="deleted != null">
         deleted = #{deleted,jdbcType=TINYINT},
@@ -137,26 +137,27 @@
   <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoPr.PrController">
     <!--@mbg.generated-->
     update pr_controller
-    set rtuAddr = #{rtuaddr,jdbcType=VARCHAR},
+    set intakeId = #{intakeId,jdbcType=BIGINT},
+      rtuAddr = #{rtuAddr,jdbcType=VARCHAR},
       protocol = #{protocol,jdbcType=VARCHAR},
-      onlineState = #{onlinestate,jdbcType=TINYINT},
-      reportTime = #{reporttime,jdbcType=TIMESTAMP},
-      addWays = #{addways,jdbcType=TINYINT},
+      findDt = #{findDt,jdbcType=TIMESTAMP},
+      addWays = #{addWays,jdbcType=TINYINT},
       `operator` = #{operator,jdbcType=BIGINT},
-      operateDt = #{operatedt,jdbcType=TIMESTAMP},
+      operateDt = #{operateDt,jdbcType=TIMESTAMP},
       deleted = #{deleted,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
 
-  <!--鏍规嵁鎸囧畾鑾峰彇鎺у埗鍣ㄨ褰曟暟-->
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄨ褰曟暟-->
   <select id="getRecordCount" resultType="java.lang.Long">
     SELECT
         COUNT(*) AS recordCount
     FROM pr_controller con
         INNER JOIN pr_intake_controller ic ON ic.controllerId = con.id
-        INNER JOIN pr_intake inta ON ic.intakeId = inta.id
+        INNER JOIN pr_intake inta ON con.intakeId = inta.id
     <where>
       AND ic.operateType = 1
+      AND deleted = 0
 
       <if test = "id != null and id > 0">
         AND con.id = ${id}
@@ -164,10 +165,6 @@
 
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND con.rtuAddr like CONCAT('%',#{rtuAddr},'%')
-      </if>
-
-      <if test = "onlineState != null and onlineState > 0">
-        AND con.onlineState = ${onlineState}
       </if>
 
       <if test = "bindNumber != null and bindNumber > 0">
@@ -176,22 +173,19 @@
     </where>
   </select>
 
-  <!--鏍规嵁鎸囧畾鑾峰彇鎺у埗鍣ㄨ褰�-->
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄨ褰�-->
   <select id="getControllers" resultType="com.dy.pipIrrGlobal.voPr.VoController">
     SELECT
         con.rtuAddr AS rtuAddr,
-        (CASE
-            WHEN con.onlineState = 1 THEN "鍦ㄧ嚎"
-            WHEN con.onlineState = 2 THEN "绂荤嚎"
-        END) AS onlineState,
         inta.name AS intakeName,
         (SELECT COUNT(*) FROM pr_intake_controller WHERE controllerId = con.id AND intakeId = inta.id AND operateType = 1) AS bindNumber,
-        con.reportTime
+        con.findDt
     FROM pr_controller con
         INNER JOIN pr_intake_controller ic ON ic.controllerId = con.id
-        INNER JOIN pr_intake inta ON ic.intakeId = inta.id
+        INNER JOIN pr_intake inta ON con.intakeId = inta.id
     <where>
       AND ic.operateType = 1
+      AND deleted = 0
 
       <if test = "id != null and id > 0">
         AND con.id = ${id}
@@ -199,10 +193,6 @@
 
       <if test = "rtuAddr != null and rtuAddr !=''">
         AND con.rtuAddr like CONCAT('%',#{rtuAddr},'%')
-      </if>
-
-      <if test = "onlineState != null and onlineState > 0">
-        AND con.onlineState = ${onlineState}
       </if>
 
       <if test = "bindNumber != null and bindNumber > 0">
@@ -213,12 +203,11 @@
     <if test="pageCurr != null and pageSize != null">
       LIMIT ${pageCurr}, ${pageSize}
     </if>
-
   </select>
 
   <!--鏍规嵁鎺у埗鍣ㄥ湴鍧�鑾峰彇鎺у埗鍣ㄥ垪琛�-->
   <select id="getControllersByAddr" resultType="java.util.Map">
-    SELECT id, rtuAddr FROM pr_controller WHERE rtuAddr LIKE CONCAT('%',#{rtuAddr},'%')
+    SELECT id, rtuAddr FROM pr_controller WHERE deleted = 0 AND rtuAddr LIKE CONCAT('%',#{rtuAddr},'%')
   </select>
 
   <!--鏍规嵁鎺у埗鍣ㄧ紪鍙烽�昏緫鍒犻櫎鎺у埗-->
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 029d01a..f3830e0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerTrampMapper.xml
@@ -7,7 +7,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="rtuAddr" jdbcType="VARCHAR" property="rtuAddr" />
     <result column="protocol" jdbcType="VARCHAR" property="protocol" />
-    <result column="findDt" jdbcType="VARCHAR" property="findDt" />
+    <result column="findDt" jdbcType="TIMESTAMP" property="findDt" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
@@ -20,6 +20,7 @@
     from pr_controller_tramp
     where id = #{id,jdbcType=BIGINT}
   </select>
+
   <select id="selectPrControllerTrampByRtuAddr" parameterType="java.lang.String" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     select
@@ -27,6 +28,7 @@
     from pr_controller_tramp
     where rtuAddr = #{rtuAddr,jdbcType=VARCHAR}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     delete from pr_controller_tramp
@@ -37,7 +39,7 @@
     insert into pr_controller_tramp (id, rtuAddr, protocol, 
       findDt)
     values (#{id,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR},
-      #{findDt,jdbcType=VARCHAR})
+      #{findDt,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrControllerTramp">
     <!--@mbg.generated-->
@@ -67,7 +69,7 @@
         #{protocol,jdbcType=VARCHAR},
       </if>
       <if test="findDt != null">
-        #{findDt,jdbcType=VARCHAR},
+        #{findDt,jdbcType=TIMESTAMP},
       </if>
     </trim>
   </insert>
@@ -82,7 +84,7 @@
         protocol = #{protocol,jdbcType=VARCHAR},
       </if>
       <if test="findDt != null">
-        findDt = #{findDt,jdbcType=VARCHAR},
+        findDt = #{findDt,jdbcType=TIMESTAMP},
       </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
@@ -92,7 +94,7 @@
     update pr_controller_tramp
     set rtuAddr = #{rtuAddr,jdbcType=VARCHAR},
       protocol = #{protocol,jdbcType=VARCHAR},
-      findDt = #{findDt,jdbcType=VARCHAR}
+      findDt = #{findDt,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/rtuData/p206V1_0_0/TkPreGenObjs.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/rtuData/p206V1_0_0/TkPreGenObjs.java
index a4771a6..a8b3f16 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/rtuData/p206V1_0_0/TkPreGenObjs.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/rtuData/p206V1_0_0/TkPreGenObjs.java
@@ -4,7 +4,6 @@
 import com.dy.aceMw.server.rtuData.dbSv.DbSv;
 import com.dy.common.mw.protocol.Data;
 import com.dy.common.springUtil.SpringContextUtil;
-import com.dy.common.util.DateTime;
 import com.dy.pipIrrGlobal.pojoPr.PrController;
 import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp;
 import org.apache.logging.log4j.LogManager;
@@ -32,11 +31,11 @@
 				//鏁版嵁搴撲腑鏈煡璇㈠埌鎺у埗鍣紙RTU瀹炰綋锛�
 				//娴佹氮鑰呮帶鍒跺櫒
 				PrControllerTramp rtuTramp = sv.getPrControllerTrampByRtuAddr(rtuAddr);
-				if(rtuTramp == null){
-					rtuTramp = new PrControllerTramp(null, rtuAddr, d.getProtocol(), DateTime.yyyy_MM_dd_HH_mm_ss()) ;
-					this.taskResult = new Object[]{sv, null, rtuTramp} ;
-					this.toNextOneTask(data, TkDealControllerTramp.taskId);
-				}
+				//if(rtuTramp == null){
+				//	rtuTramp = new PrControllerTramp(null, rtuAddr, d.getProtocol(), DateTime.yyyy_MM_dd_HH_mm_ss()) ;
+				//	this.taskResult = new Object[]{sv, null, rtuTramp} ;
+				//	this.toNextOneTask(data, TkDealControllerTramp.taskId);
+				//}
 			}
 			//涓嶈鏄惁涓烘祦娴帶鍒跺櫒锛圧TU瀹炰綋锛夛紝閮借杩涜涓嬫宸ヤ綔
 			this.taskResult = new Object[]{sv, controller, null} ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java
index 0eab6fc..6002806 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerCtrl.java
@@ -81,7 +81,7 @@
 
     /**
      * 鏍规嵁鎺у埗鍣ㄧ紪鍙疯幏鍙栨帶鍒跺櫒鍒楄〃
-     * @param controllerCode 鎺у埗鍣ㄧ紪鍙�
+     * @param rtuAddr 鎺у埗鍣ㄥ湴鍧�
      * @return 绗﹀悎鏉′欢鐨勬帶鍒跺櫒鍒楄〃
      */
     @Operation(summary = "鑾峰緱鎺у埗鍣ㄨ褰�", description = "杩斿洖鍙栨帶鍒跺櫒鏁版嵁")
@@ -126,17 +126,23 @@
     @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
     @Transactional(rollbackFor = Exception.class)
     @SsoAop()
-    public BaseResponse<Boolean> add(@RequestBody @Valid DtoController po, BindingResult bindingResult){
+    //public BaseResponse<Boolean> add(@RequestBody @Valid DtoController po, BindingResult bindingResult){
+    public BaseResponse<Boolean> add(@RequestBody @Valid PrController po, BindingResult bindingResult){
         if(bindingResult != null && bindingResult.hasErrors()){
             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
 
-        PrController prController = DtoToPojo.INSTANCT.po2vo(po);
+        //PrController prController = DtoToPojo.INSTANCT.po2vo(po);
+        //Date operateTime = new Date();
+        //prController.setOperatedt(operateTime);
+        //prController.setDeleted((byte)0);
+        //prController.setReporttime(operateTime);
+
         Date operateTime = new Date();
-        prController.setOperatedt(operateTime);
-        prController.setDeleted((byte)0);
-        prController.setReporttime(operateTime);
-        Integer rec = Optional.ofNullable(controllerSv.addController(prController)).orElse(0);
+        po.setOperateDt(operateTime);
+        po.setDeleted((byte)0);
+        po.setFindDt(operateTime);
+        Integer rec = Optional.ofNullable(controllerSv.addController(po)).orElse(0);
         if(rec == 0) {
             return BaseResponseUtils.buildFail(ProjectResultCode.CONTROLLER_FAIL.getMessage());
         }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoController.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoController.java
deleted file mode 100644
index b698813..0000000
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoController.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.dy.pipIrrProject.controller;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import jakarta.validation.constraints.NotBlank;
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-/**
- * @author ZhuBaoMin
- * @date 2024-01-02 16:36
- * @LastEditTime 2024-01-02 16:36
- * @Description
- */
-
-@Data
-@Schema(name = "鎺у埗鍣ㄤ紶鍏ュ璞�")
-public class DtoController {
-    public static final long serialVersionUID = 1L;
-
-    /**
-     * 鎺у埗鍣ㄥ湴鍧�
-     */
-    @Schema(description = "鎺у埗鍣ㄥ湴鍧�", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotBlank(message = "鎺у埗鍣ㄥ湴鍧�涓嶈兘涓虹┖")
-    @Length(message = "鎺у埗鍣ㄥ湴鍧�涓嶅ぇ浜巤max}瀛�",max = 11)
-    private String rtuAddr;
-
-    /**
-     * 閫氳鍗忚
-     */
-    @Schema(description = "閫氳鍗忚", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotBlank(message = "閫氳鍗忚涓嶈兘涓虹┖")
-    @Length(message = "閫氳鍗忚涓嶅ぇ浜巤max}瀛�",max = 25)
-    private String protocol;
-
-    /**
-     * 鍦ㄧ嚎鐘舵��
-     */
-    @Schema(description = "鍦ㄧ嚎鐘舵��", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Byte onlineState;
-
-    /**
-     * 娣诲姞鏂瑰紡;1-绯荤粺鑷姩锛�2-鎵嬪姩
-     */
-    @Schema(description = "娣诲姞鏂瑰紡", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Byte addWays;
-
-    /**
-     * 鎿嶄綔浜虹紪鍙�
-     */
-    @Schema(description = "鎿嶄綔浜虹紪鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
-    private Long operator;
-}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoToPojo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoToPojo.java
deleted file mode 100644
index 554a3fb..0000000
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/DtoToPojo.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.dy.pipIrrProject.controller;
-
-import com.dy.pipIrrGlobal.pojoPr.PrController;
-import org.mapstruct.Mapper;
-import org.mapstruct.Mapping;
-import org.mapstruct.factory.Mappers;
-
-/**
- * @author ZhuBaoMin
- * @date 2024-01-02 16:39
- * @LastEditTime 2024-01-02 16:39
- * @Description
- */
-
-@Mapper
-public interface DtoToPojo {
-    DtoToPojo INSTANCT = Mappers.getMapper(DtoToPojo.class);
-    @Mapping(target = "rtuaddr", source = "rtuAddr")
-    @Mapping(target = "protocol", source = "protocol")
-    @Mapping(target = "onlinestate", source = "onlineState")
-    @Mapping(target = "addways", source = "addWays")
-    @Mapping(target = "operator", source = "operator")
-    PrController po2vo(DtoController po);
-}

--
Gitblit v1.8.0