|
@ -38,8 +38,8 @@ module.exports = function (app, opts) { |
|
|
// 根据 poms 的项目绑定关系查相关联的项企项目、安心云项目id信息
|
|
|
// 根据 poms 的项目绑定关系查相关联的项企项目、安心云项目id信息
|
|
|
const bindRes = await models.ProjectCorrelation.findAll(findOption) |
|
|
const bindRes = await models.ProjectCorrelation.findAll(findOption) |
|
|
|
|
|
|
|
|
// 获取不重复的 安心云项目id
|
|
|
// 获取不重复的 安心云项目id
|
|
|
let pepProjectIds = bindRes.map(b => b.pepProjectId) |
|
|
let pepProjectIds = bindRes.map(b => b.pepProjectId) |
|
|
|
|
|
|
|
|
// 查询项企项目的信息
|
|
|
// 查询项企项目的信息
|
|
|
let pepProjectWhereOptions = [] |
|
|
let pepProjectWhereOptions = [] |
|
@ -50,9 +50,17 @@ module.exports = function (app, opts) { |
|
|
await clickHouse.projectManage.query( |
|
|
await clickHouse.projectManage.query( |
|
|
` |
|
|
` |
|
|
SELECT |
|
|
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 |
|
|
FROM |
|
|
t_pim_project |
|
|
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 |
|
|
WHERE |
|
|
id IN (${pepProjectIds.join(',')}) |
|
|
id IN (${pepProjectIds.join(',')}) |
|
|
${pepProjectWhereOptions.length ? `AND ${pepProjectWhereOptions.join(' AND ')}` |
|
|
${pepProjectWhereOptions.length ? `AND ${pepProjectWhereOptions.join(' AND ')}` |
|
|