jl-jjsp-service/securityControl-modules/securityControl-proteam/target/classes/mapper/dutyTask/ResourceMonitorMapper.xml

99 lines
4.0 KiB
XML
Raw Normal View History

2025-09-24 11:10:04 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sercurityControl.proteam.dutyTask.mapper.ResourceMonitorMapper">
<!--添加资源状态监测-设备状态监测-->
<insert id="addResourceData">
INSERT INTO tb_resource_monitor(pro_name,team_leader,abnormal_type,notice_type,create_time,create_date)
VALUES (
#{proName},#{teamLeader},#{abnormalType},'1',#{createTime},#{createDate}
)
</insert>
<!--设备状态监测-->
<select id="getDeviceStatusMonitorList"
resultType="com.sercurityControl.proteam.dutyTask.domain.ResourceMonitorEntity">
SELECT DISTINCT tcm.bid_name AS proName,
CONCAT(tcm.work_manager,'', work_manager_phone) AS teamLeader,
'设备异常掉线' AS abnormalType,
#{createDate} AS createDate
FROM t_class_metting tcm
LEFT JOIN t_device td ON tcm.puid = td.puid AND td.is_flag = '0'
<where>
<if test="createDate!=null and createDate!=''">
tcm.work_day = #{createDate}
</if>
AND tcm.del_flag = '0' AND tcm.sg_status = '1' AND (td.state = '0' OR td.puid IS NULL)
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(tcm.bid_name,#{keyWord}) > 0 OR
INSTR(tcm.work_manager,#{keyWord}) > 0
)
</if>
</where>
UNION ALL
SELECT
trm.pro_name AS proName,
trm.team_leader AS teamLeader,
trm.abnormal_type AS abnormalType,
trm.create_date AS createDate
FROM tb_resource_monitor trm
WHERE del_flag = '0' AND trm.notice_type = '1'
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(trm.pro_name,#{keyWord}) > 0 OR
INSTR(trm.team_leader,#{keyWord}) > 0
)
</if>
<if test="createDate!=null and createDate!=''">
AND trm.create_date = #{createDate}
</if>
</select>
<!--告警记录列表-->
<select id="getAlarmReocrdList"
resultType="com.sercurityControl.proteam.dutyTask.domain.ResourceMonitorEntity">
SELECT DISTINCT tcm.bid_name AS proName,
'设备掉线' AS alarmType,
CONCAT(tcm.work_manager,'', work_manager_phone) AS teamLeader,
'设备异常掉线' AS abnormalType,
#{createDate} AS createDate
FROM t_class_metting tcm
LEFT JOIN t_device td ON tcm.puid = td.puid AND td.is_flag = '0'
<where>
<if test="createDate!=null and createDate!=''">
tcm.work_day = #{createDate}
</if>
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(tcm.bid_name,#{keyWord}) > 0
)
</if>
<if test="alarmType!=null and alarmType!=''">
AND '设备掉线' = #{alarmType}
</if>
AND tcm.del_flag = '0' AND tcm.sg_status = '1' AND (td.state = '0' OR td.puid IS NULL)
</where>
UNION ALL
SELECT DISTINCT tcm.bid_name AS proName,
'设备网络' AS alarmType,
CONCAT(tcm.work_manager,'', work_manager_phone) AS teamLeader,
'设备网络信号差' AS abnormalType,
#{createDate} AS createDate
FROM t_class_metting tcm
INNER JOIN t_device td ON tcm.puid = td.puid
<where>
<if test="createDate!=null and createDate!=''">
tcm.work_day = #{createDate}
</if>
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(tcm.bid_name,#{keyWord}) > 0
)
</if>
<if test="alarmType!=null and alarmType!=''">
AND '设备网络' = #{alarmType}
</if>
AND tcm.del_flag = '0' AND td.state = '1' AND (td.qj_xh IS NOT NULL OR td.qj_xh != '') AND td.qj_xh &lt;= 30
</where>
</select>
</mapper>