mirror of
https://github.com/sergeyyarkov/asu_tools_service.git
synced 2026-10-11 10:29:22 +03:00
sql equipment fix
This commit is contained in:
parent
de712c847b
commit
8a844c12fe
@ -65,9 +65,9 @@ export default async (ctx) => {
|
||||
`${system.baseLocationName} ${subsystem.locationName}`,
|
||||
hasDocLink ? { text: "Документация", hyperlink: subsystem?.docLink } : "",
|
||||
hasElectroPlan ? { text: "Электроплан", hyperlink: subsystem?.electrDiagLink } : "",
|
||||
plcs.map((plc) => `${plc.name || ""}`).join("\n"),
|
||||
hmis.map((hmi) => `${hmi.name || ""}`).join("\n"),
|
||||
fgs.map((fg) => `${fg.name || ""}`).join("\n"),
|
||||
plcs.map((plc) => `${plc.nameModel || ""}`).join("\n"),
|
||||
hmis.map((hmi) => `${hmi.nameModel || ""}`).join("\n"),
|
||||
fgs.map((fg) => `${fg.nameModel || ""}`).join("\n"),
|
||||
pcs.map((pc) => `${pc.name || ""}`).join("\n")
|
||||
]);
|
||||
|
||||
|
||||
@ -12,22 +12,31 @@ export const equipmentRepository = {
|
||||
subSystemsTbl.doc_link as docLink,
|
||||
subSystemsTbl.electr_diag_link as electrDiagLink,
|
||||
locTbl.name as locationName,
|
||||
(select plcTbl.plc_name as name
|
||||
(select
|
||||
plcTbl.plc_name as name,
|
||||
plcModelTbl.name as nameModel
|
||||
FROM asu_system_api_plc as plcTbl
|
||||
left join asu_system_api_subsystemlist_plc as jtPLC on jtPLC.subsystemlist_id = subSystemsTbl.id
|
||||
where jtPLC.plc_id = plcTbl.id
|
||||
left join asu_system_api_plc_model as plcModelTbl on plcModelTbl.id = plcTbl.name_id
|
||||
left join asu_system_api_subsystemlist_plc as jtPLC on jtPLC.plc_id = plcTbl.id
|
||||
where jtPLC.subsystemlist_id = subSystemsTbl.id
|
||||
FOR JSON PATH) as plcs,
|
||||
|
||||
(select hmiTbl.hmi_name as name
|
||||
(select
|
||||
hmiTbl.hmi_name as name,
|
||||
hmiModelTbl.name as nameModel
|
||||
FROM asu_system_api_hmi as hmiTbl
|
||||
left join asu_system_api_subsystemlist_hmi as jtHMI on jtHMI.subsystemlist_id = subSystemsTbl.id
|
||||
where jtHMI.hmi_id = hmiTbl.id
|
||||
left join asu_system_api_hmi_model as hmiModelTbl on hmiModelTbl.id = hmiTbl.name_id
|
||||
left join asu_system_api_subsystemlist_hmi as jtHMI on jtHMI.hmi_id = hmiTbl.id
|
||||
where jtHMI.subsystemlist_id = subSystemsTbl.id
|
||||
FOR JSON PATH) as hmis,
|
||||
|
||||
(select fgTbl.fg_name as name
|
||||
(select
|
||||
fgTbl.fg_name as name,
|
||||
fgModelTbl.name as nameModel
|
||||
FROM asu_system_api_fg as fgTbl
|
||||
left join asu_system_api_subsystemlist_fg as jtFG on jtFG.subsystemlist_id = subSystemsTbl.id
|
||||
where jtFG.fg_id = fgTbl.id
|
||||
left join asu_system_api_fg_model as fgModelTbl on fgModelTbl.id = fgTbl.name_id
|
||||
left join asu_system_api_subsystemlist_fg as jtFG on jtFG.fg_id = fgTbl.id
|
||||
where jtFG.subsystemlist_id = subSystemsTbl.id
|
||||
FOR JSON PATH) as fgs,
|
||||
|
||||
(select pcTbl.pc_name as name
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user