I have a query to set up a JSON of a tree of organizational units, the query is repeating parent elements, to resolve this I need to correctly merge the elements as in the c