巴林闲侠 2 years ago
parent
commit
6e4f134235
  1. 18
      api/app/lib/controllers/alarm/video.js

18
api/app/lib/controllers/alarm/video.js

@ -8,15 +8,15 @@ async function deviceType (ctx) {
const { clickHouse } = ctx.app.fs
const kindRes = await clickHouse.vcmp.query(`
SELECT DISTINCT
camera_kind.id AS id,camera_kind.kind AS kind
FROM camera_kind
INNER JOIN camera
ON camera_kind.id = camera.kind_id
INNER JOIN camera_status_alarm
ON camera.channel_no = camera_status_alarm.channel_no
AND camera.serial_no = camera_status_alarm.serial_no
`).toPromise()
SELECT DISTINCT
camera_kind.id AS id,camera_kind.kind AS kind
FROM camera_kind
INNER JOIN camera
ON camera_kind.id = camera.kind_id
INNER JOIN camera_status_alarm
ON camera.channel_no = camera_status_alarm.channel_no
AND camera.serial_no = camera_status_alarm.serial_no
`).toPromise()
ctx.status = 200;
ctx.body = kindRes
} catch (error) {

Loading…
Cancel
Save