diff --git a/BigDataSql/区(县)/专任教师学历情况.sql b/BigDataSql/区(县)/专任教师学历情况.sql new file mode 100644 index 00000000..a426582a --- /dev/null +++ b/BigDataSql/区(县)/专任教师学历情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.didgroup,t1.sum as total,t2.sum as teacherno from mv_db_base_zrjsxl_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end,case when t1.didgroup='研究生毕业' then 1 when t1.didgroup='本科毕业' then 2 when t1.didgroup='专科毕业' then 3 when t1.didgroup='高中阶段毕业' then 4 when t1.didgroup='高中阶段以下毕业' then 5 end \ No newline at end of file diff --git a/BigDataSql/区(县)/专任教师年龄情况.sql b/BigDataSql/区(县)/专任教师年龄情况.sql new file mode 100644 index 00000000..872ac2f2 --- /dev/null +++ b/BigDataSql/区(县)/专任教师年龄情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.didgroup,t1.total,t2.sum as teacherno from mv_db_base_zrjsnl_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end,case when t1.didgroup='24岁及以下' then 1 when t1.didgroup='25-29岁' then 2 when t1.didgroup='30-34岁' then 3 when t1.didgroup='35-39岁' then 4 when t1.didgroup='40-44岁' then 5 when t1.didgroup='45-49岁' then 6 when t1.didgroup='50-54岁' then 7 when t1.didgroup='55-59岁' then 8 when t1.didgroup='60岁及以上' then 9 end \ No newline at end of file diff --git a/BigDataSql/区(县)/专任教师数量情况.sql b/BigDataSql/区(县)/专任教师数量情况.sql new file mode 100644 index 00000000..0d7d93c8 --- /dev/null +++ b/BigDataSql/区(县)/专任教师数量情况.sql @@ -0,0 +1 @@ +select * from mv_db_base_zhuanrenjiaoshi_area order by case when stage='小学' then 1 when stage='初中' then 2 when stage='高中' then 3 end,case when gatherregionc='南关区' then 1 when gatherregionc='宽城区' then 2 when gatherregionc='朝阳区' then 3 when gatherregionc='二道区' then 4 when gatherregionc='绿园区' then 5 when gatherregionc='双阳区' then 6 when gatherregionc='九台区' then 7 when gatherregionc='直属代管' then 8 when gatherregionc='新区代管' then 9 when gatherregionc='经开区代管' then 10 when gatherregionc='净月区代管' then 11 when gatherregionc='汽车区代管' then 12 when gatherregionc='省属代管' then 13 when gatherregionc='莲花山度假区代管' then 14 when gatherregionc='农安县' then 15 when gatherregionc='榆树市' then 16 when gatherregionc='德惠市' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/专任教师职称情况.sql b/BigDataSql/区(县)/专任教师职称情况.sql new file mode 100644 index 00000000..88a2478e --- /dev/null +++ b/BigDataSql/区(县)/专任教师职称情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.didgroup,t1.sum as total,t2.sum as teacherno from mv_db_base_zrjszc_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end,case when t1.didgroup='正高级' then 1 when t1.didgroup='副高级' then 2 when t1.didgroup='中级' then 3 when t1.didgroup='助理级' then 4 when t1.didgroup='员级' then 5 when t1.didgroup='未定职级' then 6 end \ No newline at end of file diff --git a/BigDataSql/区(县)/中小学生均教辅面积情况.sql b/BigDataSql/区(县)/中小学生均教辅面积情况.sql new file mode 100644 index 00000000..e225f7b5 --- /dev/null +++ b/BigDataSql/区(县)/中小学生均教辅面积情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_jiaofu_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='Сѧ' then 1 when t1.stage='' then 2 when t1.stage='' then 3 end,case when t1.gatherregionc='Ϲ' then 1 when t1.gatherregionc='' then 2 when t1.gatherregionc='' then 3 when t1.gatherregionc='' then 4 when t1.gatherregionc='԰' then 5 when t1.gatherregionc='˫' then 6 when t1.gatherregionc='̨' then 7 when t1.gatherregionc='ֱ' then 8 when t1.gatherregionc='' then 9 when t1.gatherregionc='' then 10 when t1.gatherregionc='' then 11 when t1.gatherregionc='' then 12 when t1.gatherregionc='ʡ' then 13 when t1.gatherregionc='ɽȼ' then 14 when t1.gatherregionc='ũ' then 15 when t1.gatherregionc='' then 16 when t1.gatherregionc='»' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/中小学生均校园占地面积情况.sql b/BigDataSql/区(县)/中小学生均校园占地面积情况.sql new file mode 100644 index 00000000..cb425da7 --- /dev/null +++ b/BigDataSql/区(县)/中小学生均校园占地面积情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_zhandimianji_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/中小学生均校舍建筑面积情况.sql b/BigDataSql/区(县)/中小学生均校舍建筑面积情况.sql new file mode 100644 index 00000000..28829e41 --- /dev/null +++ b/BigDataSql/区(县)/中小学生均校舍建筑面积情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_xueshengsushe_area t1 INNER JOIN mv_db_base_jss_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='Сѧ' then 1 when t1.stage='' then 2 when t1.stage='' then 3 end,case when t1.gatherregionc='Ϲ' then 1 when t1.gatherregionc='' then 2 when t1.gatherregionc='' then 3 when t1.gatherregionc='' then 4 when t1.gatherregionc='԰' then 5 when t1.gatherregionc='˫' then 6 when t1.gatherregionc='̨' then 7 when t1.gatherregionc='ֱ' then 8 when t1.gatherregionc='' then 9 when t1.gatherregionc='' then 10 when t1.gatherregionc='' then 11 when t1.gatherregionc='' then 12 when t1.gatherregionc='ʡ' then 13 when t1.gatherregionc='ɽȼ' then 14 when t1.gatherregionc='ũ' then 15 when t1.gatherregionc='' then 16 when t1.gatherregionc='»' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/中小学生均运动场馆面积情况.sql b/BigDataSql/区(县)/中小学生均运动场馆面积情况.sql new file mode 100644 index 00000000..22b6aa4c --- /dev/null +++ b/BigDataSql/区(县)/中小学生均运动场馆面积情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_yundongchangdi_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/寄宿生情况.sql b/BigDataSql/区(县)/寄宿生情况.sql new file mode 100644 index 00000000..a2b4c1dc --- /dev/null +++ b/BigDataSql/区(县)/寄宿生情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_jss_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/班额情况.sql b/BigDataSql/区(县)/班额情况.sql new file mode 100644 index 00000000..a5a66f71 --- /dev/null +++ b/BigDataSql/区(县)/班额情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.didgroup,t1.total as classno,t2.total from mv_db_base_yichangbaner_area t1 INNER JOIN mv_db_base_classcount_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 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 new file mode 100644 index 00000000..edbc1ab5 --- /dev/null +++ b/BigDataSql/区(县)/留守儿童情况.sql @@ -0,0 +1 @@ +select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_lset_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='Сѧ' then 1 when t1.stage='' then 2 when t1.stage='' then 3 end,case when t1.gatherregionc='Ϲ' then 1 when t1.gatherregionc='' then 2 when t1.gatherregionc='' then 3 when t1.gatherregionc='' then 4 when t1.gatherregionc='԰' then 5 when t1.gatherregionc='˫' then 6 when t1.gatherregionc='̨' then 7 when t1.gatherregionc='ֱ' then 8 when t1.gatherregionc='' then 9 when t1.gatherregionc='' then 10 when t1.gatherregionc='' then 11 when t1.gatherregionc='' then 12 when t1.gatherregionc='ʡ' then 13 when t1.gatherregionc='ɽȼ' then 14 when t1.gatherregionc='ũ' then 15 when t1.gatherregionc='' then 16 when t1.gatherregionc='»' then 17 end \ No newline at end of file diff --git a/BigDataSql/区(县)/随迁子女情况.sql b/BigDataSql/区(县)/随迁子女情况.sql new file mode 100644 index 00000000..ef3d4a7f --- /dev/null +++ b/BigDataSql/区(县)/随迁子女情况.sql @@ -0,0 +1 @@ +SELECT t1.stage,t1.gatherregionc,t1.didgroup,t1.sum as total,t2.sum as studentno FROM mv_db_base_sqzn_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end,case when didgroup='外省迁入' then 1 when didgroup='本省外县迁入' then 2 end \ No newline at end of file diff --git a/BigDataSql/第一页/全市各县区学校分布情况.sql b/BigDataSql/第一页/全市各县区学校分布情况.sql new file mode 100644 index 00000000..40af39ad --- /dev/null +++ b/BigDataSql/第一页/全市各县区学校分布情况.sql @@ -0,0 +1 @@ +select gatherregionc,stage,count as total from mv_db_base_school_area order by case when gatherregionc='Ϲ' then 1 when gatherregionc='' then 2 when gatherregionc='' then 3 when gatherregionc='' then 4 when gatherregionc='԰' then 5 when gatherregionc='˫' then 6 when gatherregionc='̨' then 7 when gatherregionc='ֱ' then 8 when gatherregionc='' then 9 when gatherregionc='' then 10 when gatherregionc='' then 11 when gatherregionc='' then 12 when gatherregionc='ʡ' then 13 when gatherregionc='ɽȼ' then 14 when gatherregionc='ũ' then 15 when gatherregionc='' then 16 when gatherregionc='»' then 17 end,case when stage='Сѧ' then 1 when stage='ѧ' then 2 when stage='һѧУ' then 3 when stage='߼ѧ' then 4 when stage='ȫѧ' then 5 when stage='ʮһѧУ' then 6 end \ No newline at end of file diff --git a/BigDataSql/第一页/学校教工学生总数.sql b/BigDataSql/第一页/学校教工学生总数.sql new file mode 100644 index 00000000..ba3300cf --- /dev/null +++ b/BigDataSql/第一页/学校教工学生总数.sql @@ -0,0 +1 @@ +select '学校总数' as didgroup,sum(count) as total from mv_db_base_school union all select '教工总数' as didgroup,jzgno as total from mv_db_base_jiaozhigong union all select '学生总数' as didgroup,sum(zaixiaono) as total from mv_db_base_student \ No newline at end of file diff --git a/BigDataSql/第一页/学生情况.sql b/BigDataSql/第一页/学生情况.sql index 3fec972f..c280dc7f 100644 --- a/BigDataSql/第一页/学生情况.sql +++ b/BigDataSql/第一页/学生情况.sql @@ -1,5 +1 @@ -select t1.stage,sum(t1.zhaoshengno) as zhaoshengno,sum(t1.biyeno) as biyeno,sum(t1.zaixiaono) as zaixiaono from mv_db_base_student as t1 GROUP BY t1.stage order by -(case when t1.stage='Сѧ' then 1 - when t1.stage='' then 2 - when t1.stage='' then 3 - end) \ No newline at end of file +select * from (select stage,unnest(array['', 'У', 'ҵ']) AS didgroup, unnest(array[sum(zhaoshengno) ,sum(zaixiaono),sum(biyeno)]) as total from mv_db_base_student GROUP BY 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/第一页/随迁子女情况.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 ca75e24d..8a0e0195 100644 --- a/BigDataSql/第三页/占地面积情况.sql +++ b/BigDataSql/第三页/占地面积情况.sql @@ -1 +1 @@ -select stage,citycountrygroup,zhandimianjino from mv_db_base_banxuetiaojian \ No newline at end of file +select stage,citycountrygroup,zhandimianjino as total from mv_db_base_banxuetiaojian ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN citycountrygroup = '城区' THEN 1 WHEN citycountrygroup = '镇区' THEN 2 WHEN citycountrygroup = '乡村' THEN 3 END \ No newline at end of file diff --git a/BigDataSql/第三页/宿舍面积情况.sql b/BigDataSql/第三页/宿舍面积情况.sql index 565c40cd..5c73757e 100644 --- a/BigDataSql/第三页/宿舍面积情况.sql +++ b/BigDataSql/第三页/宿舍面积情况.sql @@ -1,4 +1 @@ ---寄宿生 -select stage,citycountrygroup,jisuno from mv_db_base_student ---宿舍面积 -select stage,citycountrygroup,xueshengsushe from mv_db_base_banxuetiaojian \ No newline at end of file +select t1.stage,t1.citycountrygroup,t1.jisuno,t2.xueshengsushe from mv_db_base_student t1 inner join mv_db_base_banxuetiaojian t2 on t1.stage=t2.stage and t1.citycountrygroup=t2.citycountrygroup 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 6d9724c1..d00f6552 100644 --- a/BigDataSql/第三页/教学及辅助面积情况.sql +++ b/BigDataSql/第三页/教学及辅助面积情况.sql @@ -1 +1 @@ -select stage,citycountrygroup,jiaoxuejiaofuno from mv_db_base_banxuetiaojian \ No newline at end of file +select stage,citycountrygroup,jiaoxuejiaofuno as total from mv_db_base_banxuetiaojian ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN citycountrygroup = '城区' THEN 1 WHEN citycountrygroup = '镇区' THEN 2 WHEN citycountrygroup = '乡村' THEN 3 END \ No newline at end of file diff --git a/BigDataSql/第三页/校舍建筑面积情况.sql b/BigDataSql/第三页/校舍建筑面积情况.sql index ff035e35..3ccfdb6d 100644 --- a/BigDataSql/第三页/校舍建筑面积情况.sql +++ b/BigDataSql/第三页/校舍建筑面积情况.sql @@ -1 +1 @@ -select stage,citycountrygroup,xiaosheno from mv_db_base_banxuetiaojian \ No newline at end of file +select stage,citycountrygroup,xiaosheno as total from mv_db_base_banxuetiaojian ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN citycountrygroup = '城区' THEN 1 WHEN citycountrygroup = '镇区' THEN 2 WHEN citycountrygroup = '乡村' THEN 3 END \ No newline at end of file diff --git a/BigDataSql/第三页/运动场地面积情况.sql b/BigDataSql/第三页/运动场地面积情况.sql index 976fb836..6adccb64 100644 --- a/BigDataSql/第三页/运动场地面积情况.sql +++ b/BigDataSql/第三页/运动场地面积情况.sql @@ -1 +1 @@ -select stage,citycountrygroup,yundongchangdino from mv_db_base_banxuetiaojian \ No newline at end of file +select stage,citycountrygroup,yundongchangdino as total from mv_db_base_banxuetiaojian ORDER BY CASE WHEN stage = '小学' THEN 1 WHEN stage = '初中' THEN 2 WHEN stage = '高中' THEN 3 END,CASE WHEN citycountrygroup = '城区' THEN 1 WHEN citycountrygroup = '镇区' THEN 2 WHEN citycountrygroup = '乡村' THEN 3 END \ No newline at end of file diff --git a/BigDataSql/第二页/专任教师学历情况.sql b/BigDataSql/第二页/专任教师学历情况.sql index 508f5603..a9564e32 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_base_zrjsxl 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..90dafcd1 100644 --- a/BigDataSql/第二页/专任教师年龄情况.sql +++ b/BigDataSql/第二页/专任教师年龄情况.sql @@ -1 +1 @@ -select * from mv_dp_zrjsnl \ No newline at end of file +SELECT * FROM mv_db_base_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..5bb66d2f 100644 --- a/BigDataSql/第二页/专任教师职称情况.sql +++ b/BigDataSql/第二页/专任教师职称情况.sql @@ -1 +1 @@ -select * from mv_db_zrjszcqk \ No newline at end of file +SELECT * FROM mv_db_base_zrjszc 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 diff --git a/dsBaseWeb/Business/SysLoginPerson/SysLoginpersonController/SysLoginpersonController.go b/dsBaseWeb/Business/SysLoginPerson/SysLoginpersonController/SysLoginpersonController.go index a223e8a7..bb2f19a6 100644 --- a/dsBaseWeb/Business/SysLoginPerson/SysLoginpersonController/SysLoginpersonController.go +++ b/dsBaseWeb/Business/SysLoginPerson/SysLoginpersonController/SysLoginpersonController.go @@ -50,13 +50,20 @@ func RemoveCookie(c *gin.Context) { host := c.Request.Host ipStart := strings.Split(host, ".")[0] - isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart) + isIntranetIPBool := false + isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",") + + for i := 0; i < len(isIntranetIPArr); i++ { + if ipStart == isIntranetIPArr[i] { + isIntranetIPBool = true + } + } ssoServer := "" - if isIntranetIP < 0 { //小于0说明是外网 - ssoServer = ConfigUtil.SsoServerWw - } else { + if isIntranetIPBool { //true为内网 ssoServer = ConfigUtil.SsoServerNw + } else { + ssoServer = ConfigUtil.SsoServerWw } logOutURI := ssoServer + ConfigUtil.AuthLogoutURI diff --git a/dsBaseWeb/Handler/SsoHandler.go b/dsBaseWeb/Handler/SsoHandler.go index d340bab2..4773fcd1 100644 --- a/dsBaseWeb/Handler/SsoHandler.go +++ b/dsBaseWeb/Handler/SsoHandler.go @@ -51,13 +51,9 @@ func SsoHandler() gin.HandlerFunc { } //获取访问的完整地址(包括参数) requestUri := c.Request.RequestURI - fmt.Println("↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓") - fmt.Println(requestUri) - fmt.Println("↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑") host := c.Request.Host - ipStart := strings.Split(host, ".")[0] - isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart) + //白名单中的放行 //if !strings.HasPrefix(requestUri, "/dsBaseWeb/2019/"){ //对/dsBaseWeb/2019/进行特殊检测,黄海增加于2020-12-17 @@ -77,15 +73,25 @@ func SsoHandler() gin.HandlerFunc { clientId := "" redirectURI := "" + ipStart := strings.Split(host, ".")[0] + isIntranetIPBool := false + isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",") + + for i := 0; i < len(isIntranetIPArr); i++ { + if ipStart == isIntranetIPArr[i] { + isIntranetIPBool = true + } + } + //从配置文件中获取统一认证的服务器地址 - if isIntranetIP < 0 { //小于0说明是外网 - ssoServer = ConfigUtil.SsoServerWw - clientId = ConfigUtil.ClientIdWw - redirectURI = ConfigUtil.RedirectURIWw - } else { + if isIntranetIPBool { //true为内网 ssoServer = ConfigUtil.SsoServerNw clientId = ConfigUtil.ClientIdNw redirectURI = ConfigUtil.RedirectURINw + } else { + ssoServer = ConfigUtil.SsoServerWw + clientId = ConfigUtil.ClientIdWw + redirectURI = ConfigUtil.RedirectURIWw } authCodeURI := ConfigUtil.AuthCodeURI diff --git a/dsBaseWeb/Sso/Sso.go b/dsBaseWeb/Sso/Sso.go index a0829b79..d6ec1234 100644 --- a/dsBaseWeb/Sso/Sso.go +++ b/dsBaseWeb/Sso/Sso.go @@ -43,24 +43,31 @@ func CheckSsoCode(c *gin.Context) { host := c.Request.Host - ipStart := strings.Split(host, ".")[0] - isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart) - ssoServer := "" clientId := "" clientSecret := "" redirectURI := "" - if isIntranetIP < 0 { //小于0说明是外网 - ssoServer = ConfigUtil.SsoServerWw - clientId = ConfigUtil.ClientIdWw - clientSecret = ConfigUtil.ClientSecretWw - redirectURI = ConfigUtil.RedirectURIWw - } else { + ipStart := strings.Split(host, ".")[0] + isIntranetIPBool := false + isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",") + + for i := 0; i < len(isIntranetIPArr); i++ { + if ipStart == isIntranetIPArr[i] { + isIntranetIPBool = true + } + } + + if isIntranetIPBool { //true为内网 ssoServer = ConfigUtil.SsoServerNw clientId = ConfigUtil.ClientIdNw clientSecret = ConfigUtil.ClientSecretNw redirectURI = ConfigUtil.RedirectURINw + } else { + ssoServer = ConfigUtil.SsoServerWw + clientId = ConfigUtil.ClientIdWw + clientSecret = ConfigUtil.ClientSecretWw + redirectURI = ConfigUtil.RedirectURIWw } //拼统一认证验证code接口地址 @@ -80,8 +87,15 @@ func CheckSsoCode(c *gin.Context) { LogUtil.Error("statusCode: ", CommonUtil.ConvertIntToString(statusCode)) return } + //统一认证返回的信息 respMap := CommonUtil.ConvertJsonStringToMap(string(resp)) + + if respMap["code"].(float64) != 200 { + LogUtil.Error("错误信息: ", respMap["msg"].(string)) + return + } + accessToken := respMap["access_token"].(string) personId := respMap["person_id"].(string) identityId := CommonUtil.ConvertInt32ToString(int32(respMap["identity_id"].(float64))) diff --git a/dsBaseWeb/main.go b/dsBaseWeb/main.go index 29f84361..71f24c64 100644 --- a/dsBaseWeb/main.go +++ b/dsBaseWeb/main.go @@ -57,7 +57,7 @@ func main() { r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) //统一认证拦截器 - //r.Use(Handler.SsoHandler()) + r.Use(Handler.SsoHandler()) //EXCEL目录 //r.Static("/dsBaseWeb/static", "./Static")