From bb02a6e6cad0bc9ce47de45986be7bddf821a701 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sun, 6 Nov 2022 18:54:12 +0800 Subject: [PATCH] delete false use '0' --- api/app/lib/controllers/control/analysis.js | 4 ++-- api/app/lib/controllers/control/data.js | 4 ++-- api/app/lib/controllers/control/toolLink.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/app/lib/controllers/control/analysis.js b/api/app/lib/controllers/control/analysis.js index d052ce8..cf930ab 100644 --- a/api/app/lib/controllers/control/analysis.js +++ b/api/app/lib/controllers/control/analysis.js @@ -235,7 +235,7 @@ async function problem (ctx) { if (anxinStruc.length) { const anxinStrucIds = anxinStruc.map(a => a.strucId) - whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`) + whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")}, -1)`) const alarmRes = await clickHouse.dataAlarm.query(` SELECT AlarmId,State,AlarmGroup,AlarmGroupUnit,SourceName,StartTime,${anxinyun}.t_alarm_group_unit.name AS typeName @@ -304,7 +304,7 @@ async function problem (ctx) { RIGHT JOIN ${anxinyun}.t_video_ipc ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no AND ${anxinyun}.t_video_ipc.serial_no = camera_status_alarm.serial_no - ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')})`} + ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')}, -1)`} ) ${limit ? 'LIMIT ' + limit : ''} ${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} diff --git a/api/app/lib/controllers/control/data.js b/api/app/lib/controllers/control/data.js index 584830e..553c28d 100644 --- a/api/app/lib/controllers/control/data.js +++ b/api/app/lib/controllers/control/data.js @@ -176,7 +176,7 @@ async function getVideoAlarmsAggDay(ctx) { RIGHT JOIN ${anxinyun}.t_video_ipc ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no AND ${anxinyun}.t_video_ipc.serial_no = camera_status_alarm.serial_no - ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')})`} + ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')}, -1)`} ) ) AS cameraAlarm LEFT JOIN camera_status @@ -190,7 +190,7 @@ async function getVideoAlarmsAggDay(ctx) { AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo LEFT JOIN ${anxinyun}.t_structure AS anxinStruc ON anxinStruc.id = anxinIpc.structure - AND anxinStruc.id IN (${anxinStrucIds.join(',')}) + AND anxinStruc.id IN (${anxinStrucIds.join(',')}, -1) LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation ON anxinIpcStation.ipc = anxinIpc.id `).toPromise() : [] diff --git a/api/app/lib/controllers/control/toolLink.js b/api/app/lib/controllers/control/toolLink.js index 9b25d90..7361fbc 100644 --- a/api/app/lib/controllers/control/toolLink.js +++ b/api/app/lib/controllers/control/toolLink.js @@ -251,7 +251,7 @@ async function count (ctx) { RIGHT JOIN ${anxinyun}.t_video_ipc ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no AND ${anxinyun}.t_video_ipc.serial_no = camera_status_alarm.serial_no - ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')})` + ${`WHERE ${anxinyun}.t_video_ipc.structure IN (${anxinStrucIds.join(',')}, -1)` } ) ) AS cameraAlarm @@ -267,7 +267,7 @@ async function count (ctx) { AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo LEFT JOIN ${anxinyun}.t_structure AS anxinStruc ON anxinStruc.id = anxinIpc.structure - AND anxinStruc.id IN (${anxinStrucIds.join(',')}) + AND anxinStruc.id IN (${anxinStrucIds.join(',')}, -1) LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation ON anxinIpcStation.ipc = anxinIpc.id LEFT JOIN ${anxinyun}.t_sensor AS anxinStation