Browse Source

告警->项目阶段

dev
巴林闲侠 2 years ago
parent
commit
6122455ad6
  1. 4
      api/app/lib/controllers/alarm/data.js
  2. 10
      api/app/lib/utils/dataRange.js

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

@ -125,8 +125,10 @@ async function list (ctx) {
// TODO: 开发临时添加
{
id: 999,
name: '这是假的开发の数据,看到请拨打110',
projectName: '这是假的开发の数据,看到请拨打110',
isdelete: 0,
constructionStatusId: 1,
constructionStatus: '建设中',
}
]
}).pepProject

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

@ -50,9 +50,17 @@ module.exports = function (app, opts) {
await clickHouse.projectManage.query(
`
SELECT
id, project_name AS name, isdelete
t_pim_project.id AS id,
t_pim_project.project_name AS projectName,
t_pim_project.isdelete AS isdelete,
t_pim_project_construction.construction_status_id AS constructionStatusId,
t_pim_project_state.construction_status AS constructionStatus
FROM
t_pim_project
LEFT JOIN t_pim_project_construction
ON t_pim_project.id = t_pim_project_construction.project_id
LEFT JOIN t_pim_project_state
ON t_pim_project_construction.construction_status_id = t_pim_project_state.id
WHERE
id IN (${pepProjectIds.join(',')})
${pepProjectWhereOptions.length ? `AND ${pepProjectWhereOptions.join(' AND ')}`

Loading…
Cancel
Save