t.id
, t.employee_id
, t.non_payment
, t.welfare_type
, t.social_start_time
, t.social_end_time
, t.social_scheme_id
, t.social_account
, t.payment_organization
, t.under_take
, t.social_payment_base_string
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
UPDATE hrsa_social_archives
SET delete_type = 1
WHERE delete_type = 0
AND employee_id IN
#{employeeId}
INSERT INTO hrsa_social_archives(
welfare_type,
delete_type,
social_payment_base_string,
social_scheme_id,
create_time,
social_end_time,
social_start_time,
creator,
non_payment,
tenant_key,
employee_id,
update_time,
under_take,
social_account,
payment_organization)
VALUES
(
#{item.welfareType},
#{item.deleteType},
#{item.socialPaymentBaseString},
#{item.socialSchemeId},
#{item.createTime},
#{item.socialEndTime}
#{item.socialStartTime}
#{item.creator}
#{item.nonPayment}
#{item.tenantKey}
#{item.employeeId}
#{item.updateTime}
#{item.underTake}
#{item.socialAccount}
#{item.paymentOrganization}
)
INSERT INTO hrsa_social_archives(
welfare_type,
delete_type,
social_payment_base_string,
social_scheme_id,
create_time,
social_end_time,
social_start_time,
creator,
non_payment,
tenant_key,
employee_id,
update_time,
under_take,
social_account,
payment_organization)
select
#{item.welfareType},
#{item.deleteType},
#{item.socialPaymentBaseString},
#{item.socialSchemeId},
#{item.createTime},
#{item.socialEndTime}
#{item.socialStartTime}
#{item.creator}
#{item.nonPayment}
#{item.tenantKey}
#{item.employeeId}
#{item.updateTime}
#{item.underTake}
#{item.socialAccount}
#{item.paymentOrganization}
from dual
INSERT INTO hrsa_social_archives(
welfare_type,
delete_type,
social_payment_base_string,
social_scheme_id,
create_time,
social_end_time,
social_start_time,
creator,
non_payment,
tenant_key,
employee_id,
update_time,
under_take,
social_account,
payment_organization)
VALUES
(
#{item.welfareType},
#{item.deleteType},
#{item.socialPaymentBaseString},
#{item.socialSchemeId},
#{item.createTime},
#{item.socialEndTime}
#{item.socialStartTime}
#{item.creator}
#{item.nonPayment}
#{item.tenantKey}
#{item.employeeId}
#{item.updateTime}
#{item.underTake}
#{item.socialAccount}
#{item.paymentOrganization}
)
AND
(
a.lastname like CONCAT('%',#{param.keyword},'%')
OR a.workcode like CONCAT('%',#{param.keyword},'%')
)
AND
(
e.lastname like '%'||#{param.keyword}||'%'
OR e.workcode like '%'||#{param.keyword}||'%'
)
AND
(
e.lastname like '%'+#{param.keyword}+'%'
OR e.workcode like '%'+#{param.keyword}+'%'
)
AND a.departmentid IN
#{departmentId}
AND a.status IN
#{status}
AND a.jobtitle IN
#{position}
AND a.companystartdate between #{param.hiredateStart} and #{param.hiredateEnd}
AND f.dismissdate between #{param.dimissionDateStart} and #{param.dimissionDateEnd}
AND c.social_scheme_id = #{param.siSchemeId}
AND d.fund_scheme_id = #{param.fundSchemeId}
AND e.other_scheme_id = #{param.otherSchemeId}
AND
(
userName like CONCAT('%',#{param.keyword},'%')
OR jobNum = #{param.keyword}
)
AND userName like CONCAT('%',#{param.userName},'%')
AND jobNum = #{param.jobNum}
AND departmentId IN
#{departmentId}
AND userStatus IN
#{userStatus}
AND position IN
#{position}
AND hiredate > #{param.hiredateStart}
AND hiredate < #{param.hiredateEnd}
AND dimissionDate > #{param.dimissionDateStart}
AND dimissionDate < #{param.dimissionDateEnd}
AND siSchemeId = #{param.siSchemeId}
AND fundSchemeId = #{param.fundSchemeId}
AND otherSchemeId = #{param.otherSchemeId}
AND employeeId IN
#{item}