上传的图像用于项目: 'CST技术支持'
  1. CST技术支持
  2. SLAL2-802

续签合同有效时间报表

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202007
    • Y-易路产品-
    • timschina
    • 基础通用功能
    • 隐藏
      select 
      b.employee_number as x_employee_number,
      b.name as x_employee_name,
      b_1.name as x_dep_manager,
      b_2.name as x_parent,
      b.hiredate as x_hiredate,
      
      c.name as department_name,
      
      d.name as job_name,
      
      e.name as x_legal_entity,
      
      case f.name when 'Labor Contract' then '劳动合同' when 'None Disclosure Agreement' then '保密协议' when 'Competitive Restriction' then '竞业协议' when 'Service Agreement' then '劳务协议' when '兼职协议' then '兼职协议'  end as x_contract_category,
      a.date_end as x_date_end,
      
      to_number(to_char(a.date_end-now()+ interval '1 days','dd'), '999999999') as x_rest_days
      
      from  hr_contract a 
      left join hr_employee b on a.employee_id=b.id
      left join hr_employee b_1 on a.dep_manager=b_1.id
      left join hr_employee b_2 on a.parent_id=b_2.id
      left join hr_department c on b.department_id=c.id
      left join hr_job d on b.job_id=d.id
      left join legal_entity e on b.legal_entity=e.id
      left join hr_contract_agreement_category f on a.contract_agreement_id=f.id
      where a.state='done' and a.date_end>=now() and a.active=True order by x_rest_days
      
      显示
      select b.employee_number as x_employee_number, b.name as x_employee_name, b_1.name as x_dep_manager, b_2.name as x_parent, b.hiredate as x_hiredate, c.name as department_name, d.name as job_name, e.name as x_legal_entity, case f.name when 'Labor Contract' then '劳动合同' when 'None Disclosure Agreement' then '保密协议' when 'Competitive Restriction' then '竞业协议' when 'Service Agreement' then '劳务协议' when '兼职协议' then '兼职协议' end as x_contract_category, a.date_end as x_date_end, to_number(to_char(a.date_end-now()+ interval '1 days' , 'dd' ), '999999999' ) as x_rest_days from hr_contract a left join hr_employee b on a.employee_id=b.id left join hr_employee b_1 on a.dep_manager=b_1.id left join hr_employee b_2 on a.parent_id=b_2.id left join hr_department c on b.department_id=c.id left join hr_job d on b.job_id=d.id left join legal_entity e on b.legal_entity=e.id left join hr_contract_agreement_category f on a.contract_agreement_id=f.id where a.state= 'done' and a.date_end>=now() and a.active=True order by x_rest_days

      客户希望做一个报表可以看到在职员工有效合同的失效情况,对应字段合同剩余有效天数意思是距离合同有效天数是几天

            chengdd 程丹丹
            wangn 王念
            表决:
            0 为这个问题表决

              创建日期:
              已更新:
              已解决: