From 602c6e68101e88d275fe7313495c2009386c1965 Mon Sep 17 00:00:00 2001
From: VVT789 <sdxt_0802@163.com>
Date: 星期三, 12 二月 2025 14:04:07 +0800
Subject: [PATCH] 电能质量分析--负荷分析数据获取获取实时数据修改

---
 zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml b/zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml
index 3ea43ac..78d0144 100644
--- a/zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml
+++ b/zhitan-system/src/main/resources/mapper/model/EnergyIndexMapper.xml
@@ -391,4 +391,21 @@
         </if>
     </where>
   </select>
+  <select id="getIndexByMeterIdIndexCode" resultType="com.zhitan.model.domain.EnergyIndex">
+    SELECT ei.code,mi.meter_name||'_'||ei.name as name from energy_index ei
+    LEFT JOIN node_device nd on ei.meter_id =  nd.device_id
+    LEFT JOIN meter_implement  mi on mi."id" = nd.device_id
+    <where>
+        <if test="nodeId != null  and nodeId != ''">and nd.node_id  = #{nodeId}</if>
+        <if test="indexCode != null  and indexCode != ''">
+          and (mi.meter_name like concat('%', #{indexCode}, '%')
+          or ei.code like concat('%', #{indexCode}, '%')
+          or ei.name like concat('%', #{indexCode}, '%')
+          )
+        </if>
+        <if test="meterId != null  and meterId != ''">
+          and ei.meter_id = #{meterId}
+        </if>
+    </where>
+  </select>
 </mapper>

--
Gitblit v1.9.3