select L.number,
G.english_name as area,
G.ru_name as area,
G.chinese_name as area,
S.name as section,AI.stralarmtype as strAlarmType,AI.updatetime from all_alarm_info_log AI inner join lampinfo L on L.id = AI.lampid left join section S on L.sectionid = S.id left join global_location G on S.pid = G.id
where L.faultstatus != 0
and L.sectionid in
#{vo}
order by AI.updatetime desc
limit #{offset},#{limit}
select
gl.chinese_name as area,
gl.english_name as area,
gl.ru_name as area,
a.id,s.name as secton,l.number,l.name,a.devType,a.dType,a.stralarmtype as strAlarmType,
a.updatetime as updateTime,a.status,a.alarmtype as alarmType,s.timezone
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
left join section s on l.sectionid = s.id
left join global_location gl on s.pid = gl.id
where 1=1
and (l.number like '%${keyword}%' or a.stralarmtype like '%${keyword}%')
and l.sectionid in
#{dto}
and a.status = 0
and a.status = 1
and a.status = 2
and a.devType = 0
and a.devType = 1
and a.devType = 2
and a.devType = 3
and a.devType = 4
and a.devType = 5
order by a.updatetime desc
limit #{offset},#{limit}
select count(a.id) as total
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
where a.status = 0
and l.sectionid in
#{dto}
select count(a.id) as total
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
where a.status = 1
and l.sectionid in
#{dto}
select count(a.id) as total
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
where a.status = 2
and l.sectionid in
#{dto}
select count(a.id) as total
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
where l.sectionid in
#{dto}
update
all_alarm_info_log a
set
a.status = #{status}
where a.id = #{id}
select a.id,l.number,a.stralarmtype as strAlarmType,a.status,a.updatetime as updateTime,
r.repair_userid as repairUserid,r.repair_time as repairTime
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
left join repair_info r on r.lampid = l.id
where 1=1
and l.sectionid in
#{dto}
select
a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
,gl1.chinese_name as city
,gl1.english_name as city
,gl1.ru_name as city
,gl2.chinese_name as province
,gl2.english_name as province
,gl2.ru_name as province
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join lampinfo l on a.lampid = l.id
where a.devType = 0
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and l.number like '%${keyword}%'
limit #{limit},#{offset}
select
a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
,gl1.chinese_name as city
,gl1.english_name as city
,gl1.ru_name as city
,gl2.chinese_name as province
,gl2.english_name as province
,gl2.ru_name as province
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join lamp_pole l on a.lampid = l.id
where a.devType = 1
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and l.number like '%${keyword}%'
limit #{limit},#{offset}
select
a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
s.name as section,a.devType,w.number,lp.longitude,lp.latitude,w.name
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
,gl1.chinese_name as city
,gl1.english_name as city
,gl1.ru_name as city
,gl2.chinese_name as province
,gl2.english_name as province
,gl2.ru_name as province
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join lamp_pole lp on a.lampid = lp.id
left join water_immersion_dev_info w on w.lamp_pole_id = lp.id
where a.devType = 3
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and w.number like '%${keyword}%'
limit #{limit},#{offset}
select
a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
s.name as section,a.devType,e.address as `number`,e.longitude,e.latitude,e.name
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
,gl1.chinese_name as city
,gl1.english_name as city
,gl1.ru_name as city
,gl2.chinese_name as province
,gl2.english_name as province
,gl2.ru_name as province
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join electric_box e on a.lampid = e.id
where a.devType = 4
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and e.address like '%${keyword}%'
limit #{limit},#{offset}
select
a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
s.name as section,a.devType,m.address as `number`,m.longitude,m.latitude,m.name
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
,gl1.chinese_name as city
,gl1.english_name as city
,gl1.ru_name as city
,gl2.chinese_name as province
,gl2.english_name as province
,gl2.ru_name as province
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join manhole m on a.lampid = m.id
where a.devType = 2
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.address like '%${keyword}%'
limit #{limit},#{offset}
update all_alarm_info_log a
set
a.status = #{status}
where a.id = #{id}
select count(a.id)
from all_alarm_info_log a
where date(a.updatetime) #{endDate}
and date(a.updatetime) = ]]> #{startDate}
and a.sectionId in
#{item}
select count(*) as dayCount,date(a.updatetime) as updateTime
from all_alarm_info_log a
where a.updatetime = ]]> curdate() - interval 30 day
and a.updatetime now()
and a.sectionId in
#{item}
group by date(a.updatetime)
order by date(a.updatetime) desc
select count(*) as dayCount
from all_alarm_info_log a
where a.status = 0
and date(a.updatetime) #{endDate}
and date(a.updatetime) = ]]> #{startDate}
and a.sectionId in
#{item}
select count(*) as dayCount
from all_alarm_info_log a
where a.status = 1
and date(a.updatetime) #{endDate}
and date(a.updatetime) = ]]> #{startDate}
and a.sectionId in
#{item}
select count(*) as dayCount
from all_alarm_info_log a
where a.status = 2
and date(a.updatetime) #{endDate}
and date(a.updatetime) = ]]> #{startDate}
and a.sectionId in
#{item}
select count(*)
from all_alarm_info_log a
left join manhole m on a.lampid = m.id
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
where a.devType = 2
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.address like '%${keyword}%'
select count(*)
from all_alarm_info_log a
left join lampinfo m on a.lampid = m.id
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
where a.devType = 0
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.number like '%${keyword}%'
select count(*)
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join lamp_pole m on a.lampid = m.id
where a.devType = 1
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.number like '%${keyword}%'
select count(*)
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join electric_box m on a.lampid = m.id
where a.devType = 4
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.address like '%${keyword}%'
select count(*)
from all_alarm_info_log a
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
left join global_location gl1 on gl.pid = gl1.id
left join global_location gl2 on gl1.pid = gl2.id
left join lamp_pole lp on a.lampid = lp.id
left join water_immersion_dev_info m on m.lamp_pole_id = lp.id
where a.devType = 3
and a.sectionId in
#{item}
and s.id = #{sectionId}
and gl.id = #{areaId}
and gl1.id = #{cityId}
and gl2.id = #{provinceId}
and a.stralarmtype like '%${alarmType}%'
and m.number like '%${keyword}%'
select
a.id,a.devType,a.lampid,s.name as section,a.alarmtype as alarmType,a.status
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
from all_alarm_info_log a
left join section s on s.id = a.sectionId
left join global_location gl on s.pid = gl.id
where a.id = #{id}
delete
from all_alarm_info_log
where id in
#{item}
select
l.number,
s.name as section,
a.stralarmtype as strAlarmType,
a.updatetime as updateTime
,gl.chinese_name as area
,gl.english_name as area
,gl.ru_name as area
from all_alarm_info_log a
left join lampinfo l on a.lampid = l.id
left join section s on a.sectionId = s.id
left join global_location gl on s.pid = gl.id
where a.devType = 0
and a.sectionId in
#{item}
order by a.updatetime desc
limit 100
select
a.updatetime as updateTime,
lp.name,
s.name as section,
a.status,
a.stralarmtype as strAlarmType
from all_alarm_info_log a
left join lamp_pole lp on a.lampid = lp.id
left join section s on lp.sectionid = s.id
where a.devType = 1
and lp.sectionId in
#{item}
and lp.areaid = #{areaId}
and lp.sectionid = #{sectionId}
order by a.updatetime desc
limit 100
select
a.updatetime as updateTime,
lp.name,
s.name as section,
a.status,
a.stralarmtype as strAlarmType
from all_alarm_info_log a
left join lamp_pole lp on a.lampid = lp.id
left join section s on lp.sectionid = s.id
where a.devType = 1
and lp.sectionId in
#{item}
and lp.areaid = #{areaId}
and lp.sectionid = #{sectionId}
order by a.updatetime desc
limit 50
select count(*)
from all_alarm_info_log a
where a.devType = 1 and a.lampid = #{lampPoleId} and a.status != 2
select a.id,a.stralarmtype as alarmInfo,a.status as alarmStatus,a.updatetime as beginDate,a.free_time as endDate
from all_alarm_info_log a
where a.devType = 1 and a.lampid = #{lampPoleId} and a.status != 2
order by a.updatetime desc
insert into all_alarm_info_log(lampid,stralarmtype,updatetime,devType,dType,source,level,alarm_status)
values
(#{lampId},#{strAlarmType},#{updateTime},#{devType},#{dType},#{source},#{level},#{alarmStatus})