| | |
| | | </delete> |
| | | |
| | | <!--新增--> |
| | | <insert id="s" parameterType="org.springblade.jfpt.alarm.entity.Alarm"> |
| | | INSERT INTO sys_alarm (alarmType,alarmPeople,alarmTime,galarmPeople,sex,phoneNumber,place,content,waringType,deviceNumber, |
| | | <insert id="s" parameterType="org.springblade.jfpt.alarm.entity.Alarm" useGeneratedKeys="true" keyProperty="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},#{alarmPeople},#{alarmTime},#{galarmPeople},#{sex},#{phoneNumber},#{place},#{content},#{waringType}, |
| | | (#{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}) |
| | | </insert> |
| | |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz},jjTime=#{jjtime} where id=#{id} |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz} where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updatePoliceStatus"> |
| | |
| | | <select id="selectAlarmCount" resultType="java.lang.Integer"> |
| | | SELECT count(*) FROM `sys_alarm` |
| | | where |
| | | waringType != '系统测试' |
| | | and |
| | | waringType!='主机重新上电' |
| | | waringType = '紧急求救' |
| | | and |
| | | to_days(alarmTime) = to_days(curdate()) |
| | | </select> |
| | |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where alarmType = '一键求助' |
| | | where waringType = '紧急求救' |
| | | group by DATE_FORMAT(alarmTime,'%Y-%m-%d') |
| | | ) b |
| | | on |
| | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <select id="selectAlarmSum" resultType="java.util.HashMap"> |
| | | select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '一键求助' |
| | | where waringType = '紧急求救' |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | |
| | | </if> |
| | | union all |
| | | select '电话报警' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '电话报警' |
| | | where waringType = '电话报警' |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | |
| | | LIMIT 1 |
| | | |
| | | </select> |
| | | |
| | | <select id="queryBa" resultType="java.util.HashMap"> |
| | | 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> |
| | | </mapper> |