From 3b58972c757734f0dc4b1ff29a0a179ed564ab64 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 17 七月 2024 11:47:42 +0800
Subject: [PATCH] 2024-07-17 朱宝民 重构命令日志表,返回结果改为text类型
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml | 62 ++++++++++++++++++++++++++----
1 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
index dddf7e3..54809d4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -365,19 +365,19 @@
FROM pr_controller con
INNER JOIN pr_intake inta ON con.intakeId = inta.id
left JOIN JSON_TABLE(
- <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
- #{onLineMap},
- '$[*]' COLUMNS(
- rtuAddr VARCHAR(20) PATH '$.rtuAddr',
- isOnLine BOOLEAN PATH '$.isOnLine'
- )
- ) rtus ON con.rtuAddr = rtus.rtuAddr
+ <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
+ #{onLineMap},
+ '$[*]' COLUMNS(
+ rtuAddr VARCHAR(20) PATH '$.rtuAddr',
+ isOnLine BOOLEAN PATH '$.isOnLine'
+ )
+ ) rtus ON con.rtuAddr = rtus.rtuAddr
<where>
<if test="isOnLine != null">
rtus.isOnLine = #{isOnLine}
</if>
<if test="intakeNum != null and intakeNum != ''">
- AND inta.name LIKE CONCAT('%', #{intakeNum}, '%')
+ AND inta.name = #{intakeNum}
</if>
</where>
</select>
@@ -404,12 +404,38 @@
rtus.isOnLine = #{isOnLine}
</if>
<if test="intakeNum != null and intakeNum != ''">
- AND inta.name LIKE CONCAT('%', #{intakeNum}, '%')
+ AND inta.name = #{intakeNum}
</if>
</where>
+ order by con.id ASC
<if test="pageCurr != null and pageSize != null">
LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
</if>
+ </select>
+
+ <!--鏍规嵁鍙栨按鍙g紪鍙疯幏鍙栧彇姘村彛瀵硅薄-->
+ <select id="getIntakeByName" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake">
+ SELECT
+ con.intakeId,
+ con.rtuAddr,
+ inta.name AS intakeNum,
+ rtus.isOnLine
+ FROM pr_controller con
+ INNER JOIN pr_intake inta ON con.intakeId = inta.id
+ left JOIN JSON_TABLE(
+ #{onLineMap},
+ '$[*]' COLUMNS(
+ rtuAddr VARCHAR(20) PATH '$.rtuAddr',
+ isOnLine BOOLEAN PATH '$.isOnLine'
+ )
+ ) rtus ON con.rtuAddr = rtus.rtuAddr
+ <where>
+ <if test="intakeNum != null and intakeNum != ''">
+ AND LOWER(inta.name) = #{intakeNum}
+ </if>
+ </where>
+ LIMIT 0,1
+
</select>
<!--鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛-->
@@ -436,4 +462,22 @@
</if>
</where>
</select>
+
+ <!--鍙栨按鍙e悕绉版崲鍙栨按鍙D锛屾壂鐮佸紑闃�浣跨敤-->
+ <select id="getIntakeIdByName" resultType="java.lang.Long">
+ SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName}
+ </select>
+
+ <!--鍙栨按鍙e悕绉版崲鍙栨按鍙D锛岄獙璇佹槸鍚﹂噸澶嶅悕绉颁娇鐢�-->
+ <select id="getIntakeIdsByName" resultType="java.lang.Long">
+ SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName}
+ </select>
+
+ <!--鍙栨按鍙e悕绉版崲鍙栨按鍙D锛岄獙璇佹槸鍚﹂噸澶嶅悕绉颁娇鐢�-->
+ <select id="getIntakeIdByNameExcludeId" resultType="java.lang.Long">
+ SELECT id AS intakeId FROM pr_intake WHERE id != #{id} and `name` = #{intakeName}
+ </select>
+
+
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0