weaver-hrm-salary/resource/sqlupgrade/Mysql/sql202406180403.sql

29 lines
1.0 KiB
SQL

update hrsa_salary_acct_emp a INNER JOIN (
select e.id as employeeId,
d.departmentname as departmentName,
d.id as departmentId,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.status as status,
e.jobcall as jobcallId,
job.name as jobcall
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join hrmjobtitles c on e.jobtitle = c.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobcall job on e.jobcall=job.id
where e.status not in (7) and (e.accounttype is null or e.accounttype = 0)
) as b
on a.employee_id = b.employeeId
set a.department_id = b.departmentId,
a.department_name = b.departmentName,
a.subcompany_id = b.subcompanyid,
a.subcompany_name = b.subcompanyName,
a.jobtitle_id = b.jobtitleId,
a.jobtitle_name = b.jobtitleName,
a.jobcall_id = b.jobcallId,
a.jobcall = b.jobcall,
a.status = b.status
where a.delete_type=0;