diff --git a/golang_learn/data_office/get_hy_jctj/main.go b/golang_learn/data_office/get_hy_jctj/main.go index c8b584f..bfa09f9 100644 --- a/golang_learn/data_office/get_hy_jctj/main.go +++ b/golang_learn/data_office/get_hy_jctj/main.go @@ -23,17 +23,17 @@ select ifnull(A0184,'')IDNumber, ifnull((select min(code_name) from code_value where A0117=code_value and code_type='GB3304'),'') Ethnicity, ifnull(substr(a0134, 1, 6),'') WorkStartDate, ifnull((select min(code_name) from code_value where A0141=code_value and code_type='GB4762'),'') PoliticalStatus, - ifnull((select case when A0831 like '1%' then '研究生' when A0831 like '1%' then '大学本科' when A0831 like '3%' then '大学专科' else '中专及以下' end + ifnull((select case when A0801B like '1%' then '研究生' when A0801B like '2%' then '大学本科' when A0801B like '3%' then '大学专科' else '中专及以下' end from A08 where A0831=1 and A01.A0000=A08.A0000), '') FullTimeEducation, - ifnull((select case when A0831 like '1%' then '研究生' when A0831 like '1%' then '大学本科' when A0831 like '3%' then '大学专科' else '中专及以下' end + ifnull((select case when A0801B like '1%' then '研究生' when A0801B like '2%' then '大学本科' when A0801B like '3%' then '大学专科' else '中专及以下' end from A08 where A0834=1 and A01.A0000=A08.A0000), '') HighestEducation, ifnull((select case when A0831 like '3%' then '硕士' when A0831 like '4%' then '学士' else '博士' end from A08 where A0835=1 and A01.A0000=A08.A0000), '') HighestDegree, ifnull((select min(code_name) from code_value where A0123=code_value and code_type='XZ93'),'') JobCategory, ifnull((select min(code_name) from A05, code_value where A0501B=code_value and code_type='ZB09' and A0531=0 and A0524=1 and A01.A0000=A05.A0000), '') CurrentPositionLevel, ifnull((select substr(A0504, 1, 6) from A05 where A0531=0 and A0524=1 and A01.A0000=A05.A0000), '') CurrentPositionStartDate, ifnull((select min(code_name) from A05, code_value where A0501B=code_value and code_type='ZB148' and A0531=1 and A0524=1 and A01.A0000=A05.A0000), '') CurrentRankLevel, - (select ifnull(DATE_FORMAT(DATE_SUB(STR_TO_DATE(substr(A0530, 1, 6), '%Y%m'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'), A0504) - from A05 where A0531=1 and A0524=1 and A01.A0000=A05.A0000) CurrentRankStartDate, + (select ifnull(DATE_FORMAT(DATE_ADD(concat(substr(A0530, 1, 4),'-',substr(A0530, 5, 2),'-01'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'), + substr(A0504, 1, 6)) from A05 where A0531=1 and A0524=1 and A01.A0000=A05.A0000) CurrentRankStartDate, IF(A0197 = 1, '是', '否') Has2YearsGrassrootsExp, ifnull((select min(code_name) from A15, code_value where A1517=code_value and code_type='ZB18' and A1521='2023' and A01.A0000=A15.A0000), '') AnnualAssessment2023, ifnull((select min(code_name) from code_value where A0160=code_value and code_type='ZB125'),'') PersonCategory, @@ -59,8 +59,8 @@ select ifnull(M0203,'') IDNumber, ifnull(substr(M0244, 1, 6),'') CurrentRankStartDate, IF(M0215 = 1, '是', '否') Has2YearsGrassrootsExp, ifnull((select min(code_name) from M_M09, code_value where M0905=code_value and code_type='M_D_CM16' and M0902=M0203),'') AnnualAssessment2023, - ifnull((select case M0104 when 2 then '参照管理机关工作人员' when 3 then '参照管理事业单位人员' else '公务员' end from M_M01 where M_M01.UNID=M_M02.UNID),'') PersonCategory, - ifnull((select '是' from M_M05 where M0503=M0203 and rpt='2024'),'否') SelectedFor2024 + ifnull((select case M0104 when 2 then '参照管理机关工作人员' when 3 then '参照管理事业单位人员' else '公务员' end from M_M01 where M_M01.UNID=M_M02.UNID and rpt='2024' limit 1),'') PersonCategory, + ifnull((select '是' from M_M05 where M0503=M0203 and rpt='2024' limit 1),'否') SelectedFor2024 from M_M02 where rpt = '2024' ` diff --git a/golang_learn/data_office/get_hy_jctj/脚本.sql b/golang_learn/data_office/get_hy_jctj/脚本.sql index 88a09d6..89b53ac 100644 --- a/golang_learn/data_office/get_hy_jctj/脚本.sql +++ b/golang_learn/data_office/get_hy_jctj/脚本.sql @@ -62,8 +62,8 @@ select ifnull(substr(M0244, 1, 6) ,'') 任现职级层次时间, IF(M0215 = 1, '是', '否') 是否具有2年以上基层经验, ifnull((select min(code_name) from M_M09, code_value where M0905=code_value and code_type='M_D_CM16' and M0902=M0203),'') 2023年度考核结果, - ifnull((select case M0104 when 2 then '参照管理机关工作人员' when 3 then '参照管理事业单位人员' else '公务员' end from M_M01 where M_M01.UNID=M_M02.UNID),'') 人员类别, - ifnull((select '是' from M_M05 where M0503=M0203 and rpt='2024'),'否') 2024年考录选调生 + ifnull((select case M0104 when 2 then '参照管理机关工作人员' when 3 then '参照管理事业单位人员' else '公务员' end from M_M01 where M_M01.UNID=M_M02.UNID and rpt='2024' limit 1),'') 人员类别, + ifnull((select '是' from M_M05 where M0503=M0203 and rpt='2024' limit 1),'否') 2024年考录选调生 from M_M02 where rpt='2024'; @@ -78,17 +78,17 @@ select ifnull((select min(code_name) from code_value where A0117=code_value and code_type='GB3304'),'') 民族, ifnull(substr(a0134, 1, 6),'') 参加工作时间, ifnull((select min(code_name) from code_value where A0141=code_value and code_type='GB4762'),'') 政治面貌, - ifnull((select case when A0831 like '1%' then '研究生' when A0831 like '1%' then '大学本科' when A0831 like '3%' then '大学专科' else '中专及以下' end + ifnull((select case when A0801B like '1%' then '研究生' when A0801B like '2%' then '大学本科' when A0801B like '3%' then '大学专科' else '中专及以下' end from A08 where A0831=1 and A01.A0000=A08.A0000), '') 全日制学历, - ifnull((select case when A0831 like '1%' then '研究生' when A0831 like '1%' then '大学本科' when A0831 like '3%' then '大学专科' else '中专及以下' end + ifnull((select case when A0801B like '1%' then '研究生' when A0801B like '2%' then '大学本科' when A0801B like '3%' then '大学专科' else '中专及以下' end from A08 where A0834=1 and A01.A0000=A08.A0000), '') 最高学历, ifnull((select case when A0831 like '3%' then '硕士' when A0831 like '4%' then '学士' else '博士' end from A08 where A0835=1 and A01.A0000=A08.A0000), '') 最高学位, ifnull((select min(code_name) from code_value where A0123=code_value and code_type='XZ93'),'') 职位类别, ifnull((select min(code_name) from A05, code_value where A0501B=code_value and code_type='ZB09' and A0531=0 and A0524=1 and A01.A0000=A05.A0000), '') 现职务层次, ifnull((select substr(A0504, 1, 6) from A05 where A0531=0 and A0524=1 and A01.A0000=A05.A0000), '') 任现职务层次时间, ifnull((select min(code_name) from A05, code_value where A0501B=code_value and code_type='ZB148' and A0531=1 and A0524=1 and A01.A0000=A05.A0000), '') 现职级层次, - (select ifnull(DATE_FORMAT(DATE_SUB(STR_TO_DATE(substr(A0530, 1, 6), '%Y%m'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'), A0504) - from A05 where A0531=1 and A0524=1 and A01.A0000=A05.A0000) 任现职级层次时间, + (select ifnull(DATE_FORMAT(DATE_ADD(concat(substr(A0530, 1, 4),'-',substr(A0530, 5, 2),'-01'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'), + substr(A0504, 1, 6)) from A05 where A0531=1 and A0524=1 and A01.A0000=A05.A0000) 任现职级层次时间, IF(A0197 = 1, '是', '否') 是否具有2年以上基层经验, ifnull((select min(code_name) from A15, code_value where A1517=code_value and code_type='ZB18' and A1521='2023' and A01.A0000=A15.A0000), '') 2023年度考核结果, ifnull((select min(code_name) from code_value where A0160=code_value and code_type='ZB125'),'') 人员类别,