Browse Source

再次修改部分SQL报错问题

master
张献维 2 weeks ago
parent
commit
84dce2200f
  1. 6
      golang_learn/data_office/get_hy_jctj/main.go
  2. 6
      golang_learn/data_office/get_hy_jctj/脚本.sql

6
golang_learn/data_office/get_hy_jctj/main.go

@ -27,13 +27,13 @@ select ifnull(A0184,'')IDNumber,
from A08 where A0831=1 and A01.A0000=A08.A0000), '') FullTimeEducation,
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 case when A0901B like '3%' then '硕士' when A0901B 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_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,
ifnull((select ifnull(DATE_FORMAT(DATE_ADD(concat(substr(A0530, 1, 4),'-',substr(A0530, 5, 2),'-01'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'),
ifnull(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,

6
golang_learn/data_office/get_hy_jctj/脚本.sql

@ -82,13 +82,13 @@ select
from A08 where A0831=1 and A01.A0000=A08.A0000), '') ,
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 case when A0901B like '3%' then '硕士' when A0901B 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_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) ,
ifnull((select ifnull(DATE_FORMAT(DATE_ADD(concat(substr(A0530, 1, 4),'-',substr(A0530, 5, 2),'-01'), INTERVAL ifnull(A0532, 0) MONTH), '%Y%m'),
ifnull(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'),'') ,

Loading…
Cancel
Save