| | |
| | | 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 |
| | |
| | | 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}) |
| | |
| | | </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> |