Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
05e8feb2f2
  1. 82
      api/app/lib/controllers/monitor/index.js

82
api/app/lib/controllers/monitor/index.js

@ -22,48 +22,48 @@ async function getStructures (ctx) {
} }
} }
let undelStrucRes=[] let undelStrucRes=[]
// if (bindRes) { if (bindRes) {
// undelStrucRes = anxinProjectIds.size ? undelStrucRes = anxinProjectIds.size ?
// await clickHouse.anxinyun.query( await clickHouse.anxinyun.query(
// ` `
// SELECT SELECT
// t_structure.id AS strucId, t_structure.id AS strucId,
// t_structure.name AS strucName t_structure.name AS strucName
// FROM FROM
// t_project t_project
// LEFT JOIN LEFT JOIN
// t_project_structure t_project_structure
// ON t_project_structure.project = t_project.id ON t_project_structure.project = t_project.id
// LEFT JOIN LEFT JOIN
// t_project_structuregroup t_project_structuregroup
// ON t_project_structuregroup.project = t_project.id ON t_project_structuregroup.project = t_project.id
// LEFT JOIN LEFT JOIN
// t_structuregroup_structure t_structuregroup_structure
// ON t_structuregroup_structure.structuregroup = t_project_structuregroup.structuregroup ON t_structuregroup_structure.structuregroup = t_project_structuregroup.structuregroup
// LEFT JOIN LEFT JOIN
// t_project_construction t_project_construction
// ON t_project_construction.project = t_project.id ON t_project_construction.project = t_project.id
// LEFT JOIN LEFT JOIN
// t_structure_site t_structure_site
// ON t_structure_site.siteid = t_project_construction.construction ON t_structure_site.siteid = t_project_construction.construction
// RIGHT JOIN RIGHT JOIN
// t_structure t_structure
// ON t_structure.id = t_project_structure.structure ON t_structure.id = t_project_structure.structure
// OR t_structure.id = t_structuregroup_structure.structure OR t_structure.id = t_structuregroup_structure.structure
// OR t_structure.id = t_structure_site.structid OR t_structure.id = t_structure_site.structid
// WHERE WHERE
// project_state != -1 project_state != -1
// AND AND
// t_project.id IN (${[...anxinProjectIds].join(',')}, -1) t_project.id IN (${[...anxinProjectIds].join(',')}, -1)
// AND t_structure.external_platform is not null AND t_structure.external_platform is not null
// ORDER BY strucId ORDER BY strucId
// ` `
// ).toPromise() : ).toPromise() :
// [] []
// } }
undelStrucRes.push({strucId:4036,strucName:'象山港大桥'}) // undelStrucRes.push({strucId:4036,strucName:'象山港大桥'})
undelStrucRes.push({strucId:1,strucName:'象山港大'}) // undelStrucRes.push({strucId:1,strucName:'象山港大'})
ctx.status = 200; ctx.status = 200;
ctx.body = undelStrucRes ctx.body = undelStrucRes
} catch (error) { } catch (error) {

Loading…
Cancel
Save