insert into logger(mac,mac_log,time) VALUES(#{0},#{1},#{2})
insert into history(mac,sensor,mac_key,mac_value,time)
values(#{0},#{1},#{2},#{3},now())
select * from state where mac=#{0} and mac_key=#{1}
DELETE FROM state WHERE state.mac=#{0} and state.mac_key=#{1}
insert into state(mac,sensor,mac_key,mac_value,time)
values(#{0},#{1},#{2},#{3},now())
update state set mac_value=#{0},time=now() where mac=#{1} and mac_key=#{2}
select mac.* ,sensor.mac_key,alarm.first, alarm.first_notice, alarm.second , alarm.second_notice, alarm.third, alarm.third_notice ,alarm.inverse_first,alarm.inverse_second,alarm.inverse_third,sensor.units,sensor.digit
from mac,alarm,sensor
where mac=#{0}
and mac.alarm=alarm.alarm
and mac.sensor=sensor.sensor
and sensor.ver=#{1}
select user.* from notice,`group`,`group_user`,`user`
where notice.notice=#{alarm}
and notice.group=`group`.`group`
and `group`.`group`=`group_user`.`group`
and `group_user`.`user`=`user`.id
select * from sensor WHERE ver=#{ver}
select * from equipment where mac=#{mac}
insert into alarmlog(equipment_mac,sensor_name,sensor_data,alarm_desc,equipment_address,alarmstate,equipment_name,sensor_unit,time)
VALUES(#{0},#{1},#{2},#{3},#{4},#{5},#{6},#{7},now())
insert into noticelog(user_id,user_name,notice_type,equipment_mac,equipment_name,alarm_content,sensor,equipment_address,sensor_level,time,noticestate)
VALUES(#{0},#{1},#{2},#{3},#{4},#{5},#{6},#{7},#{8},#{9},'no')
update equipment set state=#{0} where mac=#{1}
select * from alarmlog WHERE equipment_mac=#{mac} ORDER BY id desc LIMIT 1
SELECT * from state GROUP BY mac
select logger.mac_log from logger where mac=#{0} and time=#{1}
SELECT * from noticelog WHERE user_name=#{0} and noticelog.sensor=#{1} ORDER BY time desc LIMIT 1
insert into offlinelog(equipment_name,equipment_address,repairman,time)
VALUES(#{0},#{1},#{2},NOW())
select * from mac WHERE mac=#{mac}
select * from alarmlog WHERE alarmlog.equipment_mac=#{0} and sensor_name=#{1} ORDER BY id DESC LIMIT 1
update alarmlog set alarmstate=0
WHERE alarmlog.id=#{id}
select * from noticelog WHERE noticestate='no' ORDER BY id LIMIT 1
select * from user WHERE id=#{uid}
UPDATE noticelog set noticestate='yes' WHERE id=#{id}
SELECT * from state WHERE mac=#{mac}
select * from mac WHERE mac=#{mac}
select * from critical