diff --git a/api/app/lib/controllers/alarm/video.js b/api/app/lib/controllers/alarm/video.js index 6501066..aab420f 100644 --- a/api/app/lib/controllers/alarm/video.js +++ b/api/app/lib/controllers/alarm/video.js @@ -227,7 +227,7 @@ async function alarmList (ctx) { const alarmRes = anxinStrucIds.length ? await clickHouse.vcmp.query( queryStr ).toPromise() : [] - console.log(queryStr); + let returnD = [] let positionD = {} // 每个设备一个告警 diff --git a/api/app/lib/controllers/control/toolLink.js b/api/app/lib/controllers/control/toolLink.js index 52ce639..c465866 100644 --- a/api/app/lib/controllers/control/toolLink.js +++ b/api/app/lib/controllers/control/toolLink.js @@ -307,7 +307,7 @@ async function count (ctx) { WHERE camera.delete = '0' AND camera.recycle_time is null - AND camera_status_alarm.create_time >= '${moment().startOf("day").format('YYYY-MM-DD HH:mm:ss')}' + -- AND camera_status_alarm.create_time >= '${moment().startOf("day").format('YYYY-MM-DD HH:mm:ss')}' AND alarmId IN ( SELECT camera_status_alarm.id AS alarmId FROM camera_status_alarm diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 79cf6bd..d380a16 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -567,6 +567,7 @@ module.exports = function (app, opts) { AND alarms.SourceTypeId = 2 WHERE ${`State NOT IN (3, 4) AND `} + PlatformStructureId IN (${searchStrucIds.join(',')}) ${dataAlarmOption.length ? ' AND ' + dataAlarmOption.join(' AND ') : ''} AND Project IS NOT null @@ -1297,10 +1298,10 @@ module.exports = function (app, opts) { alarms.StructureId In (${[...dataAlarmG1StructureId, ...dataAlarmStructureId, -1].join(',') // 3025 }) - AND - alarms.AlarmGroup IN (1,4,5) + AND alarms.State < 3 + ${dataAlarmOption.length ? ' AND ' + dataAlarmOption.join(' AND ') : ''} ` ).toPromise() || []