select count(t.id) as total from transh_info t
where t.sectionid in
#{dto}
select count(t.id) as onlineTotal from transh_info t
where t.online = 1
and t.sectionid in
#{dto}
select count(t.id) as alarmTotal from transh_info t
where t.online = 1 and (t.full = 1 or t.state = 1)
and t.sectionid in
#{dto}
select count(t.id) as normalTotal from transh_info t
where t.full = 0 and t.state = 0 and t.online = 1
and t.sectionid in
#{dto}
select t.id,t.name,t.areaid as areaId,t.sectionid as sectionId,t.address,
t.online,t.rssi,t.rsrp as rsRp,t.snr,t.distance,t.state,t.angle,
t.longitude,t.latitude,t.batt as batT,t.temperature,t.updateTime,
t.createTime,t.full,t.deviceId,s.name as section,
g.english_name englishName,g.ru_name ruName,g.chinese_name chineseName,
p.chinese_name as chCity,p.english_name as enCity,p.ru_name as ruCity,s.timezone
from transh_info t left join section s on t.sectionid = s.id
left join global_location g on t.areaid = g.id
left join global_location p on g.pid = p.id
where 1=1
and t.sectionid in
#{dto}
and (t.name like '%${keywords}%' or t.address like '%${keywords}%')
order by convert(t.name using gbk) asc,t.id desc
limit #{page},#{count}
select t.rssi,t.rsrp as rsRp,t.snr,t.distance,t.angle,t.state,t.batt as batT,
t.temperature,t.online,t.full,t.updateTime,s.timezone
from transh_info t left join section s on t.sectionid = s.id
where t.id = #{id}
and t.sectionid in
#{dto}
limit #{page},#{count}
select count(*)
from transh_info t
where 1=1
and t.sectionid = #{sectionId}
and t.name = #{name}
and t.address = #{address}
select count(*) from transh_info t
where 1=1
and t.sectionid = #{sectionId}
and t.name = #{name}
and t.address = #{address}
and t.id != #{id}
limit 1
insert into transh_info(areaid, sectionid, address, name, longitude, latitude)
values
(#{areaId}, #{sectionId}, #{address}, #{name}, #{longitude}, #{latitude})
update transh_info
set
areaid = #{areaId},
sectionid = #{sectionId},
name = #{name},
address = #{address},
longitude = #{longitude},
latitude = #{latitude}
where id = #{id}
delete from transh_info where id = #{id}
delete from transh_info_log where transh_id = #{id}