123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.welampiot.dao.EnvmonitorDao">
- <select id="getWeatherListByDTO" resultType="EnvmonitorDTO">
- select e.id,e.model as name,e.lamp_pole_id lampPoleId,e.address,e.netStatus,eil.illumination,e.netType,
- eil.updatetime as updateTime,e.install_date installDate,e.expiration_date expirationDate,s.timezone,
- lp.name as lampPoleName,eil.humidity,eil.temperature,eil.noise,eil.PM10,eil.PM25,eil.illumination,
- eil.windDire,eil.windSpeed,eil.updatetime,eil.rainfall,eil.radiation,eil.co,eil.co2,eil.tsp,eil.atmospressue
- from envmonitor e left join lamp_pole lp on e.lamp_pole_id = lp.id
- left join section s on e.section = s.id
- left join (SELECT t1.* FROM envmonitor_info_log t1
- INNER JOIN ( SELECT envmonitorid, MAX( updatetime ) AS maxDateTime FROM envmonitor_info_log GROUP BY envmonitorid ) t2
- ON t1.envmonitorid = t2.envmonitorid AND t1.updatetime = t2.maxDateTime) as eil on e.id = eil.envmonitorid
- where e.lamp_pole_id != 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <choose>
- <when test="online == 0">
- and e.netStatus = 0
- </when>
- <when test="online == 1">
- and e.netStatus = 1
- </when>
- </choose>
- order by convert(lp.number using gbk) asc,
- convert(e.model using gbk) asc,e.id desc
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <select id="getTotalBySectionList" resultType="Integer">
- select count(e.id) as total from envmonitor e
- left join lamp_pole lp on e.lamp_pole_id = lp.id
- <if test="sectionList != null and !sectionList.isEmpty()">
- where lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getOnlineTotalBySectionList" resultType="Integer">
- select count(e.id) as total from envmonitor e
- left join lamp_pole lp on e.lamp_pole_id = lp.id
- where e.netStatus = 1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and lp.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="getDetailByDTO" resultType="EnvmonitorDTO">
- select eil.illumination
- from envmonitor e
- left join (SELECT t1.* FROM envmonitor_info_log t1
- INNER JOIN ( SELECT envmonitorid, MAX( updatetime ) AS maxDateTime FROM envmonitor_info_log GROUP BY envmonitorid ) t2
- ON t1.envmonitorid = t2.envmonitorid AND t1.updatetime = t2.maxDateTime) as eil on e.id = eil.envmonitorid
- where e.lamp_pole_id != 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- limit 1
- </select>
- <update id="updateDataByEnvmonitorDTO" parameterType="EnvmonitorDTO">
- update
- envmonitor e
- set
- e.model = #{model},
- e.netType = #{netType},
- e.address = #{address}
- where e.id = #{id}
- </update>
- <select id="findDataByEnvmonitorDTO" resultType="Integer">
- select count(*)
- from envmonitor e
- where 1=1
- <if test="sectionId != null and sectionId != 0">
- and e.sectionid = #{sectionId}
- </if>
- <if test="model != null and model != ''">
- and e.model = #{model}
- </if>
- <if test="name != null and name != ''">
- and e.name = #{name}
- </if>
- <if test="address != null and address != ''">
- and e.address = #{address}
- </if>
- <if test="num != null and num != ''">
- and e.num = #{num}
- </if>
- <if test="number != null and number != ''">
- and e.number = #{number}
- </if>
- <if test="id != null and id != 0">
- and e.id != #{id}
- </if>
- <if test="lampPoleId != 0">
- and e.lamp_pole_id != 0
- </if>
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <select id="findSectionIdById" resultType="Integer">
- select e.sectionid as sectionId
- from envmonitor e
- where e.id = #{id}
- </select>
- <select id="getEnvmonitorListByDTO" resultType="com.welampiot.dto.EnvmonitorDTO">
- SELECT e.id,e.number,eil.humidity,eil.temperature,eil.noise,eil.PM10,eil.PM25,
- eil.illumination,eil.atmospressue,e.updatetime AS updateTime,s.timezone
- FROM envmonitor e
- LEFT JOIN section s ON e.section = s.id
- LEFT JOIN (SELECT t1.*
- FROM envmonitor_info_log t1
- INNER JOIN ( SELECT envmonitorid, MAX( updatetime ) AS maxDateTime
- FROM envmonitor_info_log
- GROUP BY envmonitorid ) t2
- ON t1.envmonitorid = t2.envmonitorid
- AND t1.updatetime = t2.maxDateTime)
- AS eil ON e.id = eil.envmonitorid
- WHERE e.lamp_pole_id != 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- </select>
- <update id="changeEnvmonitorLocationById" parameterType="EnvmonitorDTO">
- update
- envmonitor e
- set
- e.longitude = #{longitude},
- e.latitude = #{latitude}
- where e.id = #{id}
- </update>
- <select id="getEnvmonitorByLampPoleId" resultType="EnvmonitorDTO">
- select
- e.id,
- e.longitude,
- e.latitude,
- e.netType,
- e.model,
- e.num,
- e.address,
- e.importPra,
- e.sectionid as sectionId,
- e1.temperature,
- e1.humidity,
- e1.PM25,
- e1.PM10,
- e1.noise,
- e1.atmospressue,
- e1.illumination,
- e1.windSpeed,
- e1.windDire,
- e1.co2,
- e1.co,
- e1.tsp,
- e1.rainfall,
- e1.radiation,
- e1.updatetime as updateTime,
- n.protocoltype as protocolType
- from
- envmonitor e
- left join envmonitor_info_log e1 on e1.envmonitorid = e.id
- left join network n on e.networkid = n.id
- where
- e.lamp_pole_id = #{lampPoleId}
- limit 1
- </select>
- <delete id="deleteEnvmonitorById">
- delete
- from envmonitor
- where id = #{id};
- </delete>
- <select id="getLampPoleIdByEnvmonitorId" resultType="Integer">
- select e.lamp_pole_id
- from envmonitor e
- where e.id = #{id}
- </select>
- <update id="updateLampPoleEnvmonitorData" parameterType="EnvmonitorDTO">
- update envmonitor e
- set
- e.model = #{model},
- e.devType = #{devType},
- <if test="pramType != null">
- e.pramType = #{pramType},
- </if>
- <if test="installDate != null and installDate != ''">
- e.install_date = #{installDate},
- </if>
- <if test="expirationDate != null and expirationDate != ''">
- e.expiration_date = #{expirationDate},
- </if>
- e.rate = #{rate},
- e.netType = #{netType},
- e.mp = #{mp}
- where 1=1
- <if test="lampPoleId != null and lampPoleId != 0">
- and e.lamp_pole_id = #{lampPoleId}
- </if>
- <if test="id != null and id != 0">
- and e.id = #{id}
- </if>
- </update>
- <select id="checkEnvmonitorData" resultType="Integer">
- select count(*)
- from envmonitor s
- where 1=1
- <if test="lampPoleId != null and lampPoleId != 0">
- and s.lamp_pole_id != #{lampPoleId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and s.sectionid = #{sectionId}
- </if>
- <if test="model != null and model != ''">
- and s.model = #{model}
- </if>
- <if test="id != null and id != 0">
- and s.id != #{id}
- </if>
- </select>
- <select id="getEnvmonitorCountByLampPoleId" resultType="Integer">
- select count(*)
- from envmonitor e
- where e.lamp_pole_id = #{lampPoleId}
- </select>
- <update id="updateEnvmonitorMpData" parameterType="EnvmonitorDTO">
- update
- envmonitor e
- set
- e.mp_status = #{mpStatus},
- e.mp_start_time = #{mpStartTime},
- e.mp_end_time = #{mpEndTime},
- e.mp_bright = #{mpBright},
- e.mp_illumination = #{mpIllumination}
- where
- e.id = #{id}
- </update>
-
- <select id="getEnvmonitorMpDataById" resultType="EnvmonitorDTO">
- select
- e.id,
- e.mp_status as mpStatus,
- e.mp_start_time as mpStartTime,
- e.mp_end_time as mpEndTime,
- e.mp_bright as mpBright,e.rate,
- e.lamp_pole_id as lampPoleId,e.devType,e.serial_port as serialPort,
- e.mp_illumination as mpIllumination
- from envmonitor e
- where
- e.id = #{id}
- </select>
- <select id="getEnvmonitorListByVO" resultType="EnvmonitorDTO">
- select
- e.id,e.model as `name`,
- e.number,
- eil.updatetime as updateTime,
- eil.humidity,
- eil.temperature,
- eil.illumination,
- eil.windSpeed,
- eil.windDire,
- eil.noise,
- eil.PM10,
- eil.PM25,
- eil.atmospressue,
- e.longitude,
- e.latitude,
- s.name as section
- <choose>
- <when test="version == 0">
- ,g1.chinese_name as area,g2.chinese_name as city,g3.chinese_name as province
- </when>
- <when test="version == 1">
- ,g1.english_name as area,g2.english_name as city,g3.english_name as province
- </when>
- <otherwise>
- ,g1.ru_name as area,g2.ru_name as city,g3.ru_name as province
- </otherwise>
- </choose>
- from envmonitor e
- left join (
- SELECT t1.*
- FROM envmonitor_info_log t1
- INNER JOIN ( SELECT
- envmonitorid,
- MAX( updatetime ) AS maxDateTime
- FROM envmonitor_info_log
- GROUP BY envmonitorid ) t2
- ON t1.envmonitorid = t2.envmonitorid
- AND t1.updatetime = t2.maxDateTime) as eil on e.id = eil.envmonitorid
- left join lamp_pole lp on e.lamp_pole_id = lp.id
- left join section s on lp.sectionid = s.id
- left join global_location g1 on s.pid = g1.id
- left join global_location g2 on g1.pid = g2.id
- left join global_location g3 on g2.pid = g3.id
- where e.lamp_pole_id = 0 and e.type = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="keyword != null and keyword != ''">
- and e.number like '%${keyword}%'
- </if>
- <if test="areaId != null and areaId != 0">
- and e.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and e.sectionid = #{sectionId}
- </if>
- order by convert(e.model using gbk) asc,e.id desc
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <select id="getEnvmonitorTotalByVO" resultType="Integer">
- select count(*)
- from envmonitor e
- where e.type = 0 and e.lamp_pole_id = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="areaId != null and areaId != 0">
- and e.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and e.sectionid = #{sectionId}
- </if>
- </select>
-
- <insert id="addEnvmonitorData" parameterType="EnvmonitorDTO" useGeneratedKeys="true" keyProperty="id">
- insert into envmonitor(`number`,
- areaid,
- sectionid,
- networkid,
- <if test="longitude != null and longitude != ''">
- longitude,
- </if>
- <if test="latitude != null and latitude != ''">
- latitude,
- </if>
- <if test="monitorType != null and monitorType != ''">
- monitortype,
- </if>
- <if test="batteryAh != null and batteryAh != ''">
- batteryah,
- </if>
- <if test="lampPoleId != null and lampPoleId != 0">
- lamp_pole_id,
- </if>
- num,
- createtime,
- updatetime)
- values (#{number},
- #{areaId},
- #{sectionId},
- #{networkId},
- <if test="longitude != null and longitude != ''">
- #{longitude},
- </if>
- <if test="latitude != null and latitude != ''">
- #{latitude},
- </if>
- <if test="monitorType != null and monitorType != ''">
- #{monitorType},
- </if>
- <if test="batteryAh != null and batteryAh != ''">
- #{batteryAh},
- </if>
- <if test="lampPoleId != null and lampPoleId != 0">
- #{lampPoleId},
- </if>
- #{num},
- #{createTime},
- #{updateTime})
- </insert>
- <update id="updateEnvmonitorData" parameterType="EnvmonitorDTO">
- update envmonitor e
- set
- e.number = #{number},
- e.areaid = #{areaId},
- e.sectionid = #{sectionId},
- <if test="longitude != null and longitude != ''">
- e.longitude = #{longitude},
- </if>
- <if test="latitude != null and latitude != ''">
- e.latitude = #{latitude},
- </if>
- <if test="monitorType != null and monitorType != ''">
- e.monitortype = #{monitorType},
- </if>
- <if test="batteryAh != null and batteryAh != ''">
- e.batteryah = #{batteryAh},
- </if>
- <if test="lampPoleId != null and lampPoleId != 0">
- e.lamp_pole_id = #{lampPoleId},
- </if>
- e.num = #{num},
- e.updatetime = #{updateTime}
- where
- e.id = #{id}
- </update>
- <select id="getEnvmonitorDetailByVO" resultType="EnvmonitorDTO">
- select
- e.id,
- e.number,
- e.areaid as areaId,
- e.sectionid as sectionId,
- e.address,
- e.longitude,
- e.latitude,
- e.monitortype as monitorType,
- e.batteryah as batteryAh,
- eil.PM10,
- eil.PM25,
- eil.temperature,
- eil.humidity,
- eil.noise,
- eil.atmospressue as atmosPressue,
- eil.illumination,
- n.protocoltype as protocolType,
- s.name as section
- <choose>
- <when test="version == 0">
- ,gl.chinese_name as area
- </when>
- <when test="version == 1">
- ,gl.english_name as area
- </when>
- <otherwise>
- ,gl.ru_name as area
- </otherwise>
- </choose>
- from envmonitor e
- left join section s on s.id = e.sectionid
- left join global_location gl on s.pid = gl.id
- left join network n on e.networkid = n.id
- left join (
- SELECT t1.*
- FROM envmonitor_info_log t1
- INNER JOIN ( SELECT
- envmonitorid,
- MAX( updatetime ) AS maxDateTime
- FROM envmonitor_info_log
- GROUP BY envmonitorid ) t2
- ON t1.envmonitorid = t2.envmonitorid
- AND t1.updatetime = t2.maxDateTime) as eil on e.id = eil.envmonitorid
- where e.id = #{id} and e.type = 0
- </select>
- <insert id="addIlluminanceData" parameterType="EnvmonitorDTO" useGeneratedKeys="true" keyProperty="id">
- insert into envmonitor(`model`,
- areaid,
- sectionid,
- networkid,
- remarks,
- manufactor,
- `name`,
- longitude,
- latitude,
- address,
- createtime,
- updatetime)
- values (#{model},
- #{areaId},
- #{sectionId},
- #{networkId},
- #{remarks},
- #{manuFactor},
- #{name},
- #{longitude},
- #{latitude},
- #{address},
- #{createTime},
- #{updateTime})
- </insert>
- <update id="updateIlluminanceData" parameterType="EnvmonitorDTO">
- update envmonitor e
- set
- e.model = #{model},
- e.areaid = #{areaId},
- e.sectionid = #{sectionId},
- e.longitude = #{longitude},
- e.latitude = #{latitude},
- e.address = #{address},
- e.name = #{name},
- e.remarks = #{remarks},
- e.manufactor = #{manuFactor},
- e.updatetime = #{updateTime}
- where
- e.id = #{id}
- </update>
- <select id="getIlluminanceDetailByVO" resultType="EnvmonitorDTO">
- select
- e.id,
- e.name,
- e.areaid as areaId,
- e.sectionid as sectionId,
- e.address,
- e.longitude,
- e.latitude,
- e.model,
- e.remarks,
- e.manufactor as manuFactor,
- n.protocoltype as protocolType,
- s.name as section
- <choose>
- <when test="version == 0">
- ,gl.chinese_name as area
- </when>
- <when test="version == 1">
- ,gl.english_name as area
- </when>
- <otherwise>
- ,gl.ru_name as area
- </otherwise>
- </choose>
- from envmonitor e
- left join section s on s.id = e.sectionid
- left join global_location gl on s.pid = gl.id
- left join network n on e.networkid = n.id
- where e.id = #{id} and e.type = 1
- </select>
- <select id="getIlluminanceListByVO" resultType="EnvmonitorDTO">
- select
- e.id,
- e.name,
- e.areaid as areaId,
- e.sectionid as sectionId,
- e.address,
- e.longitude,
- e.latitude,
- e.model,
- e.remarks,
- e.manufactor as manuFactor,
- n.protocoltype as protocolType,
- s.name as section,
- e.illumination
- <choose>
- <when test="version == 0">
- ,gl.chinese_name as area
- </when>
- <when test="version == 1">
- ,gl.english_name as area
- </when>
- <otherwise>
- ,gl.ru_name as area
- </otherwise>
- </choose>
- from envmonitor e
- left join section s on s.id = e.sectionid
- left join global_location gl on s.pid = gl.id
- left join network n on e.networkid = n.id
- where e.type = 1
- <if test="sectionList != null and !sectionList.isEmpty()">
- and e.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="keyword != null and keyword != ''">
- and e.name like '%${keyword}%'
- </if>
- <if test="areaId != null and areaId != 0">
- and e.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and e.sectionid = #{sectionId}
- </if>
- order by convert(e.name using gbk) asc,e.id desc
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <select id="getNewMapDataByVO" resultType="com.welampiot.dto.EnvmonitorDTO" parameterType="com.welampiot.vo.MapDataVO">
- select E.id,E.number,E.longitude,E.latitude,EI.temperature,
- EI.humidity,
- EI.atmospressue as atmosPressue,
- EI.PM25,
- EI.PM10,
- EI.noise,
- EI.updatetime as updateTime,
- EI.illumination
- from envmonitor E
- left join network N on E.networkid = N.id
- left join section S on E.sectionid = S.id
- left join global_location A on S.pid = A.id
- left join (select t1.* from envmonitor_info_log t1, (select envmonitorid, max(updatetime) as maxtime from envmonitor_info_log group by envmonitorid) t2 where t1.envmonitorid = t2.envmonitorid and t1.updatetime = t2.maxtime) EI on EI.envmonitorid = E.id
- where E.lamp_pole_id = 0
- <if test="sectionList != null and !sectionList.isEmpty()">
- and E.sectionid in
- <foreach item="vo" collection="sectionList" open="(" separator="," close=")">
- #{vo}
- </foreach>
- </if>
- <if test="keyword != null and !keyword.isEmpty()">
- and E.number like "%#{keyword}%"
- </if>
- <choose>
- <when test="!lngLow.isEmpty() and !lngHigh.isEmpty() and Double.parseDouble(lngLow) > Double.parseDouble(lngHigh)">
- and ((L.longitude >= #{lngLow} and L.longitude <= 180) or (L.longitude <= #{lngLow} and L.longitude >= -180))
- </when>
- <otherwise>
- <if test="!lngLow.isEmpty()">
- and L.longitude >= #{lngLow}
- </if>
- <if test="!lngHigh.isEmpty()">
- and L.longitude <= #{lngHigh}
- </if>
- </otherwise>
- </choose>
- <if test="!latLow.isEmpty()">
- and L.latitude >= #{latLow}
- </if>
- <if test="!latHigh.isEmpty()">
- and L.latitude <= #{latHigh}
- </if>
- group by L.id
- </select>
- <select id="getOneEnvmonitor" parameterType="HashMap" resultType="EnvmonitorDTO">
- select E.id
- from envmonitor E
- left join lamp_pole P on P.id = E.lamp_pole_id
- where P.areaid = #{areaId} and P.sectionid = #{sectionId}
- <choose>
- <when test="number != null and model == null">
- and E.model = #{number}
- </when>
- <when test="number == null and model != null">
- and E.model = #{model}
- </when>
- <otherwise>
- and (E.model = #{number} or E.model = #{model})
- </otherwise>
- </choose>
- </select>
- <select id="getOne" parameterType="integer" resultType="EnvmonitorDTO">
- select id,areaid as areaId,weatherUpdatetime,netType,weatherInfo,devType,pramType
- from envmonitor
- where lamp_pole_id = #{lampPoleId}
- </select>
- <select id="getList" resultType="EnvmonitorDTO" parameterType="EnvmonitorDTO">
- select EI.humidity,EI.temperature,EI.noise,EI.PM25,EI.PM10,EI.illumination,EI.windSpeed,EI.windDire,W.weatherInfo,W.weatherUpdatetime,W.areaid as areaId,W.id,S.name as sectionName,LP.number,W.devType
- <choose>
- <when test="version == 0">
- ,G.chinese_name as area
- </when>
- <when test="version == 1">
- ,G.english_name as area
- </when>
- <otherwise>
- ,G.ru_name as area
- </otherwise>
- </choose>
- from envmonitor W left join (select t1.* from envmonitor_info_log AS t1 join (select max(updatetime) as maxTime,envmonitorid from envmonitor_info_log group by envmonitorid) AS t2 ON t1.updatetime = t2.maxTime AND t1.envmonitorid = t2.envmonitorid) AS EI on EI.envmonitorid = W.id
- left join section AS S on S.id = W.sectionid
- left join global_location AS G on S.pid = G.id
- left join lamp_pole AS LP on LP.id = W.lamp_pole_id
- where W.lamp_pole_id != 0
- <if test="areaId != null and areaId != 0">
- and W.areaid = #{areaId}
- </if>
- <if test="sectionId != null and sectionId != 0">
- and W.sectionid = #{sectionId}
- </if>
- <if test="sectionList != null and !sectionList.isEmpty()">
- and W.sectionid in
- <foreach collection="sectionList" item="dto" open="(" separator="," close=")">
- #{dto}
- </foreach>
- </if>
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <update id="updateWeatherInfo" parameterType="EnvmonitorDTO">
- update envmonitor set weatherInfo = #{weatherInfo},weatherUpdatetime = #{weatherUpdatetime}
- where id = #{id}
- </update>
- </mapper>
|