|
@ -66,26 +66,15 @@ async function pomsProject (ctx) { |
|
|
SELECT |
|
|
SELECT |
|
|
t_pim_project.id AS id, |
|
|
t_pim_project.id AS id, |
|
|
t_pim_project.project_name AS project_name, |
|
|
t_pim_project.project_name AS project_name, |
|
|
t_pim_project_construction.construction_status_id AS construction_status_id |
|
|
t_pim_project_construction.construction_status_id AS construction_status_id, |
|
|
|
|
|
t_pim_project_state.construction_status AS construction_status |
|
|
FROM t_pim_project |
|
|
FROM t_pim_project |
|
|
LEFT JOIN t_pim_project_construction |
|
|
LEFT JOIN t_pim_project_construction |
|
|
ON t_pim_project.id = t_pim_project_construction.project_id |
|
|
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(',')}) |
|
|
WHERE id IN (${[...pepProjectIds].join(',')}) |
|
|
` |
|
|
` |
|
|
// `
|
|
|
|
|
|
// SELECT
|
|
|
|
|
|
// t_pim_project.id AS id,
|
|
|
|
|
|
// t_pim_project.project_name AS project_name,
|
|
|
|
|
|
// t_pim_project_construction.construction_status_id AS construction_status_id,
|
|
|
|
|
|
// t_project_state.construction_status AS construction_status
|
|
|
|
|
|
// FROM t_pim_project
|
|
|
|
|
|
// LEFT JOIN t_pim_project_construction
|
|
|
|
|
|
// ON t_pim_project.id = t_pim_project_construction.project_id
|
|
|
|
|
|
// LEFT JOIN t_project_state
|
|
|
|
|
|
// ON t_pim_project_construction.construction_status_id = t_project_state.id
|
|
|
|
|
|
// WHERE id IN (${[...pepProjectIds].join(',')})
|
|
|
|
|
|
// `
|
|
|
|
|
|
).toPromise() : |
|
|
).toPromise() : |
|
|
[] |
|
|
[] |
|
|
|
|
|
|
|
@ -99,7 +88,7 @@ async function pomsProject (ctx) { |
|
|
const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) |
|
|
const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) |
|
|
p.dataValues.pepProjectName = corPro.project_name |
|
|
p.dataValues.pepProjectName = corPro.project_name |
|
|
p.dataValues.constructionStatusId = corPro.construction_status_id |
|
|
p.dataValues.constructionStatusId = corPro.construction_status_id |
|
|
p.dataValues.constructionStatus = 'xxx'//'corPro.construction_status'
|
|
|
p.dataValues.constructionStatus = corPro.construction_status |
|
|
let nextAnxinProject = anxinProjectRes.filter(ap => p.anxinProjectId.includes(ap.id)) |
|
|
let nextAnxinProject = anxinProjectRes.filter(ap => p.anxinProjectId.includes(ap.id)) |
|
|
p.dataValues.anxinProject = nextAnxinProject |
|
|
p.dataValues.anxinProject = nextAnxinProject |
|
|
delete p.dataValues.anxinProjectId |
|
|
delete p.dataValues.anxinProjectId |
|
|