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}
UPDATE hrsa_social_archives
SET delete_type = 1
WHERE employee_id = #{param.employeeId}
AND payment_organization = #{param.paymentOrganization}
AND delete_type = 0
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,jdbcType=INTEGER},
#{item.deleteType,jdbcType=INTEGER},
#{item.socialPaymentBaseString,jdbcType=VARCHAR},
#{item.socialSchemeId,jdbcType=DOUBLE},
#{item.createTime,jdbcType=DATE},
#{item.socialEndTime,jdbcType=VARCHAR},
#{item.socialStartTime,jdbcType=VARCHAR},
#{item.creator,jdbcType=DOUBLE},
#{item.nonPayment,jdbcType=INTEGER},
#{item.tenantKey,jdbcType=VARCHAR},
#{item.employeeId,jdbcType=DOUBLE},
#{item.updateTime,jdbcType=DATE},
#{item.underTake,jdbcType=INTEGER},
#{item.socialAccount,jdbcType=VARCHAR},
#{item.paymentOrganization,jdbcType=DOUBLE}
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
(
e.lastname like CONCAT('%',#{param.keyword},'%')
)
AND e.lastname like CONCAT('%',#{param.userName},'%')
AND e.workcode like CONCAT('%',#{param.jobNum},'%')
AND e.departmentid IN
#{departmentId}
AND e.subcompanyid1 IN
#{subcompanyId}
AND e.STATUS IN
#{userStatus}
AND e.jobtitle IN
#{position}
AND e.companystartdate > #{param.hiredateStart}
AND e.companystartdate < #{param.hiredateEnd}
AND e.enddate > #{param.dimissionDateStart}
AND e.enddate < #{param.dimissionDateEnd}
AND siSchemeId = #{param.siSchemeId}
AND fundSchemeId = #{param.fundSchemeId}
AND otherSchemeId = #{param.otherSchemeId}
AND base.run_status IN
#{runStatus}
AND e.ID IN
#{item}
AND base.id IN
#{item}
AND
(
e.lastname like '%'+#{param.keyword}+'%'
)
AND e.lastname like '%'+#{param.userName}+'%'
AND e.workcode like '%'+#{param.jobNum}+'%'
AND e.departmentid IN
#{departmentId}
AND e.subcompanyid1 IN
#{subcompanyId}
AND e.STATUS IN
#{userStatus}
AND e.jobtitle IN
#{position}
AND e.companystartdate > #{param.hiredateStart}
AND e.companystartdate < #{param.hiredateEnd}
AND e.enddate > #{param.dimissionDateStart}
AND e.enddate < #{param.dimissionDateEnd}
AND siSchemeId = #{param.siSchemeId}
AND fundSchemeId = #{param.fundSchemeId}
AND otherSchemeId = #{param.otherSchemeId}
AND base.run_status IN
#{runStatus}
AND e.ID IN
#{item}
AND base.id IN
#{item}
AND
(
e.lastname like '%'||#{param.keyword}||'%'
)
AND e.lastname like '%'||#{param.userName}||'%'
AND e.workcode like '%'||#{param.jobNum}||'%'
AND e.departmentid IN
#{departmentId}
AND e.subcompanyid1 IN
#{subcompanyId}
AND e.STATUS IN
#{userStatus}
AND e.jobtitle IN
#{position}
AND e.companystartdate > #{param.hiredateStart}
AND e.companystartdate < #{param.hiredateEnd}
AND e.enddate > #{param.dimissionDateStart}
AND e.enddate < #{param.dimissionDateEnd}
AND siSchemeId = #{param.siSchemeId}
AND fundSchemeId = #{param.fundSchemeId}
AND otherSchemeId = #{param.otherSchemeId}
AND base.run_status IN
#{runStatus}
AND e.ID IN
#{item}
AND base.id IN
#{item}
update hrsa_social_archives
when id=#{item.id} then #{item.socialPaymentBaseString}
when id=#{item.id} then #{item.deleteType}
where
id in
#{item.id}
UPDATE hrsa_social_archives
SET social_end_time = #{endTime}
WHERE delete_type = 0
AND id IN
#{id}
UPDATE hrsa_social_archives
welfare_type = #{welfareType},
social_payment_base_string = #{socialPaymentBaseString},
social_scheme_id = #{socialSchemeId},
social_end_time = #{socialEndTime},
social_start_time = #{socialStartTime},
non_payment = #{nonPayment},
tenant_key = #{tenantKey},
employee_id = #{employeeId},
update_time = #{updateTime},
under_take = #{underTake},
social_account = #{socialAccount},
payment_organization = #{paymentOrganization},
WHERE id = #{id} AND delete_type = 0