Browse Source

delete false use '0'

dev
巴林闲侠 2 years ago
parent
commit
bb02a6e6ca
  1. 4
      api/app/lib/controllers/control/analysis.js
  2. 4
      api/app/lib/controllers/control/data.js
  3. 4
      api/app/lib/controllers/control/toolLink.js

4
api/app/lib/controllers/control/analysis.js

@ -235,7 +235,7 @@ async function problem (ctx) {
if (anxinStruc.length) { if (anxinStruc.length) {
const anxinStrucIds = anxinStruc.map(a => a.strucId) 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(` const alarmRes = await clickHouse.dataAlarm.query(`
SELECT SELECT
AlarmId,State,AlarmGroup,AlarmGroupUnit,SourceName,StartTime,${anxinyun}.t_alarm_group_unit.name AS typeName 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 RIGHT JOIN ${anxinyun}.t_video_ipc
ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no 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 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 ? 'LIMIT ' + limit : ''}
${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} ${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''}

4
api/app/lib/controllers/control/data.js

@ -176,7 +176,7 @@ async function getVideoAlarmsAggDay(ctx) {
RIGHT JOIN ${anxinyun}.t_video_ipc RIGHT JOIN ${anxinyun}.t_video_ipc
ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no 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 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 ) AS cameraAlarm
LEFT JOIN camera_status LEFT JOIN camera_status
@ -190,7 +190,7 @@ async function getVideoAlarmsAggDay(ctx) {
AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo
LEFT JOIN ${anxinyun}.t_structure AS anxinStruc LEFT JOIN ${anxinyun}.t_structure AS anxinStruc
ON anxinStruc.id = anxinIpc.structure 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 LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation
ON anxinIpcStation.ipc = anxinIpc.id ON anxinIpcStation.ipc = anxinIpc.id
`).toPromise() : [] `).toPromise() : []

4
api/app/lib/controllers/control/toolLink.js

@ -251,7 +251,7 @@ async function count (ctx) {
RIGHT JOIN ${anxinyun}.t_video_ipc RIGHT JOIN ${anxinyun}.t_video_ipc
ON toString(${anxinyun}.t_video_ipc.channel_no) = camera_status_alarm.channel_no 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 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 ) AS cameraAlarm
@ -267,7 +267,7 @@ async function count (ctx) {
AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo AND anxinIpc.serial_no = cameraAlarm.cameraSerialNo
LEFT JOIN ${anxinyun}.t_structure AS anxinStruc LEFT JOIN ${anxinyun}.t_structure AS anxinStruc
ON anxinStruc.id = anxinIpc.structure 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 LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation
ON anxinIpcStation.ipc = anxinIpc.id ON anxinIpcStation.ipc = anxinIpc.id
LEFT JOIN ${anxinyun}.t_sensor AS anxinStation LEFT JOIN ${anxinyun}.t_sensor AS anxinStation

Loading…
Cancel
Save