Горнозаводский муниципальный район
select `id`, `alias`, `template` , `url` from `cms_structure`
where
(
`parent_id`=24140 or
(0>0 and `parent_id`=0) or
`subversionOf`=24141 or
(`subversionOf` <> 0 and `subversionOf`=24140) or
(`subversionOf` <> 0 and `subversionOf`=0
and `id`<>24140)
) and
`published`='y' and
`base_id`=0 and
(`source`<>'admin')
and `id` NOT IN (24141, 33039)
order by `alias` asc