|
@@ -375,14 +375,12 @@ public class SyncUtil {
|
|
sb.append(" r.fnumber EMP_B_PERS_PROPERTY, \n");
|
|
sb.append(" r.fnumber EMP_B_PERS_PROPERTY, \n");
|
|
//性别
|
|
//性别
|
|
sb.append(" case when sex.fid = '1010' then 1 when sex.fid = '1020' then 2 else 0 end EMP_B_GENDER,\n");
|
|
sb.append(" case when sex.fid = '1010' then 1 when sex.fid = '1020' then 2 else 0 end EMP_B_GENDER,\n");
|
|
- // TODO 离退休日期 离职单审批日期
|
|
|
|
//所属公司
|
|
//所属公司
|
|
sb.append(" '上海济煜' EMP_W_COM,\n");
|
|
sb.append(" '上海济煜' EMP_W_COM,\n");
|
|
// 手机号码,实际转正日期
|
|
// 手机号码,实际转正日期
|
|
sb.append(" substring(e.fphone,5,15) EMP_B_MOBI_PHNUM,to_char(h.frealregulardate,'yyyy-MM-dd') EMP_W_OBTA_DATE,\n");
|
|
sb.append(" substring(e.fphone,5,15) EMP_B_MOBI_PHNUM,to_char(h.frealregulardate,'yyyy-MM-dd') EMP_W_OBTA_DATE,\n");
|
|
// 用人单位编码,职级
|
|
// 用人单位编码,职级
|
|
- // TODO sb.append(" q.fnumber EMP_B_BELONG_LEGAL, p.fnumber EMP_B_RANK, \n");
|
|
|
|
- sb.append(" '1054' EMP_B_BELONG_LEGAL, p.fnumber EMP_B_RANK, \n");
|
|
|
|
|
|
+ sb.append(" case when w.fnumber is null then q.fnumber else w.fnumber end EMP_B_BELONG_LEGAL, p.fnumber EMP_B_RANK, \n");
|
|
sb.append(" to_char(person.fmodifytime,'yyyy-MM-dd hh24:mi:ss') EMP_B_LAST_UPTIME, \n");
|
|
sb.append(" to_char(person.fmodifytime,'yyyy-MM-dd hh24:mi:ss') EMP_B_LAST_UPTIME, \n");
|
|
// 邮箱,生日,办公地点
|
|
// 邮箱,生日,办公地点
|
|
sb.append(" e.fbusemail EMP_B_EMAIL,to_char(b.fbirthday,'yyyy-MM-dd') EMP_B_DATE_BIRTH,wp.fname EMP_B_WORKSPACE,\n");
|
|
sb.append(" e.fbusemail EMP_B_EMAIL,to_char(b.fbirthday,'yyyy-MM-dd') EMP_B_DATE_BIRTH,wp.fname EMP_B_WORKSPACE,\n");
|
|
@@ -390,24 +388,29 @@ public class SyncUtil {
|
|
sb.append(" g.fnumber EMP_B_IDNUMBER, n.fk_nckd_mdmkey EMP_B_RELA_STATUS, nation.fk_nckd_mdmkey EMP_B_NATIONALITY, \n");
|
|
sb.append(" g.fnumber EMP_B_IDNUMBER, n.fk_nckd_mdmkey EMP_B_RELA_STATUS, nation.fk_nckd_mdmkey EMP_B_NATIONALITY, \n");
|
|
// 在职状态
|
|
// 在职状态
|
|
sb.append(" s.fk_nckd_mdmkey EMP_W_WORKSTATE, \n");
|
|
sb.append(" s.fk_nckd_mdmkey EMP_W_WORKSTATE, \n");
|
|
|
|
+ // 退休日期
|
|
|
|
+ sb.append(" to_char(i1.fcontractenddate,'yyyy-MM-dd') EMP_W_RETIRDATE, \n");
|
|
// 离职单相关信息
|
|
// 离职单相关信息
|
|
sb.append(" j.fbillno EMP_W_RESIGNNUMBER,\n");
|
|
sb.append(" j.fbillno EMP_W_RESIGNNUMBER,\n");
|
|
sb.append(" to_char(i.fcontractenddate,'yyyy-MM-dd') EMP_W_RESIGNBIZDATE,\n");
|
|
sb.append(" to_char(i.fcontractenddate,'yyyy-MM-dd') EMP_W_RESIGNBIZDATE,\n");
|
|
|
|
+ sb.append(" to_char(i.fcontractenddate,'yyyy-MM-dd') EMP_W_TERMDATE,\n");
|
|
sb.append(" to_char(j.fcreatetime,'yyyy-MM-dd') EMP_W_RESIGNCREATEDATE,\n");
|
|
sb.append(" to_char(j.fcreatetime,'yyyy-MM-dd') EMP_W_RESIGNCREATEDATE,\n");
|
|
sb.append(" case when k.fjoincomdate is null then '2025-04-01' else to_char(k.fjoincomdate,'yyyy-MM-dd') end EMP_W_ENTRY_DATE,\n");
|
|
sb.append(" case when k.fjoincomdate is null then '2025-04-01' else to_char(k.fjoincomdate,'yyyy-MM-dd') end EMP_W_ENTRY_DATE,\n");
|
|
// TODO 现居住地
|
|
// TODO 现居住地
|
|
sb.append(" case when b.fk_nckd_isgbqs = '1' then '是' else '否' end EMP_B_RELAT_CADRES, \n");
|
|
sb.append(" case when b.fk_nckd_isgbqs = '1' then '是' else '否' end EMP_B_RELAT_CADRES, \n");
|
|
- sb.append(" d.fnativeplace EMP_B_NATIVE_PLACE ,g1.fnumber EMP_B_PASSPORT,l.fk_nckd_mdmkey EMP_B_NATIONAL \n");
|
|
|
|
|
|
+ sb.append(" d.fnativeplace EMP_B_NATIVE_PLACE ,g1.fnumber EMP_B_PASSPORT,l.fk_nckd_mdmkey EMP_B_NATIONAL, \n");
|
|
|
|
+ sb.append(" case when a.fdatastatus = '-2' then '是' else '否' end EMP_B_DELE_LOGO, \n");
|
|
|
|
+ sb.append(" u.fbillno EMP_W_EMPLOYNUMBER \n");
|
|
sb.append(" from t_hrpi_ermanfile person\n");
|
|
sb.append(" from t_hrpi_ermanfile person\n");
|
|
- sb.append(" left join t_hrpi_person a on a.fid = person.fpersonid and a.fiscurrentversion = '1' -- 人员主表\n");
|
|
|
|
- sb.append(" left join t_hrpi_pernontsprop b on a.fid = b.fpersonid and b.fiscurrentversion = '1' -- 非时序\n");
|
|
|
|
- sb.append(" left join t_hrpi_pertsprop c on a.fid = c.fpersonid and c.fiscurrentversion = '1' -- 时序\n");
|
|
|
|
- sb.append(" left join t_hrpi_perregion d on a.fid = d.fpersonid and d.fiscurrentversion = '1' -- 区域信息\n");
|
|
|
|
- sb.append(" left join t_hrpi_percontact e on a.fid = e.fpersonid and e.fiscurrentversion = '1' -- 联系方式\n");
|
|
|
|
|
|
+ sb.append(" left join t_hrpi_person a on a.fid = person.fpersonid and a.fiscurrentversion = '1' and a.fdatastatus = '1' -- 人员主表\n");
|
|
|
|
+ sb.append(" left join t_hrpi_pernontsprop b on a.fid = b.fpersonid and b.fiscurrentversion = '1' and b.fdatastatus = '1' -- 非时序\n");
|
|
|
|
+ sb.append(" left join t_hrpi_pertsprop c on a.fid = c.fpersonid and c.fiscurrentversion = '1' and c.fdatastatus = '1' -- 时序\n");
|
|
|
|
+ sb.append(" left join t_hrpi_perregion d on a.fid = d.fpersonid and d.fiscurrentversion = '1' and d.fdatastatus = '1' -- 区域信息\n");
|
|
|
|
+ sb.append(" left join t_hrpi_percontact e on a.fid = e.fpersonid and e.fiscurrentversion = '1' and e.fdatastatus = '1' -- 联系方式\n");
|
|
sb.append(" inner join t_hrpi_empposorgrel f on f.fid = person.fempposrelid and f.fiscurrentversion = '1' and f.fisprimary = '1' -- 任职经历\n");
|
|
sb.append(" inner join t_hrpi_empposorgrel f on f.fid = person.fempposrelid and f.fiscurrentversion = '1' and f.fisprimary = '1' -- 任职经历\n");
|
|
sb.append(" left join t_hrpi_percre g on a.fid = g.fpersonid and g.fiscurrentversion = '1' and g.fcredentialstypeid = '1010' -- 证件信息 身份证\n");
|
|
sb.append(" left join t_hrpi_percre g on a.fid = g.fpersonid and g.fiscurrentversion = '1' and g.fcredentialstypeid = '1010' -- 证件信息 身份证\n");
|
|
sb.append(" left join t_hrpi_percre g1 on a.fid = g1.fpersonid and g1.fiscurrentversion = '1' and g1.fcredentialstypeid = '1020' -- 证件信息 护照\n");
|
|
sb.append(" left join t_hrpi_percre g1 on a.fid = g1.fpersonid and g1.fiscurrentversion = '1' and g1.fcredentialstypeid = '1020' -- 证件信息 护照\n");
|
|
- sb.append(" left join t_hrpi_trialperiod h on a.fid = h.fpersonid and h.fiscurrentversion = '1' -- 试用期\n");
|
|
|
|
|
|
+ sb.append(" left join t_hrpi_trialperiod h on a.fid = h.fpersonid and h.fiscurrentversion = '1' and h.fdatastatus = '1' -- 试用期\n");
|
|
sb.append(" left join t_haos_adminorg org on org.fid = f.fadminorgid -- 所属部门\n");
|
|
sb.append(" left join t_haos_adminorg org on org.fid = f.fadminorgid -- 所属部门\n");
|
|
sb.append(" left join t_hbpm_position pos on pos.fid = f.fpositionid -- 岗位\n");
|
|
sb.append(" left join t_hbpm_position pos on pos.fid = f.fpositionid -- 岗位\n");
|
|
sb.append(" left join t_hbpm_position pos1 on pos1.fid = pos.fparentid -- 上级岗位\n");
|
|
sb.append(" left join t_hbpm_position pos1 on pos1.fid = pos.fparentid -- 上级岗位\n");
|
|
@@ -415,9 +418,11 @@ public class SyncUtil {
|
|
sb.append(" left join t_hrpi_baselocation t on t.fpersonid = a.fid and t.fiscurrentversion = '1' and t.fbusinessstatus = '1' -- 常驻工作地\n ");
|
|
sb.append(" left join t_hrpi_baselocation t on t.fpersonid = a.fid and t.fiscurrentversion = '1' and t.fbusinessstatus = '1' -- 常驻工作地\n ");
|
|
sb.append(" left join t_hbss_workplace wp on wp.fid = t.flocationId -- 工作地点\n");
|
|
sb.append(" left join t_hbss_workplace wp on wp.fid = t.flocationId -- 工作地点\n");
|
|
sb.append(" left join t_hbss_nationality nation on nation.fid = b.fnationalityid -- 国籍\n");
|
|
sb.append(" left join t_hbss_nationality nation on nation.fid = b.fnationalityid -- 国籍\n");
|
|
- sb.append(" left join t_htm_quitfileinfo i on i.femployeeid = f.femployeeid -- 离职档案\n");
|
|
|
|
- sb.append(" left join t_htm_quitapplybill j on j.fid = i.fquitapplyid -- 离职办理单\n");
|
|
|
|
- sb.append(" left join t_hrpi_perserlen k on a.fid = k.fpersonid and k.fiscurrentversion = '1' -- 服务年限\n");
|
|
|
|
|
|
+ sb.append(" left join t_htm_quitfileinfo i on i.femployeeid = f.femployeeid and i.fquittypeid <> '1245492024325465088' -- 离职档案 非退休 \n");
|
|
|
|
+ sb.append(" left join t_htm_quitfileinfo i1 on i1.femployeeid = f.femployeeid and i1.fquittypeid = '1245492024325465088' -- 离职档案 退休 \n");
|
|
|
|
+ sb.append(" left join t_htm_quitapplybill j on j.fid = i.fquitapplyid -- 离职办理单 非退休 \n");
|
|
|
|
+ sb.append(" left join t_htm_quitapplybill j1 on j1.fid = i1.fquitapplyid -- 离职办理单 退休 \n");
|
|
|
|
+ sb.append(" left join t_hrpi_perserlen k on a.fid = k.fpersonid and k.fiscurrentversion = '1' and k.fdatastatus = '1' -- 服务年限\n");
|
|
sb.append(" left join t_hbss_flok l on l.fid = b.ffolkid -- 民族\n");
|
|
sb.append(" left join t_hbss_flok l on l.fid = b.ffolkid -- 民族\n");
|
|
sb.append(" left join t_hrpi_empentrel m on m.fid = person.fempentrelid -- 职业信息\n");
|
|
sb.append(" left join t_hrpi_empentrel m on m.fid = person.fempentrelid -- 职业信息\n");
|
|
sb.append(" left join t_hbss_laborrelstatus n on n.fid = m.flaborrelstatusid -- 用工关系状态\n");
|
|
sb.append(" left join t_hbss_laborrelstatus n on n.fid = m.flaborrelstatusid -- 用工关系状态\n");
|
|
@@ -426,6 +431,11 @@ public class SyncUtil {
|
|
sb.append(" left join t_hbss_enterprise q on q.fid = m.fenterpriseid -- 用人单位 \n");
|
|
sb.append(" left join t_hbss_enterprise q on q.fid = m.fenterpriseid -- 用人单位 \n");
|
|
sb.append(" left join tk_nckd_personproperty r on r.fid = b.fk_nckd_personproperty -- 个人性质 \n");
|
|
sb.append(" left join tk_nckd_personproperty r on r.fid = b.fk_nckd_personproperty -- 个人性质 \n");
|
|
sb.append(" left join t_hbss_labrelstatuscls s on s.fid = n.flabrelstatusclsid -- 用工状态分类 \n");
|
|
sb.append(" left join t_hbss_labrelstatuscls s on s.fid = n.flabrelstatusclsid -- 用工状态分类 \n");
|
|
|
|
+ sb.append(" left join ( select row_number() over (partition by u1.femployeeno order by u2.feffectdate desc) r, u2.fbillno, u1.femployeeNo \n");
|
|
|
|
+ sb.append(" from t_hom_onbrdbill u1 left join t_hom_onbrdbill_a u2 on u1.fid = u2.fid) u on u.femployeeno = a.fnumber and u.r = 1 -- 入职信息 \n");
|
|
|
|
+ sb.append(" left join ( select row_number() over (partition by fermanfileid order by fmodifytime desc) r, fermanfileid, fsigncompanyid, fnumber \n");
|
|
|
|
+ sb.append(" from t_hlcm_contract where fiscurrentversion = '1' ) v on v.fermanfileid = person.fid and v.r = 1 -- 劳动合同档案\n");
|
|
|
|
+ sb.append(" left join t_hbss_signcompany w on w.fid = v.fsigncompanyid -- 聘用单位 \n");
|
|
sb.append(" where person.fiscurrentversion = '1' \n");
|
|
sb.append(" where person.fiscurrentversion = '1' \n");
|
|
sb.append(" and person.fbusinessstatus = '1' \n");
|
|
sb.append(" and person.fbusinessstatus = '1' \n");
|
|
return sb;
|
|
return sb;
|