INSERT INTO hrm_payroll (year, month, status, processed_by, processed_at) VALUES (#{year}, #{month}, #{status}, #{processedBy}, #{processedAt}) ON CONFLICT (year, month) DO UPDATE SET status=#{status}, processed_at=NOW() UPDATE hrm_payroll SET status=#{status} WHERE id=#{id} INSERT INTO hrm_emp_salaries (emp_id, base_salary, allowances, bonus, effective_date) VALUES (#{empId}, #{baseSalary}, #{allowances}, #{bonus}, #{effectiveDate}) ON CONFLICT (emp_id) DO UPDATE SET base_salary=#{baseSalary}, allowances=#{allowances}, bonus=#{bonus}, effective_date=#{effectiveDate}