diff --git a/BigDataSql/第一页/随迁子女情况.txt b/BigDataSql/第一页/随迁子女情况.txt index e5003c86..e9458eef 100644 --- a/BigDataSql/第一页/随迁子女情况.txt +++ b/BigDataSql/第一页/随迁子女情况.txt @@ -1,9 +1 @@ - select stage,didgroup,sum(zaixiaono) as total from mv_db_sqznqk GROUP BY didgroup,stage -order by -(case when stage='Сѧ' then 1 - when stage='' then 2 - when stage='' then 3 - end) - - - select sum(zaixiaono) as total from mv_db_base_student \ No newline at end of file + select * from (select stage,didgroup,sum(zaixiaono) as total from mv_db_sqznqk GROUP BY didgroup,stage union all select 'Сѧ' as stage,'У' as didgroup, sum(zaixiaono) as total from mv_db_base_student where stage='Сѧ' union all select '' as stage,'У' as didgroup, sum(zaixiaono) as total from mv_db_base_student where stage='' union all select '' as stage,'У' as didgroup, sum(zaixiaono) as total from mv_db_base_student where stage='') t order by case when stage='Сѧ' then 1 when stage='' then 2 when stage='' then 3 end,case when didgroup='ʡǨ' then 1 when didgroup='ʡǨ' then 2 when didgroup='У' then 3 end \ No newline at end of file diff --git a/BigDataSql/第二页/专任教师学历情况.sql b/BigDataSql/第二页/专任教师学历情况.sql index 508f5603..fcfbe9e7 100644 --- a/BigDataSql/第二页/专任教师学历情况.sql +++ b/BigDataSql/第二页/专任教师学历情况.sql @@ -1 +1 @@ -select * from mv_db_zrjsxlqk \ No newline at end of file +SELECT stage,didgroup,teacherno AS total FROM mv_db_zrjsxlqk ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN didgroup = '研究生毕业' THEN 1 WHEN didgroup = '本科毕业' THEN 2 WHEN didgroup = '专科毕业' THEN 3 WHEN didgroup = '高中阶段毕业' THEN 4 WHEN didgroup = '高中阶段以下毕业' THEN 5 END \ No newline at end of file diff --git a/BigDataSql/第二页/专任教师师生比.sql b/BigDataSql/第二页/专任教师师生比.sql index bf22cf6b..37f447ff 100644 --- a/BigDataSql/第二页/专任教师师生比.sql +++ b/BigDataSql/第二页/专任教师师生比.sql @@ -1 +1,6 @@ -select * from mv_dp_zrjsssbl \ No newline at end of file +select * from mv_dp_zrjsssbl +order by +(case when stage='小学' then 1 + when stage='初中' then 2 + when stage='高中' then 3 + end) diff --git a/BigDataSql/第二页/专任教师年龄情况.sql b/BigDataSql/第二页/专任教师年龄情况.sql index 9c3203dc..885dc3e6 100644 --- a/BigDataSql/第二页/专任教师年龄情况.sql +++ b/BigDataSql/第二页/专任教师年龄情况.sql @@ -1 +1 @@ -select * from mv_dp_zrjsnl \ No newline at end of file +SELECT * FROM mv_db_zrjsnl ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN didgroup = '24岁及以下' THEN 1 WHEN didgroup = '25-29岁' THEN 2 WHEN didgroup = '30-34岁' THEN 3 WHEN didgroup = '35-39岁' THEN 4 WHEN didgroup = '40-44岁' THEN 5 WHEN didgroup = '45-49岁' THEN 6 WHEN didgroup = '50-54岁' THEN 7 WHEN didgroup = '55-59岁' THEN 8 WHEN didgroup = '60岁及以上' THEN 9 END \ No newline at end of file diff --git a/BigDataSql/第二页/专任教师职称情况.sql b/BigDataSql/第二页/专任教师职称情况.sql index b3427dcb..eda7897d 100644 --- a/BigDataSql/第二页/专任教师职称情况.sql +++ b/BigDataSql/第二页/专任教师职称情况.sql @@ -1 +1 @@ -select * from mv_db_zrjszcqk \ No newline at end of file +SELECT * FROM mv_db_zrjszcqk ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN didgroup = '正高级' THEN 1 WHEN didgroup = '副高级' THEN 2 WHEN didgroup = '中级' THEN 3 WHEN didgroup = '助理级' THEN 4 WHEN didgroup = '员级' THEN 5 WHEN didgroup = '未定职级' THEN 6 END \ No newline at end of file diff --git a/BigDataSql/第二页/城乡专任教师师生比.sql b/BigDataSql/第二页/城乡专任教师师生比.sql index bfdf4b2a..b18c93e7 100644 --- a/BigDataSql/第二页/城乡专任教师师生比.sql +++ b/BigDataSql/第二页/城乡专任教师师生比.sql @@ -1,66 +1,10 @@ -select t1.a as stage,t1.citycountrygroup,sum(c1) as studentNo,sum(c2) as teacherNo from ( - select * from ( - SELECT '小学' as a,'学生' as b,sbr.cityCountryGroup,sum(j+k+l+m+n+o) as c1,0 as c2 - 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.cityCountryGroup - - union all - - SELECT '初中' as a,'学生' as b,sbr.cityCountryGroup,sum(i+j+k+l) as c1,0 as c2 - 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','341','345') and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019 - group by sbr.cityCountryGroup - - union all - - SELECT '高中' as a,'学生' as b,sbr.cityCountryGroup,sum(i+j+k) as c1,0 as c2 - 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) - inner join v_areainfo va on va.region_name =sbr.gatherregionc - 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.cityCountryGroup - ) as t - - - union all - - - select * from ( - SELECT '高中' as a ,'老师' as b ,sbr.cityCountryGroup ,0 as c1, sum (F + G + H + I +j+k+l+ M + N ) as c2 - from schoolBusinessRelation sbr - inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno - inner join J422 as j on j.instanceid =it.instanceid and did in (22,23,24,25,26,27) - inner join v_areainfo va on va.region_name =sbr.gatherregionc - 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.cityCountryGroup - - union all - - - SELECT '初中' as a ,'老师' as b ,sbr.cityCountryGroup ,0 as c1, sum (F + G + H + I +j+k+l+ M + N ) as c2 - from schoolBusinessRelation sbr - inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno - inner join J422 as j on j.instanceid =it.instanceid and did in (13,14,15,16,17,18) - inner join v_areainfo va on va.region_name =sbr.gatherregionc - where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('311','312','341','345') and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019 - group by sbr.cityCountryGroup - - - union all - - SELECT '小学' as a ,'老师' as b ,sbr.cityCountryGroup ,0 as c1, sum (F + G + H + I +j+k+l+ M + N ) as c2 - from schoolBusinessRelation sbr - inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno - inner join J422 as j on j.instanceid =it.instanceid and did in (4,5,6,7,8,9) - inner join v_areainfo va on va.region_name =sbr.gatherregionc - where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in ('211','218','312','345') and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019 - group by sbr.cityCountryGroup - - ) as t - ) as t1 group by a,citycountrygroup order by a,citycountrygroup \ No newline at end of file +select * from mv_dp_cxzrssb as t1 + order by +(case when t1.stage='小学' then 1 + when t1.stage='初中' then 2 + when t1.stage='高中' then 3 + end), + (case when t1.citycountrygroup='城区' then 1 + when t1.citycountrygroup='镇区' then 2 + when t1.citycountrygroup='乡村' then 3 + end) \ No newline at end of file diff --git a/BigDataSql/第二页/整体情况.sql b/BigDataSql/第二页/整体情况.sql index 0df97a13..5a1efd6c 100644 --- a/BigDataSql/第二页/整体情况.sql +++ b/BigDataSql/第二页/整体情况.sql @@ -1,7 +1 @@ -select '教职工总人数' as title,jzgno as count from mv_db_base_jiaozhigong -union all -select '女教职工总人数' as title,nv_jzgno as count from mv_db_base_jiaozhigong -union all -select '专任教师总人数' as title,sum(teacherno) from mv_db_base_zhuanrenjiaoshi -union all -select '在编教师总人数' as title,count from mv_db_base_zaibian \ No newline at end of file +select '教职工总人数' as didgroup,jzgno as total from mv_db_base_jiaozhigong union all select '女教职工总人数' as didgroup,nv_jzgno as total from mv_db_base_jiaozhigong union all select '专任教师总人数' as didgroup,sum(teacherno) as total from mv_db_base_zhuanrenjiaoshi union all select '在编教师总人数' as didgroup,count as total from mv_db_base_zaibian \ No newline at end of file