From c7c8554e2b9809bc90ac4a43fdaa39dfe16f4ab0 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 09 五月 2025 14:09:32 +0800 Subject: [PATCH] “远程测控”功能返回数据中增加protocol和protocolVersion属性,以备前端做多协议兼容。 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml | 81 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 78 insertions(+), 3 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 eb8e6de..73fcad0 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml @@ -50,13 +50,17 @@ ge.`operator`, ge.operateDt, blo.`name` AS blockName, - CONCAT(country.`name`, town.`name`, village.`name`) AS address + CONCAT(country.`name`, town.`name`, village.`name`) AS address, + con.id AS controllerId, + con.rtuAddr, + con.protocol FROM pr_intake ge INNER JOIN pr_divide divi ON ge.divideId = divi.id INNER JOIN ba_block blo ON divi.blockId = blo.id LEFT JOIN ba_district country ON ge.countyId = country.id LEFT JOIN ba_district town ON ge.townId = town.id LEFT JOIN ba_district village ON ge.villageId = village.id + INNER JOIN pr_controller con ON con.intakeId = ge.id where ge.id = #{id,jdbcType=BIGINT} AND ge.deleted = 0 AND divi.deleted = 0 @@ -378,7 +382,7 @@ AND bindNumTb.num = #{bindNumber} </if> </where> - ORDER BY ge.operateDt DESC + ORDER BY ge.divideId DESC, ge.id DESC <trim prefix="limit "> <if test="start != null and count != null"> #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} @@ -402,6 +406,13 @@ FROM pr_intake WHERE deleted = 0 AND id = #{intakeId} + </select> + + <!--鏍规嵁鏉慖D鑾峰彇鍏ㄩ儴鍦板潃--> + <select id="getNameById" resultType="java.lang.String"> + select name + from pr_intake + where id = #{intakeId, jdbcType=BIGINT} </select> <!--鏍规嵁鏉慖D鑾峰彇鍏ㄩ儴鍦板潃--> @@ -586,9 +597,12 @@ SELECT inta.id AS intakeId, con.rtuAddr, - inta.name AS intakeNum, + con.protocol, + con.protocol_version AS protocolVersion, + inta.name AS intakeNum, inta.lng, inta.lat, + IFNULL(hou.instant_amount, 0) AS instantAmount, IFNULL(hou.total_amount, 0) AS totalAmount, <if test="onLineMap != null and onLineMap !='' and isOnLine != null"> rtus.isOnLine, @@ -729,4 +743,65 @@ </set> where id = #{id,jdbcType=BIGINT} </update> + + <!--鑾峰彇鏈粦瀹氬埌杞亴缁勭殑鍙栨按鍙e垪琛�--> + <select id="getFreeIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple"> + SELECT + id AS intakeId, + name AS intakeName + FROM pr_intake inta + <where> + AND inta.deleted = 0 + AND NOT EXISTS (SELECT 1 FROM ir_group_intake gi WHERE gi.intake_id = inta.id) + <if test="intakeName != null and intakeName != ''"> + AND LOWER(inta.name) LIKE CONCAT('%', #{intakeName}, '%') + </if> + </where> + </select> + + <!--鑾峰彇鏈粦瀹氳櫄鎷熷崱鐨勫彇姘村彛鍒楄〃锛岀粰鍙栨按鍙g粦铏氭嫙鍗′娇鐢�--> + <select id="getNotLinkVcIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntakeSimple"> + SELECT + id AS intakeId, + name AS intakeName + FROM pr_intake inta + WHERE NOT EXISTS ( + SELECT 1 + FROM pr_intake_vc iv + WHERE iv.intake_id = inta.id + ) AND inta.deleted = 0 + </select> + + + + <!-- 涓簑echat,鏍规嵁鎸囧畾鍙栨按鍙e悕绉版ā绯婏紙鍚庣锛夋煡璇㈡按鍙h褰曟暟 --> + <select id="getSomeIntakesCount4Wx" parameterType="java.util.Map" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM pr_intake tb + <where> + tb.deleted = 0 + <if test="intakeNum != null and intakeNum != ''"> + AND tb.name LIKE CONCAT('%', #{intakeNum}) + </if> + </where> + </select> + + <!-- 涓簑echat,鏍规嵁鎸囧畾鍙栨按鍙e悕绉版ā绯婏紙鍚庣锛夋煡璇㈡按鍙h褰� --> + <select id="getSomeIntakes4Wx" parameterType="java.util.Map" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> + SELECT + inta.id AS intakeId, + con.rtuAddr, + inta.name AS intakeNum + FROM pr_intake inta + INNER JOIN pr_controller con ON con.intakeId = inta.id + <where> + inta.deleted = 0 + <if test="intakeNum != null and intakeNum != ''"> + AND inta.name LIKE CONCAT('%', #{intakeNum}) + </if> + </where> + ORDER BY inta.id DESC + </select> + + </mapper> \ No newline at end of file -- Gitblit v1.8.0