From 0a30812acaa26ebe654340f7e749a6801b63b194 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 21 十月 2022 16:32:36 +0800
Subject: [PATCH] changes
---
dao/src/main/resources/mapper/AirDataNongGengMapper.xml | 81 +++++++++++++++++++++++++---------------
1 files changed, 51 insertions(+), 30 deletions(-)
diff --git a/dao/src/main/resources/mapper/AirDataNongGengMapper.xml b/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
index eedd950..38a703c 100644
--- a/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
+++ b/dao/src/main/resources/mapper/AirDataNongGengMapper.xml
@@ -5,39 +5,40 @@
<mapper namespace="com.sandu.ximon.dao.mapper.AirDataNongGengMapper">
<resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirDataNongGeng">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="mac" column="mac" jdbcType="VARCHAR"/>
- <result property="noise" column="noise" jdbcType="VARCHAR"/>
- <result property="voc" column="voc" jdbcType="VARCHAR"/>
- <result property="so2" column="so2" jdbcType="VARCHAR"/>
- <result property="no2" column="no2" jdbcType="VARCHAR"/>
- <result property="co" column="co" jdbcType="VARCHAR"/>
- <result property="co2" column="co2" jdbcType="VARCHAR"/>
- <result property="o3" column="o3" jdbcType="VARCHAR"/>
- <result property="pm2point5" column="pm2point5" jdbcType="VARCHAR"/>
- <result property="pm10" column="pm10" jdbcType="VARCHAR"/>
- <result property="airTemperature" column="air_temperature" jdbcType="VARCHAR"/>
- <result property="airHumidity" column="air_humidity" jdbcType="VARCHAR"/>
- <result property="airPressure" column="air_pressure" jdbcType="VARCHAR"/>
- <result property="windDirection" column="wind_direction" jdbcType="VARCHAR"/>
- <result property="windSpeed" column="wind_speed" jdbcType="VARCHAR"/>
- <result property="rainfall" column="rainfall" jdbcType="VARCHAR"/>
- <result property="tippingBucketRainfall" column="tipping_bucket_rainfall" jdbcType="VARCHAR"/>
- <result property="illumination" column="illumination" jdbcType="VARCHAR"/>
- <result property="thermalRadiation" column="thermal_radiation" jdbcType="VARCHAR"/>
- <result property="ultravioletRay" column="ultraviolet_ray" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+ <id property="id" column="id" jdbcType="BIGINT"/>
+ <result property="mac" column="mac" jdbcType="VARCHAR"/>
+ <result property="noise" column="noise" jdbcType="VARCHAR"/>
+ <result property="hydrogenSulfide" column="hydrogen_sulfide" jdbcType="VARCHAR"/>
+ <result property="so2" column="so2" jdbcType="VARCHAR"/>
+ <result property="no2" column="no2" jdbcType="VARCHAR"/>
+ <result property="co" column="co" jdbcType="VARCHAR"/>
+ <result property="o3" column="o3" jdbcType="VARCHAR"/>
+ <result property="pm2point5" column="pm2point5" jdbcType="VARCHAR"/>
+ <result property="pm10" column="pm10" jdbcType="VARCHAR"/>
+ <result property="airTemperature" column="air_temperature" jdbcType="VARCHAR"/>
+ <result property="airHumidity" column="air_humidity" jdbcType="VARCHAR"/>
+ <result property="airPressure" column="air_pressure" jdbcType="VARCHAR"/>
+ <result property="windDirection" column="wind_direction" jdbcType="VARCHAR"/>
+ <result property="windSpeed" column="wind_speed" jdbcType="VARCHAR"/>
+ <result property="tenRainfallMin" column="ten_rainfall_min" jdbcType="VARCHAR"/>
+ <result property="radiation" column="radiation" jdbcType="VARCHAR"/>
+ <result property="illumination" column="illumination" jdbcType="VARCHAR"/>
+ <result property="ultraviolet" column="ultraviolet" jdbcType="VARCHAR"/>
+ <result property="co2" column="co2" jdbcType="VARCHAR"/>
+ <result property="o2" column="o2" jdbcType="VARCHAR"/>
+ <result property="type" column="type" jdbcType="VARCHAR"/>
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
- id,mac,noise,
- voc,so2,no2,
- co,co2,o3,
- pm2point5,pm10,air_temperature,
- air_humidity,air_pressure,wind_direction,
- wind_speed,rainfall,tipping_bucket_rainfall,
- illumination,thermal_radiation,ultraviolet_ray,
+ id
+ ,mac,noise,
+ hydrogen_sulfide,so2,no2,
+ co,o3,pm2point5,
+ pm10,air_temperature,air_humidity,
+ air_pressure,wind_direction,wind_speed,
+ ten_rainfall_min,radiation,illumination,
+ ultraviolet,co2,o2,
type,create_time
</sql>
<select id="listAirId" resultType="java.lang.Long">
@@ -45,14 +46,20 @@
MAX(t1.id) AS air_id
FROM
air_data_nong_geng t1
+ left join air_equipment_nong_geng t4 on t4.mac = t1.mac
<if test="keyword != null and keyword != ''">
LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
AND t2.device_type = 11
LEFT JOIN pole t3 ON t3.id = t2.pole_id
</if>
<where>
+ 1=1
<if test="keyword != null and keyword != ''">
AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ or t1.mac LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ </if>
+ <if test="type != null">
+ AND t4.type = #{type}
</if>
<if test="userid != null">
AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
@@ -77,5 +84,19 @@
</foreach>
</where>
</select>
+ <select id="historyData" resultType="com.sandu.ximon.dao.bo.AirDataNongGengBo"
+ parameterType="java.lang.String">
+ SELECT t1.*,
+ t3.id AS pole_id,
+ t3.pole_name
+ FROM air_data_nong_geng t1
+ LEFT JOIN air_equipment_nong_geng t4 ON t4.mac = t1.mac
+ LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
+ AND t2.device_type = 11
+ LEFT JOIN pole t3 ON t3.id = t2.pole_id
+ WHERE t1.mac = #{mac}
+ ORDER BY t1.id DESC
+
+ </select>
</mapper>
--
Gitblit v1.9.3