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.
88 lines
7.5 KiB
88 lines
7.5 KiB
SELECT sbr.organizationNo ,5 as schoolTypeGroupNo,'五、学前教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2,sbr.businessTypeNo,sbr.businessType
|
|
,case when sbr.businessTypeNo='111' then 1 else 0 end as isCount,sum(k+l+m+n) as zaixiaoNo,0 as shaoshuNo
|
|
from schoolBusinessRelation sbr
|
|
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
|
|
inner join J311 as j on j.instanceid =it.instanceid and j.did in (5,6,7,8,9)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('111','119') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
SELECT sbr.organizationNo ,5 as schoolTypeGroupNo,'五、学前教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2,sbr.businessTypeNo,sbr.businessType
|
|
,case when sbr.businessTypeNo='111' then 1 else 0 end as isCount,0 as zaixiaoNo,sum(k+l+m+n) as shaoshuNo
|
|
from schoolBusinessRelation sbr
|
|
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
|
|
inner join J311 as j on j.instanceid =it.instanceid and j.did in (3)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('111','119') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
|
|
|
|
SELECT sbr.organizationNo ,2 as schoolTypeGroupNo,'二、义务教育' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)小学' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
,case when sbr.businessTypeNo='218' then 0 else 1 end as isCount, sum(j+k+l+m+n+o) as zaixiaoNo,0 as shaoshuNo
|
|
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 j.did in (1,37,38,39,40,41,42,43,44,45,46,47)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('211','218','219','312','345') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
SELECT sbr.organizationNo ,2 as schoolTypeGroupNo,'二、义务教育' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)小学' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
,case when sbr.businessTypeNo='218' then 0 else 1 end as isCount,0 as zaixiaoNo, sum(j+k+l+m+n+o) as shaoshuNo
|
|
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 j.did in (3)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('211','218','219','312','345') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
|
|
SELECT sbr.organizationNo ,2 as schoolTypeGroupNo,'二、义务教育' as schoolTypeGroup,2 as schoolTypeGroupNo2,'(二)初中阶段' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
,1 as isCount ,sum(i+j+k+l) as zaixiaoNo,0 as shaoshuNo
|
|
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 j.did in (1,36,37,38,39,40,41,42,43,44)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('311','312','319','321','341','345') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
SELECT sbr.organizationNo ,2 as schoolTypeGroupNo,'二、义务教育' as schoolTypeGroup,2 as schoolTypeGroupNo2,'(二)初中阶段' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
,1 as isCount ,0 as zaixiaoNo,sum(i+j+k+l) as shaoshuNo
|
|
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 j.did in (3)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('311','312','319','321','341','345') and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
|
|
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount
|
|
order by sbr.businessTypeNo;
|
|
|
|
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
, sbr.isCount, sum(I + J + K + L + M + N + O + P + Q + R + S + T + U + V) as zaixiaoNo,0 as shaoshuNo
|
|
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.isCount
|
|
order by sbr.businessTypeNo;
|
|
SELECT sbr.organizationNo ,3 as schoolTypeGroupNo,'三、特殊教育' as schoolTypeGroup,0 as schoolTypeGroupNo2,'' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
, sbr.isCount, 0 as zaixiaoNo,sum(I + J + K + L + M + N + O + P + Q + R + S + T + U + V) as shaoshuNo
|
|
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 in (3)
|
|
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
|
|
order by sbr.businessTypeNo;
|
|
|
|
SELECT sbr.organizationNo ,1 as schoolTypeGroupNo,'一、高中阶段' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)普通高中' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
, sbr.isCount , sum(i+j+k) as zaixiaoNo,0 as shaoshuNo
|
|
from schoolBusinessRelation sbr
|
|
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
|
|
inner join J314 as j on j.instanceid =it.instanceid and did in (1,11,12,13,14,15,16,17,18,19)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('341','342','345','349') 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
|
|
order by sbr.businessTypeNo;
|
|
SELECT sbr.organizationNo ,1 as schoolTypeGroupNo,'一、高中阶段' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)普通高中' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
|
|
, sbr.isCount , 0 as zaixiaoNo,sum(i+j+k) as shaoshuNo
|
|
from schoolBusinessRelation sbr
|
|
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
|
|
inner join J314 as j on j.instanceid =it.instanceid and did in (3)
|
|
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('341','342','345','349') 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
|
|
order by sbr.businessTypeNo;
|
|
|
|
|