Browse Source

fix 5800 视频异常搜索栏输入结构物名称关键字查询失败

dev
巴林闲侠 2 years ago
parent
commit
191d4bc43f
  1. 19
      api/app/lib/controllers/alarm/video.js
  2. 4
      api/app/lib/utils/dataRange.js

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

@ -67,7 +67,7 @@ async function alarmList (ctx) {
)
`)
}
const alarmRes = await clickHouse.vcmp.query(
const alarmRes = anxinStrucIds.length ? await clickHouse.vcmp.query(
`
SELECT
cameraAlarm.cameraId AS cameraId,
@ -83,8 +83,7 @@ async function alarmList (ctx) {
cameraAlarm.platform AS platform,
cameraAlarm.confirmContent AS confirmContent,
cameraAlarm.confirmTime AS confirmTime,
${//'cameraAlarm.autoRestore AS autoRestore,'
''}
${'cameraAlarm.autoRestore AS autoRestore,'}
camera_status_resolve.id AS resolveId,
camera_status.describe AS statusDescribe,
camera_status_resolve.resolve AS resolve,
@ -113,12 +112,8 @@ async function alarmList (ctx) {
camera_status_alarm.serial_no AS cameraSerialNo,
camera_status_alarm.channel_no AS cameraChannelNo,
camera_status_alarm.confirm AS confirmContent,
${
//' camera_status_alarm.auto_restore AS autoRestore,'
''
}
${'camera_status_alarm.auto_restore AS autoRestore,'}
camera_status_alarm.confirm_time AS confirmTime
FROM camera_status_alarm
INNER JOIN camera
ON camera.serial_no = camera_status_alarm.serial_no
@ -157,12 +152,14 @@ async function alarmList (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(',')})
${keywordTarget == 'struc' && keyword ? `AND anxinStruc.name LIKE '%${keyword}%'` : ''}
LEFT JOIN ${anxinyun}.t_video_ipc_station AS anxinIpcStation
ON anxinIpcStation.ipc = anxinIpc.id
LEFT JOIN ${anxinyun}.t_sensor AS anxinStation
ON anxinStation.id = anxinIpcStation.station
`
).toPromise()
).toPromise() : []
let returnD = []
let positionD = {}
@ -179,6 +176,7 @@ async function alarmList (ctx) {
if (a.strucId && !curD.struc.some(s => s.id == a.strucId)) {
curD.struc.push({
id: a.strucId,
projectId: a.projectId,
name: a.strucName
})
}
@ -220,7 +218,7 @@ async function alarmList (ctx) {
anxinStruc.find(as => as.strucId == a.strucId) ||
{
pomsProject: [
]
}
).pomsProject
@ -234,6 +232,7 @@ async function alarmList (ctx) {
if (a.strucId) {
d.struc.push({
id: a.strucId,
projectId: a.projectId,
name: a.strucName
})
}

4
api/app/lib/utils/dataRange.js

@ -57,7 +57,7 @@ module.exports = function (app, opts) {
pepProjectIds.push(b.pepProjectId)
}
}
// 查询项企项目的信息
const pepProjectRes = pepProjectIds.length ?
await clickHouse.projectManage.query(
@ -158,7 +158,7 @@ module.exports = function (app, opts) {
undelStruc.push({
strucId: s.strucId,
strucName: s.strucName,
// projectId: s.projectId,
projectId: s.projectId,
pomsProject: pomsProject
})
}

Loading…
Cancel
Save