Struggling to understand how to filter a query based on a value in an Addon

I have a 'locations' table and 'statuses' table. Locations can have many statuses. There is a field in the "statuses" table that references the 'locations' table. There is also a "type" field in the 'statuses' table.

How can I setup a query where I return all 'locations' that have a specific "type" in the related 'statuses' record and included the array of 'statuses' records in the result?

I have been trying to accomplish this by adding the 'statuses' table as an Addon to a Query All Records request on the 'locations' table, but cannot figure out how to filter the result based on the value of a field in the Addon.

Should I being going about this in a different way?

2 replies