| | |
| | | <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="DECIMAL"/> |
| | | <result property="hydrogenSulfide" column="hydrogen_sulfide" jdbcType="DECIMAL"/> |
| | | <result property="so2" column="so2" jdbcType="DECIMAL"/> |
| | | <result property="no2" column="no2" jdbcType="DECIMAL"/> |
| | | <result property="co" column="co" jdbcType="DECIMAL"/> |
| | | <result property="o3" column="o3" jdbcType="DECIMAL"/> |
| | | <result property="pm2point5" column="pm2point5" jdbcType="DECIMAL"/> |
| | | <result property="pm10" column="pm10" jdbcType="DECIMAL"/> |
| | | <result property="airTemperature" column="air_temperature" jdbcType="DECIMAL"/> |
| | | <result property="airHumidity" column="air_humidity" jdbcType="DECIMAL"/> |
| | | <result property="airPressure" column="air_pressure" jdbcType="DECIMAL"/> |
| | | <result property="windDirection" column="wind_direction" jdbcType="DECIMAL"/> |
| | | <result property="windSpeed" column="wind_speed" jdbcType="DECIMAL"/> |
| | | <result property="tenRainfallMin" column="ten_rainfall_min" jdbcType="DECIMAL"/> |
| | | <result property="radiation" column="radiation" jdbcType="DECIMAL"/> |
| | | <result property="illumination" column="illumination" jdbcType="DECIMAL"/> |
| | | <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, |
| | | 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, |
| | | create_time |
| | | ultraviolet,co2,o2, |
| | | type,create_time |
| | | </sql> |
| | | <select id="listAirId" resultType="java.lang.Long"> |
| | | SELECT |
| | | 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}), '%') |
| | | 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}) |
| | |
| | | </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> |