查询所属id及其子项数据
with CategoryIds as
(
select id from ProductCategory where ParentId=102 or id=102
union all
select a.id from ProductCategory a join CategoryIds b on a.ParentId=b.Id where a.ParentId is not null
)
select * from ProductCategory where id in(select id from CategoryIds)