|
|
@ -249,8 +249,14 @@ module.exports = function (app, opts) { |
|
|
|
} |
|
|
|
if (c.alarmType.includes('video_exception')) { |
|
|
|
let videoAlarmSubType = c.alarmSubType ? c.alarmSubType['video_exception'] : [] |
|
|
|
if (videoAlarmSubType.length == 1) videoAlarmSubType.push(-1) |
|
|
|
videoAlarms = searchStrucIds.length && videoAlarmSubType.length ? await clickHouse.vcmp.query( |
|
|
|
if (videoAlarmSubType.length == 1) { |
|
|
|
videoAlarmSubType.push(-1) |
|
|
|
} |
|
|
|
videoAlarms = |
|
|
|
searchStrucIds.length && ( |
|
|
|
!c.alarmSubType || videoAlarmSubType.length > 0 |
|
|
|
) ? |
|
|
|
await clickHouse.vcmp.query( |
|
|
|
` |
|
|
|
SELECT |
|
|
|
cameraAlarm.cameraId AS cameraId, |
|
|
@ -294,7 +300,7 @@ module.exports = function (app, opts) { |
|
|
|
AND camera.channel_no = camera_status_alarm.channel_no |
|
|
|
AND camera.delete = false |
|
|
|
AND camera.recycle_time is null |
|
|
|
${!c.alarmSubType ? `AND camera.kind_id in (${videoAlarmSubType.join(',')})` : ""} |
|
|
|
${c.alarmSubType ? `AND camera.kind_id in (${videoAlarmSubType.join(',')})` : ""} |
|
|
|
WHERE |
|
|
|
camera_status_alarm.confirm_time IS null |
|
|
|
${videoAlarmWhereOption.length ? ` AND ${videoAlarmWhereOption.join(' AND ')}` : ''} |
|
|
|