|
@ -247,6 +247,7 @@ module.exports = function (app, opts) { |
|
|
let emailSubTitle = '' |
|
|
let emailSubTitle = '' |
|
|
|
|
|
|
|
|
let dataAlarmOption = [] |
|
|
let dataAlarmOption = [] |
|
|
|
|
|
let dataAlarmOptionLocal=[] |
|
|
let dataAlarmGroupOption = [] |
|
|
let dataAlarmGroupOption = [] |
|
|
let dataAlarmSubType = [] |
|
|
let dataAlarmSubType = [] |
|
|
let dataAlarms = [] |
|
|
let dataAlarms = [] |
|
@ -287,6 +288,7 @@ module.exports = function (app, opts) { |
|
|
} else if (c.tactics == 'continue' || c.tactics == 'abnormal_rate') { |
|
|
} else if (c.tactics == 'continue' || c.tactics == 'abnormal_rate') { |
|
|
// 新增的应该是上一个时间节点到上上个节点之间
|
|
|
// 新增的应该是上一个时间节点到上上个节点之间
|
|
|
dataAlarmOption.push(`StartTime <= '${pointTime}'`); |
|
|
dataAlarmOption.push(`StartTime <= '${pointTime}'`); |
|
|
|
|
|
dataAlarmOptionLocal.push(`StartTime <= '${pointTime}'`); |
|
|
appAlarmWhereOption.createTime = { $lte: pointTime } |
|
|
appAlarmWhereOption.createTime = { $lte: pointTime } |
|
|
videoAlarmWhereOption.push(`camera_status_alarm.create_time <= '${pointTime}'`) |
|
|
videoAlarmWhereOption.push(`camera_status_alarm.create_time <= '${pointTime}'`) |
|
|
// 新增的应该是上一个时间节点到上上个节点之间
|
|
|
// 新增的应该是上一个时间节点到上上个节点之间
|
|
@ -541,6 +543,7 @@ module.exports = function (app, opts) { |
|
|
if (c.alarmSubType && dataAlarmSubType_.length) { |
|
|
if (c.alarmSubType && dataAlarmSubType_.length) { |
|
|
dataAlarmSubType_.push(-1) |
|
|
dataAlarmSubType_.push(-1) |
|
|
dataAlarmOption.push(`AlarmGroupUnit IN (${dataAlarmSubType_.join(',')})`) |
|
|
dataAlarmOption.push(`AlarmGroupUnit IN (${dataAlarmSubType_.join(',')})`) |
|
|
|
|
|
dataAlarmOptionLocal.push(`AlarmGroupUnit IN (${dataAlarmSubType_.join(',')})`) |
|
|
} |
|
|
} |
|
|
//安心云
|
|
|
//安心云
|
|
|
dataAlarms = |
|
|
dataAlarms = |
|
@ -1295,13 +1298,15 @@ module.exports = function (app, opts) { |
|
|
FROM |
|
|
FROM |
|
|
alarms |
|
|
alarms |
|
|
WHERE |
|
|
WHERE |
|
|
|
|
|
AlarmGroup IN (1,4,5) |
|
|
|
|
|
AND |
|
|
alarms.StructureId In (${[...dataAlarmG1StructureId, ...dataAlarmStructureId, -1].join(',') |
|
|
alarms.StructureId In (${[...dataAlarmG1StructureId, ...dataAlarmStructureId, -1].join(',') |
|
|
// 3025
|
|
|
// 3025
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
AND |
|
|
AND |
|
|
alarms.State < 3 |
|
|
alarms.State < 3 |
|
|
${dataAlarmOption.length ? ' AND ' + dataAlarmOption.join(' AND ') : ''} |
|
|
${dataAlarmOptionLocal.length ? ' AND ' + dataAlarmOptionLocal.join(' AND ') : ''} |
|
|
` |
|
|
` |
|
|
|
|
|
|
|
|
).toPromise() || [] |
|
|
).toPromise() || [] |
|
|