master
wubin 5 years ago
parent 4bad6befb4
commit 7fedbd3dec

@ -0,0 +1,10 @@
SELECT sbr.organizationNo ,1 as schoolTypeGroupNo,'一、高中阶段' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)普通高中' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
,sbr.citycountrytypeno ,sbr.cityCountryGroup
, sbr.isCount , sum(d) as d,sum(e) as e, sum(f) as f,sum(g) as g , sum(h) as h,sum(i) as i, sum(j) as j,sum(k) as k , sum(l) as l,sum(m) as m, sum(n) as n,sum(o) as o , sum(p) as p,sum(q) as q
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J522 as j on j.instanceid =it.instanceid
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('341','342','345') 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.citycountrytypeno ,sbr.cityCountryGroup
order by sbr.businessTypeNo;

@ -0,0 +1,15 @@
--keyid
--体育运动场(馆):1007
--体育器械配备:1006
--音乐器材配备:1012
--美术器材配备:1003
--理科实验仪器:1002
--校园网5001
--互联网1020
select sbr.organizationNo ,1 as schoolTypeGroupNo,'一、高中阶段' as schoolTypeGroup,1 as schoolTypeGroupNo2,'(一)普通高中' as schoolTypeGroup2 ,sbr.businessTypeNo,sbr.businessType
,sbr.citycountrytypeno ,sbr.cityCountryGroup,sum(case when j.stringvalue='是' then 1 else 0 end) as dabiaoNo ,j.keyid
from schoolBusinessRelation sbr
inner join schoolinfo as j on j.organizationno =sbr .organizationno and keyid in ('1007','1006','1012','1003','1002','5001','1020')
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('341','342','345' ) and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and j.recordyear =2019
group by sbr.organizationNo,sbr.businessTypeNo,sbr.businessType ,sbr.isCount,sbr.citycountrytypeno ,sbr.cityCountryGroup,j.keyid
order by sbr.businessTypeNo;
Loading…
Cancel
Save