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

【OYO】新增调薪明细表需要写报表SQL

XMLWord打印

    • O-OYO-
    • PRO
    • OYO 03版本
    • 基础通用功能
    • 隐藏

      sql:
      select
      hr_employee.employee_number 工号,
      hr_employee.name 员工姓名,
      coalesce(adjustment_type_trans.value,adjustment_type.name) 调整类型,
      coalesce(adjustment_reason_trans.value,adjustment_reason.name) 调整原因,
      salary_adjustment.effective_date 生效日期,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA004' then compensation_adjustment_line.before_adjustment else 0 end) 调整前BasicSalary,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA006' then compensation_adjustment_line.before_adjustment else 0 end) 调整前GradeAllowance,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA007' then compensation_adjustment_line.before_adjustment else 0 end) 调整前PositionAllowance,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA008' then compensation_adjustment_line.before_adjustment else 0 end) 调整前DispatchAllowance,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA004' then compensation_adjustment_line.after_amount else 0 end) 调整后BasicSalary,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA006' then compensation_adjustment_line.after_amount else 0 end) 调整后GradeAllowance,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA007' then compensation_adjustment_line.after_amount else 0 end) 调整后PositionAllowance,
      sum(case when compensation_adjustment_line.archive_config_rel_code='PA008' then compensation_adjustment_line.after_amount else 0 end) 调整后DispatchAllowance
      from salary_adjustment
      left join hr_employee on salary_adjustment.employee_id=hr_employee.id
      left join adjustment_type on salary_adjustment.adjustment_type= adjustment_type.id
      left join ir_translation adjustment_type_trans on adjustment_type_trans.res_id=adjustment_type.id
      and adjustment_type_trans.name ='adjustment.type,name'
      and adjustment_type_trans.lang='zh_CN'
      left join adjustment_reason on salary_adjustment.adjustment_reason=adjustment_reason.id
      left join ir_translation adjustment_reason_trans on adjustment_type_trans.res_id=adjustment_reason.id
      and adjustment_reason_trans.name ='adjustment.reason,name'
      and adjustment_reason_trans.lang='zh_CN'
      left join compensation_adjustment_line on compensation_adjustment_line.job_adjustment_id=salary_adjustment.id

      where salary_adjustment.x_bp_state='done'
      and salary_adjustment.active='True'
      group by
      hr_employee.employee_number,
      hr_employee.name,
      coalesce(adjustment_type_trans.value,adjustment_type.name),
      coalesce(adjustment_reason_trans.value,adjustment_reason.name),
      salary_adjustment.effective_date

      显示
      sql: select hr_employee.employee_number 工号, hr_employee.name 员工姓名, coalesce(adjustment_type_trans.value,adjustment_type.name) 调整类型, coalesce(adjustment_reason_trans.value,adjustment_reason.name) 调整原因, salary_adjustment.effective_date 生效日期, sum(case when compensation_adjustment_line.archive_config_rel_code='PA004' then compensation_adjustment_line.before_adjustment else 0 end) 调整前BasicSalary, sum(case when compensation_adjustment_line.archive_config_rel_code='PA006' then compensation_adjustment_line.before_adjustment else 0 end) 调整前GradeAllowance, sum(case when compensation_adjustment_line.archive_config_rel_code='PA007' then compensation_adjustment_line.before_adjustment else 0 end) 调整前PositionAllowance, sum(case when compensation_adjustment_line.archive_config_rel_code='PA008' then compensation_adjustment_line.before_adjustment else 0 end) 调整前DispatchAllowance, sum(case when compensation_adjustment_line.archive_config_rel_code='PA004' then compensation_adjustment_line.after_amount else 0 end) 调整后BasicSalary, sum(case when compensation_adjustment_line.archive_config_rel_code='PA006' then compensation_adjustment_line.after_amount else 0 end) 调整后GradeAllowance, sum(case when compensation_adjustment_line.archive_config_rel_code='PA007' then compensation_adjustment_line.after_amount else 0 end) 调整后PositionAllowance, sum(case when compensation_adjustment_line.archive_config_rel_code='PA008' then compensation_adjustment_line.after_amount else 0 end) 调整后DispatchAllowance from salary_adjustment left join hr_employee on salary_adjustment.employee_id=hr_employee.id left join adjustment_type on salary_adjustment.adjustment_type= adjustment_type.id left join ir_translation adjustment_type_trans on adjustment_type_trans.res_id=adjustment_type.id and adjustment_type_trans.name ='adjustment.type,name' and adjustment_type_trans.lang='zh_CN' left join adjustment_reason on salary_adjustment.adjustment_reason=adjustment_reason.id left join ir_translation adjustment_reason_trans on adjustment_type_trans.res_id=adjustment_reason.id and adjustment_reason_trans.name ='adjustment.reason,name' and adjustment_reason_trans.lang='zh_CN' left join compensation_adjustment_line on compensation_adjustment_line.job_adjustment_id=salary_adjustment.id where salary_adjustment.x_bp_state='done' and salary_adjustment.active='True' group by hr_employee.employee_number, hr_employee.name, coalesce(adjustment_type_trans.value,adjustment_type.name), coalesce(adjustment_reason_trans.value,adjustment_reason.name), salary_adjustment.effective_date

      客户要求新增【调薪明细表】报表,
      所需的报表字段为:员工工号,员工姓名姓名,调整类型,调整原因,生效日期,调整前Basic Salary,调整前Grade Allowance,调整前Position Allowance,调整前Dispatch Allowance,调整后Basic Salary,调整后Grade Allowance,调整后Position Allowance,调整后Dispatch Allowance,审批状态

      调薪明细表走的人事事件流程是调岗调薪下的薪资调整流程,配置可以参考现在的调岗调薪明细表

            grant.yang 杨光磊
            brenda.wen 温新
            表决:
            0 为这个问题表决

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

                预估时间:
                初始预估 - 尚未指定
                尚未指定
                剩余:
                剩余的估算 - 0小时
                0小时
                实际工作时间:
                耗费时间 - 2小时
                2小时