From 7a00187d197548e23a38dcb87187ef6b2b7f8bfb Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期一, 24 十月 2022 11:19:58 +0800
Subject: [PATCH] changes
---
dao/src/main/resources/mapper/AirEquipmentMapper.xml | 67 +++++++++++++++++----------------
1 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/dao/src/main/resources/mapper/AirEquipmentMapper.xml b/dao/src/main/resources/mapper/AirEquipmentMapper.xml
index 485d81a..f403b64 100644
--- a/dao/src/main/resources/mapper/AirEquipmentMapper.xml
+++ b/dao/src/main/resources/mapper/AirEquipmentMapper.xml
@@ -6,37 +6,32 @@
<resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirEquipment">
<id property="id" column="id" jdbcType="BIGINT"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="mac" column="mac" jdbcType="VARCHAR"/>
+ <result property="airMac" column="air_mac" jdbcType="VARCHAR"/>
+ <result property="deviceType" column="device_type" jdbcType="VARCHAR"/>
+ <result property="moduleWarmUpStatusFlag" column="module_warm_up_status_flag" jdbcType="VARCHAR"/>
+ <result property="temperature" column="temperature" jdbcType="INTEGER"/>
+ <result property="humidity" column="humidity" jdbcType="INTEGER"/>
+ <result property="windSpeed" column="wind_speed" jdbcType="INTEGER"/>
+ <result property="windDirection" column="wind_direction" jdbcType="INTEGER"/>
+ <result property="windPower" column="wind_power" jdbcType="INTEGER"/>
+ <result property="pressure" column="pressure" jdbcType="INTEGER"/>
+ <result property="lightIntensity" column="light_intensity" jdbcType="INTEGER"/>
+ <result property="noise" column="noise" jdbcType="INTEGER"/>
+ <result property="pm25" column="pm25" jdbcType="INTEGER"/>
+ <result property="pm10" column="PM10" jdbcType="INTEGER"/>
+ <result property="tsp" column="tsp" jdbcType="INTEGER"/>
+ <result property="rain" column="rain" jdbcType="INTEGER"/>
+ <result property="so2" column="so2" jdbcType="INTEGER"/>
+ <result property="ech2o" column="ech2o" jdbcType="INTEGER"/>
+ <result property="no2" column="no2" jdbcType="INTEGER"/>
+ <result property="tvoc" column="tvoc" jdbcType="INTEGER"/>
+ <result property="co" column="co" jdbcType="INTEGER"/>
+ <result property="co2" column="co2" jdbcType="INTEGER"/>
+ <result property="o3" column="o3" jdbcType="INTEGER"/>
+ <result property="fluoride" column="fluoride" jdbcType="INTEGER"/>
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
-
- <sql id="Base_Column_List">
- id,belong_to,equipment_state,
- create_time,user_id,light_pole_id,
- mac
- </sql>
-
- <select id="listAirEquipmentId" resultType="java.lang.Long">
- SELECT
- MAX(t1.id) AS air_equipment_id
- FROM
- air_equipment t1
- <if test="keyword != null and keyword != ''">
- LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
- AND t2.device_type = 3
- LEFT JOIN pole t3 ON t3.id = t2.pole_id
- </if>
- <where>
- <if test="keyword != null and keyword != ''">
- AND t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
- </if>
- <if test="clientId != null">
- AND t3.client_id = #{clientId}
- </if>
- </where>
- GROUP BY
- t1.mac
- </select>
<select id="listAirEquipmentByIds" resultType="com.sandu.ximon.dao.bo.AirEquipmentBo">
SELECT
@@ -48,10 +43,16 @@
AND t2.device_type = 3
LEFT JOIN pole t3 ON t3.id = t2.pole_id
<where>
- t1.id IN
- <foreach collection="airEquipmentIdList" open="(" close=")" item="airId" separator=",">
- #{airId}
- </foreach>
+ <if test="keyword != null and keyword != ''">
+ AND (
+ t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ or t1.mac LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+ )
+ </if>
+ <if test="userid != null">
+ AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
+ </if>
</where>
</select>
+
</mapper>
--
Gitblit v1.9.3