diff --git a/handlers/asu_table/getAsuTable.handler.js b/handlers/asu_table/getAsuTable.handler.js index b678525..0bc327f 100644 --- a/handlers/asu_table/getAsuTable.handler.js +++ b/handlers/asu_table/getAsuTable.handler.js @@ -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") ]); diff --git a/repositories/equipment.repository.js b/repositories/equipment.repository.js index 7d330a8..4dc5401 100644 --- a/repositories/equipment.repository.js +++ b/repositories/equipment.repository.js @@ -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