From 76772ff7d6217fd4d28973d3169fea74bb26f1e8 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Tue, 24 Nov 2020 14:36:06 +0800
Subject: [PATCH] PM2.5,PM10预测和实测对比
---
src/main/resources/mapper/SensorMapper.xml | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/SensorMapper.xml b/src/main/resources/mapper/SensorMapper.xml
index b50c240..74a078e 100644
--- a/src/main/resources/mapper/SensorMapper.xml
+++ b/src/main/resources/mapper/SensorMapper.xml
@@ -137,6 +137,15 @@
AND d.id = #{id}
</select>
+ <select id="getSensorByDId" resultType="java.util.Map">
+ SELECT DISTINCT d.monitor_point_id,s.*
+ FROM device d,device_version dv,device_version_sensor dvs,sensor s
+ WHERE d.device_version_id = dvs.device_version_id
+ AND dvs.sensor_id = s.id
+ AND d.id = #{id}
+ </select>
+
+
<select id="getSensorByMonitorPointId" resultType="java.util.Map">
SELECT DISTINCT s.sensor_key sensorKey,s.unit,s.name,s.description,s.id
FROM device d,device_version dv,device_version_sensor dvs,sensor s
@@ -174,4 +183,35 @@
AND d.mac = #{mac}
</if>
</select>
+
+ <select id="selectSenosrsByOrgId" resultMap="BaseResultMap">
+ select
+ distinct dvs.sensor_id as id,
+ s.name,s.sensor_key,s.unit,s.description
+ from
+ device_version_sensor dvs,
+ sensor s
+ where
+ dvs.device_version_id
+ in(
+ select
+ distinct d.device_version_id
+ from
+ device d
+ where
+ d.mac in
+ <foreach collection="macs" open="(" separator="," close=")"
+ item="mac">
+ #{mac}
+ </foreach>
+ )
+ and dvs.sensor_id=s.id
+ </select>
+
+ <select id="getSensorKeys" resultType="java.lang.String">
+ select
+ sensor_key
+ from
+ sensor
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0