and a.id = #{alarm.id}
and a.alarmbs = #{alarm.alarmbs}
and a.jtype like concat('%',#{alarm.jtype},'%')
and a.deviceNumber like concat('%',#{alarm.deviceNumber},'%')
and a.galarmPeople like concat('%',#{alarm.galarmPeople},'%')
and e.district like concat('%',#{alarm.district},'%')
and e.province like concat('%',#{alarm.province},'%')
and e.city like concat('%',#{alarm.city},'%')
and a.level like concat('%',#{alarm.level},'%')
and a.waringType like concat('%',#{alarm.waringType},'%')
and a.alarmTime>=#{alarm.beginTime}
and a.alarmTime<=#{alarm.endTime}
and czTime-alarmTime>1800
and czTime-alarmTime>600 and czTime-alarmTime <1800
and czTime-alarmTime>300 and czTime-alarmTime <600
and czTime-alarmTime>0 and czTime-alarmTime <300
and hour(alarmTime)>=0 and hour(alarmTime) <2
and hour(alarmTime)>=2 and hour(alarmTime) <4
and hour(alarmTime)>=4 and hour(alarmTime) <6
and hour(alarmTime)>=6 and hour(alarmTime) <8
and hour(alarmTime)>=8 and hour(alarmTime) <10
and hour(alarmTime)>=10 and hour(alarmTime) <12
and hour(alarmTime)>=12 and hour(alarmTime) <14
and hour(alarmTime)>=14 and hour(alarmTime) <16
and hour(alarmTime)>=16 and hour(alarmTime) <18
and hour(alarmTime)>=18 and hour(alarmTime) <20
and hour(alarmTime)>=20 and hour(alarmTime) <22
and hour(alarmTime)>=22 and hour(alarmTime) <24
and DATE_FORMAT(a.alarmTime,'%Y-%m-%d')>=#{alarm.beginTime}
and DATE_FORMAT(a.alarmTime,'%Y-%m-%d')<=#{alarm.endTime}
and czTime-alarmTime>1800
and czTime-alarmTime>600 and czTime-alarmTime <1800
and czTime-alarmTime>300 and czTime-alarmTime <600
and czTime-alarmTime>0 and czTime-alarmTime <300
and hour(alarmTime)>=0 and hour(alarmTime) <2
and hour(alarmTime)>=2 and hour(alarmTime) <4
and hour(alarmTime)>=4 and hour(alarmTime) <6
and hour(alarmTime)>=6 and hour(alarmTime) <8
and hour(alarmTime)>=8 and hour(alarmTime) <10
and hour(alarmTime)>=10 and hour(alarmTime) <12
and hour(alarmTime)>=12 and hour(alarmTime) <14
and hour(alarmTime)>=14 and hour(alarmTime) <16
and hour(alarmTime)>=16 and hour(alarmTime) <18
and hour(alarmTime)>=18 and hour(alarmTime) <20
and hour(alarmTime)>=20 and hour(alarmTime) <22
and hour(alarmTime)>=22 and hour(alarmTime) <24
select
a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz,
a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,
a.securityArr,a.securityId,a.alarmlb,a.alarmbs,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone,
e.stype,
e.oneId,
e.twoId,
e.threeId,
e.deptId,
e.manufacturers,
e.street as place,
e.channelNumber,
u.name as baname,
u.id as baid,
u.phone as baphone
from sys_alarm a
LEFT JOIN
sys_equipment e on e.deviceNumber=a.deviceNumber
LEFT JOIN jfpth.blade_user u ON u.id = a.securityId
where 1=1
and a.waringType IN("紧急求救")
ORDER BY
a.jtype ASC,
a.alarmTime DESC
SELECT
*
FROM
sys_alarm
WHERE
1 = 1
and district like concat('%',#{alarm.district},'%')
and province like concat('%',#{alarm.province},'%')
and city like concat('%',#{alarm.city},'%')
and alarmPeople like concat('%',#{alarm.alarmPeople},'%')
and jtype = #{alarm.jtype}
and rname like concat('%',#{alarm.rname},'%')
and deviceNumber like concat('%',#{alarm.deviceNumber},'%')
AND waringType IN ( "安装任务" )
ORDER BY
jtype ASC,
alarmTime DESC
SELECT
COUNT( * ) AS value,
"未安装" as name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND jtype = 0
AND waringType IN ( "安装任务" ) UNION ALL
SELECT
COUNT( * ) AS value,
"已安装" as name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND jtype = 2
AND waringType IN ( "安装任务" )
SELECT
COUNT( * ) AS
value
,
"未处理" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND jtype = 0
AND waringType IN ( "紧急求救" ) UNION ALL
SELECT
COUNT( * ) AS
value
,
"处理中" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND jtype = 1
AND waringType IN ( "紧急求救" )
UNION ALL
SELECT
COUNT( * ) AS
value
,
"已处理" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND jtype = 2
AND waringType IN ( "紧急求救" )
SELECT
COUNT( * ) AS
value
,
"一般警情" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND alarmbs = 0
AND waringType IN ( "紧急求救" ) UNION ALL
SELECT
COUNT( * ) AS
value
,
"误报警情" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND alarmbs = 1
AND waringType IN ( "紧急求救" )
UNION ALL
SELECT
COUNT( * ) AS
value
,
"严重警情" AS name
FROM
sys_alarm
WHERE
1 = 1
and alarmTime>=#{beginTime}
and alarmTime<=#{endTime}
AND alarmbs = 2
AND waringType IN ( "紧急求救" )
select a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType,
a.deviceNumber,a.region,e.district, a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,a.vaddress
from sys_alarm a LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber
SELECT
a.id,
a.alarmType,
a.alarmPeople,
a.alarmTime,
a.galarmPeople,
a.sex,
a.phoneNumber,
a.place,
a.content,
a.waringType,
a.deviceNumber,
a.vaddress,
a.region,
e.district,
a.alarmId,
a.czTime,
a.bz,
a.LEVEL,
a.jd,
a.wd,
a.jtype,
a.cid,
a.rname,
jfpth.blade_region.name as addvnm,
e.serialNumber,
e.stype,
e.channelNumber
FROM
sys_alarm a LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber LEFT JOIN jfpth.blade_region on
jfpth.blade_region.`code`=a.district where 1=1
and a.jtype=#{jtype}
and a.district=#{district}
and a.waringType=#{waringType}
and a.alarmTime>=#{beginTime}
and a.alarmTime<=#{endTime}
ORDER BY id ASC
select a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType,a.vaddress,
a.deviceNumber,a.region,a.district, a.alarmId,a.LEVEL,a.jd,a.wd,a.jtype,a.rname,a.jjTime,a.province,a.city,a.cid from sys_alarm a ORDER BY id DESC LIMIT 1
SELECT
a.id,
a.alarmType,
a.alarmPeople,
a.alarmTime,
a.galarmPeople,
a.sex,
a.phoneNumber,
a.place,
a.czTime,
a.bz,
a.content,
a.waringType,
a.deviceNumber,
a.region,
a.district,
a.alarmId,
a.vaddress,
a.rname,
a.LEVEL,
a.cid,
a.jd,
a.wd,
a.jtype,
d.addvnm
FROM
sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district where 1=1
and a.id=#{id}
SELECT
a.id,
a.alarmType,
a.alarmPeople,
a.alarmTime,
a.galarmPeople,
a.sex,
a.phoneNumber,
a.place,
a.content,
a.waringType,
a.deviceNumber,
a.region,
e.district,
e.province,
e.city,
a.alarmId,
a.rname,
a.LEVEL,
a.cid,
a.jd,
a.wd,
a.jtype,
d.addvnm,
e.serialNumber,
e.stype,
e.channelNumber,
e.oneContacts,
e.ThreeContacts,
e.twoContacts,
e.onePhone,
e.twoPhone,
e.ThreePhone
FROM
sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on
e.deviceNumber=a.deviceNumber where 1=1
and a.id >#{id}
delete from sys_alarm where id=#{id}
INSERT INTO sys_alarm (alarmType,jjTime,alarmPeople,alarmTime,galarmPeople,sex,phoneNumber,place,content,waringType,deviceNumber,
region,district,alarmId,level,rname,coordinate,jd,wd,jtype,province,city,cid) VALUES
(#{alarmType},#{jjTime},#{alarmPeople},#{alarmTime},#{galarmPeople},#{sex},#{phoneNumber},#{place},#{content},#{waringType},
#{deviceNumber},#{region},#{district},#{alarmId},#{level},#{rname},POINT(#{jd},#{wd}),
#{jd},#{wd},#{jtype},#{province},#{city},#{cid})
update sys_alarm SET alarmType=#{alarmType},alarmPeople=#{alarmPeople},alarmTime=#{alarmTime},
galarmPeople=#{galarmPeople},sex=#{sex},phoneNumber=#{phoneNumber},place=#{place},
content=#{content},waringType=#{waringType},deviceNumber=#{deviceNumber},region=#{region},district=#{district},alarmId=#{alarmId},level=#{level},rname=#{rname},jd=#{jd},wd=#{wd},
coordinate=POINT(#{jd},#{wd}),jtype=#{jtype},province=#{province},city=#{city},cid=#{cid} where id=#{id}
SELECT COUNT(*) as cou,waringType FROM `sys_alarm` WHERE alarmTime like concat(concat('%', #{time}), '%') GROUP BY waringType
SELECT
a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,"一键求助" as waringType,a.bz,
a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone,
e.stype,
e.oneId,
e.twoId,
e.threeId,
e.deptId,
a.alarmlb,
e.manufacturers,
e.channelNumber,
jfpth.blade_region.`name` as addvnm
FROM
sys_alarm a
LEFT JOIN sys_equipment e
on
e.deviceNumber=a.deviceNumber
LEFT JOIN
jfpth.blade_region
on
jfpth.blade_region.`code`=a.district
where
DATE_FORMAT(alarmTime,'%Y-%m-%d') >=#{beginTime}
and DATE_FORMAT(alarmTime,'%Y-%m-%d') <=#{endTime}
and a.waringType IN("紧急求救")
ORDER BY
a.jtype ASC,
a.alarmTime DESC
update sys_alarm SET jtype=#{jtype}
,bz=#{bz}
,securityArr =#{securityArr}
,alarmbs =#{bs}
where id=#{id}
update jfpth.blade_user SET work_status=#{status} where id=#{id}
SELECT count(*) FROM `sys_alarm`
where
waringType = '紧急求救'
and to_days(alarmTime) = to_days(curdate())
and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
select ifnull(b.count,0) as count from
(
SELECT DATE_FORMAT(date_sub(curdate(), interval 6 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(date_sub(curdate(), interval 5 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(date_sub(curdate(), interval 4 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(date_sub(curdate(), interval 3 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(date_sub(curdate(), interval 2 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(date_sub(curdate(), interval 1 day),'%Y-%m-%d') as click_date
union all
SELECT DATE_FORMAT(curdate(),'%Y-%m-%d') as click_date
) a
left join
(
select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm
where waringType = '紧急求救'
group by DATE_FORMAT(alarmTime,'%Y-%m-%d')
) b
on
a.click_date = b.datetime
order by a.click_date asc
select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm
where waringType = '紧急求救'
and to_days(alarmTime) = to_days(now())
and YEARWEEK(date_format(alarmTime,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
and date_format(alarmTime,'%Y%m') = date_format(now(),'%Y%m')
union all
select '电话报警' name,ifnull(count(*),0 ) value from sys_alarm
where waringType = '电话报警'
and to_days(alarmTime) = to_days(now())
and YEARWEEK(date_format(alarmTime,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
and date_format(alarmTime,'%Y%m') = date_format(now(),'%Y%m')
SELECT * FROM jfpth.blade_user WHERE is_deleted != '1' and role_id ="1372092102682521602"
SELECT
a.alarmPeople,
a.alarmId,
a.phoneNumber,
max( a.jjTime ) AS jjTime
FROM
sys_alarm a
WHERE
1 =1
and alarmId in
#{item}
GROUP BY
a.alarmPeople,
a.alarmId,
a.phoneNumber
ORDER BY
jjTime
LIMIT 1
SELECT
s.id,
s.CODE,
s.NAME,
s.real_name,
s.phone,
p.jd,
p.wd,
ST_ASTEXT ( e.coordinate )
FROM
jfpth.blade_user s
LEFT JOIN sys_position p ON p.snumber = s.
CODE LEFT JOIN sys_enclosure e ON e.anumber = s.CODE
WHERE
is_deleted != '1'
AND role_id = "1370562810882502657"
select
a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz,
a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,
a.securityArr,a.securityId,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone,
e.stype,
e.oneId,
e.twoId,
e.deviceName,
e.threeId,
e.deptId,
e.street as place,
e.channelNumber
FROM
sys_alarm a
LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber
WHERE
(securityId = "" or securityId IS NULL)
AND jtype != 2
AND securityArr LIKE concat('%',#{alarm.securityArr},'%')
a.id = #{alarm.id}
select
a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz,
a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,
a.securityArr,a.securityId,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone,
e.stype,
e.oneId,
e.twoId,
e.threeId,
e.deviceName,
e.deptId,
e.street as place,
e.channelNumber
FROM
sys_alarm a
LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber
WHERE
securityId =#{alarm.securityId} and jtype != 2
update sys_alarm SET securityId=#{alarm.securityId} where id=#{alarm.id}
update sys_alarm SET vaddress=#{vaddress} where id=#{jid}
update sys_alarm SET aaddress=#{aaddress} where id=#{jid}
SELECT COUNT(deviceNumber) as cou,deviceNumber FROM `sys_alarm` WHERE alarmTime like concat(concat('%', #{time}), '%') and waringType NOT IN("系统测试","主机重新上电") group by deviceNumber
select count(*) from sys_alarm
where waringType = '紧急求救'
and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
SELECT waringType,alarmTime,alarmId,alarmPeople,jtype,czTime FROM `sys_alarm`
where waringType='紧急求救'
and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime}
select ifnull(count,0) count from
(
SELECT @date := DATE_ADD( @date, INTERVAL + 1 DAY ) days FROM
(
SELECT @date := DATE_ADD( #{conditionVo.startTime}, INTERVAL - 1 DAY ) FROM sys_date
) time
WHERE to_days( @date ) < to_days( #{conditionVo.endTime} )
) a
left join
(
select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm
where waringType = '紧急求救'
group by DATE_FORMAT(alarmTime,'%Y-%m-%d')
) b
on
a.days = b.datetime
order by days
SELECT
#{item} as month,count(ce.id) as count
FROM
sys_alarm as ce
WHERE
YEAR ( alarmTime ) = date_format(now(),'%Y%')
AND MONTH ( alarmTime ) = #{item}
AND waringType = "紧急求救"
AND deviceNumber = #{deviceNumber}
select
a.id, "一键求助" as
alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType,a.bz,
a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress,
a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,
e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone
from sys_alarm a
LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber
where 1=1
and a.waringType IN("紧急求救")
ORDER BY
a.jtype ASC,
a.alarmTime DESC
select if(1=1,"一键求助",0) type,ifnull(count(*),0) count from sys_alarm
where waringType="紧急求救"
SELECT ifnull(count(*),0) count FROM `sys_alarm`
where deviceNumber = #{deviceNumber}
and jtype!=2