You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dsMin/ReportSQL/县区/026特殊教育基本情况(总计)【20201221】.txt

79 lines
4.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--did
--视力残疾 16
--听力残疾 17
--言语残疾 18
--肢体残疾 19
--智力残疾 20
--精神残疾 21
--多重残疾 22
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType,sbr.gatherregionc ,va.region_no
, sbr.isCount, sum(f) as zhaoshengNo,sum(I + J + K + L + M + N + O + P + Q + R + S + T + U + V) as zaixiaoNo,sum(e) as biyeNo,sum(h) as nvNo,
sum(i),sum(j),sum(k),sum(l),sum(m),sum(n),sum(o),sum(p),sum(q),sum(r),sum(s),sum(t),sum(u),sum(v),did
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J315 as j on j.instanceid =it.instanceid and did between 16 and 22
inner join v_areainfo va on va.region_name =sbr.gatherregionc
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount,did,sbr.gatherregionc ,va.region_no
order by sbr.businessTypeNo;
--did小学随班就读+送教上门
-- 送教上门 随班就读
--视力残疾 19 30
--听力残疾 20 31
--言语残疾 21 32
--肢体残疾 22 33
--智力残疾 23 34
--精神残疾 24 35
--多重残疾 25 36
--女 17 27
--少数民族 18 28
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType ,sbr.gatherregionc ,va.region_no
, sbr.isCount, sum(f) as zhaoshengNo,sum(j+k+l+m+n+o) as zaixiaoNo,sum(e) as biyeNo,sum(i) as nvNo,
sum(j),sum(k),sum(l),sum(m),sum(n),sum(o),did
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J312 as j on j.instanceid =it.instanceid and did in(19,20,21,22,23,24,25,30,31,32,33,34,35,36)
inner join v_areainfo va on va.region_name =sbr.gatherregionc
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount,did,sbr.gatherregionc ,va.region_no
order by sbr.businessTypeNo;
--did初中随班就读+送教上门
-- 送教上门 随班就读
--视力残疾 18 29
--听力残疾 19 30
--言语残疾 20 31
--肢体残疾 21 32
--智力残疾 22 33
--精神残疾 23 34
--多重残疾 24 35
--女 16 26
--少数民族 17 27
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType ,sbr.gatherregionc ,va.region_no
, sbr.isCount,sum(f) as zhaoshengNo,sum(i+j+k+l) as zaixiaoNo,sum(e) as biyeNo ,sum(h) as nvNo,
sum(i),sum(j),sum(k),sum(l),did
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J313 as j on j.instanceid =it.instanceid and did in(18,19,20,21,22,23,24,29,30,31,32,33,34,35)
inner join v_areainfo va on va.region_name =sbr.gatherregionc
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount,did,sbr.gatherregionc ,va.region_no
order by sbr.businessTypeNo;
--班级数
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
,sbr.ownertypeno ,sbr.ownerTypeGroup ,sbr.citycountrytypeno ,sbr.cityCountryGroup,sbr.structureType,sbr.populationGroup,sbr .isnation ,sbr.gatherregionc ,va.region_no
, sbr.isCount,sum(e+f+g+h+I + J + K + L + M + N + O + P + Q +R) as classNo
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J214 as j on j.instanceid =it.instanceid and did in(2,3,4,5,6,7,8)
inner join v_areainfo va on va.region_name =sbr.gatherregionc
where sbr.gatherRegionB ='长春市' and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount,sbr.ownertypeno ,sbr.ownerTypeGroup ,sbr.citycountrytypeno ,sbr.cityCountryGroup,sbr.structureType,sbr.populationGroup,sbr .isnation ,sbr.gatherregionc ,va.region_no
order by sbr.businessTypeNo;