master
wubin 5 years ago
parent 7eaedea925
commit 44a1ce0271

@ -0,0 +1,11 @@
--did
--1 总数
--2 女
SELECT sbr.organizationNo ,4 as schoolTypeGroupNo,'四、工读学校' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
, sbr.isCount,sum(d),sum(e),sum(f),sum(g),sum(h),sum(i),did
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J911 as j on j.instanceid =it.instanceid and j.did in (1,2)
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('371') 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,did
order by sbr.businessTypeNo;

@ -0,0 +1,92 @@
1--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.schooltype
, sbr.isCount,0 as classno, 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) as xq,sum(j) as xyi,sum(k) as xer,sum(l) as xsan,sum(m) as xsi,sum(n) as xwu,sum(o) as xliu,sum(p) as cyi,sum(q) as cer,sum(r) as csan,sum(s) as csi,sum(t) as gyi,sum(u) as ger,sum(v) as gsan,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
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType,sbr.schooltype ,sbr.isCount,did
order by sbr.businessTypeNo;
2--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.schooltype
, sbr.isCount,0 as classno, sum(f) as zhaoshengNo,sum(j+k+l+m+n+o) as zaixiaoNo,sum(e) as biyeNo,sum(i) as nvNo,
0 as xq,sum(j) as xyi,sum(k) as xer,sum(l) as xsan,sum(m) as xsi,sum(n) as xwu,sum(o) as xliu,0 as cyi,0 as cer,0 as csan,0 as csi,0 as gyi,0 as ger,0 as gsan,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(17,18,19,20,21,22,23,24,25,27,28,30,31,32,33,34,35,36)
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType,sbr.schooltype ,sbr.isCount,did
order by sbr.businessTypeNo;
3--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.schooltype
, sbr.isCount,0 as classno,sum(f) as zhaoshengNo,sum(i+j+k+l) as zaixiaoNo,sum(e) as biyeNo ,sum(h) as nvNo,
0 as xq,0 as xyi,0 as xer,0 as xsan,0 as xsi,0 as xwu,0 as xliu,sum(i) as cyi,sum(j) as cer,sum(k) as csan,sum(l) as csi,0 as gyi,0 as ger,0 as gsan,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(16,17,18,19,20,21,22,23,24,26,27,29,30,31,32,33,34,35)
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType,sbr.schooltype ,sbr.isCount,did
order by sbr.businessTypeNo;
4--did:总计
--女 2
--少数民族 3
--寄宿生 4
--特殊教育学校中:寄宿生
--职业技术班 5
--送教上门 9+10+11+12+13+14+15
--视力残疾 9
--听力残疾 10
--言语残疾 11
--肢体残疾 12
--智力残疾 13
--精神残疾 14
--多重残疾 15
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType ,sbr.schooltype
, sbr.isCount,0 as classno, 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) as xq,sum(j) as xyi,sum(k) as xer,sum(l) as xsan,sum(m) as xsi,sum(n) as xwu,sum(o) as xliu,sum(p) as cyi,sum(q) as cer,sum(r) as csan,sum(s) as csi,sum(t) as gyi,sum(u) as ger,sum(v) as gsan,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 2 and 15
where sbr.gatherRegionB ='长春市' and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType,sbr.schooltype ,sbr.isCount,did
order by sbr.businessTypeNo;
Loading…
Cancel
Save