From e6e651093281dc4030e7b189109ea8172ab6cda2 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期四, 27 六月 2024 16:10:09 +0800 Subject: [PATCH] 查询 取水口查询接口 控制器delete=0 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 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 920ffce..939f3f1 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml @@ -224,6 +224,7 @@ ge.deleted = 0 AND divi.deleted = 0 and blo.deleted = 0 + and cont.deleted = 0 <if test="intakeName != null and intakeName != ''"> AND ge.name LIKE CONCAT('%', #{intakeName}, '%') </if> @@ -283,6 +284,7 @@ ge.deleted = 0 AND divi.deleted = 0 and blo.deleted = 0 + and cont.deleted = 0 <if test="intakeName != null and intakeName != ''"> AND ge.name LIKE CONCAT('%', #{intakeName}, '%') </if> @@ -364,7 +366,7 @@ COUNT(*) AS recordCount FROM pr_controller con INNER JOIN pr_intake inta ON con.intakeId = inta.id - INNER JOIN JSON_TABLE( + left JOIN JSON_TABLE( <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> #{onLineMap}, '$[*]' COLUMNS( @@ -391,7 +393,7 @@ rtus.isOnLine FROM pr_controller con INNER JOIN pr_intake inta ON con.intakeId = inta.id - INNER JOIN JSON_TABLE( + left JOIN JSON_TABLE( <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> #{onLineMap}, '$[*]' COLUMNS( @@ -407,8 +409,34 @@ AND inta.name LIKE CONCAT('%', #{intakeNum}, '%') </if> </where> + order by con.id ASC <if test="pageCurr != null and pageSize != null"> LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} </if> </select> + + <!--鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛--> + <select id="getUsedIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> + SELECT + DISTINCT con.intakeId, + con.rtuAddr, + inta.name AS intakeNum, + rtus.isOnLine + FROM pr_controller con + INNER JOIN pr_intake inta ON con.intakeId = inta.id + INNER JOIN rm_command_history com ON con.rtuAddr = com.rtu_addr + INNER 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 + <where> + <if test="operator != null"> + com.operator = #{operator} + </if> + </where> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0