select a.BomId,a.ComponentId,c.InvCode as componentCode,b.ParentId,d.InvCode as parentCodefrom bom_opcomponent a left join bas_part c on a.ComponentId=c.PartIdleft join bom_parent b on a.BomId=b.BomIdleft join bas_part d on b.ParentId=d.PartId where d.InvCode='${parentCode}' 再以a.ComponentId来查询子件,的循环语法