t
.
id
, t.employee_id
, t.tax_agent_id
, t.declare_month
, t.business_healthy_insurance
, t.tax_delay_endowment_insurance
, t.other_deduction
, t.deduction_allowed_donation
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
INSERT INTO hrsa_other_deduction
id,
employee_id,
tax_agent_id,
declare_month,
business_healthy_insurance,
tax_delay_endowment_insurance,
other_deduction,
deduction_allowed_donation,
create_time,
update_time,
creator,
delete_type,
tenant_key,
#{id},
#{employeeId},
#{taxAgentId},
#{declareMonth},
#{businessHealthyInsurance},
#{taxDelayEndowmentInsurance},
#{otherDeduction},
#{deductionAllowedDonation},
#{createTime},
#{updateTime},
#{creator},
#{deleteType},
#{tenantKey},
select hrsa_other_deduction_id.currval from dual
INSERT INTO hrsa_other_deduction
id,
employee_id,
tax_agent_id,
declare_month,
business_healthy_insurance,
tax_delay_endowment_insurance,
other_deduction,
deduction_allowed_donation,
create_time,
update_time,
creator,
delete_type,
tenant_key,
#{id},
#{employeeId},
#{taxAgentId},
#{declareMonth},
#{businessHealthyInsurance},
#{taxDelayEndowmentInsurance},
#{otherDeduction},
#{deductionAllowedDonation},
#{createTime},
#{updateTime},
#{creator},
#{deleteType},
#{tenantKey},
UPDATE hrsa_other_deduction
employee_id=#{employeeId},
tax_agent_id=#{taxAgentId},
declare_month=#{declareMonth},
business_healthy_insurance=#{businessHealthyInsurance},
tax_delay_endowment_insurance=#{taxDelayEndowmentInsurance},
other_deduction=#{otherDeduction},
deduction_allowed_donation=#{deductionAllowedDonation},
create_time=#{createTime},
update_time=#{updateTime},
creator=#{creator},
delete_type=#{deleteType},
tenant_key=#{tenantKey},
WHERE id = #{id} AND delete_type = 0
UPDATE hrsa_other_deduction
employee_id=#{employeeId},
tax_agent_id=#{taxAgentId},
declare_month=#{declareMonth},
business_healthy_insurance=#{businessHealthyInsurance},
tax_delay_endowment_insurance=#{taxDelayEndowmentInsurance},
other_deduction=#{otherDeduction},
deduction_allowed_donation=#{deductionAllowedDonation},
create_time=#{createTime},
update_time=#{updateTime},
creator=#{creator},
delete_type=#{deleteType},
tenant_key=#{tenantKey},
WHERE id = #{id} AND delete_type = 0
UPDATE hrsa_other_deduction
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
t1
.
id
,
t1.declare_month,
t1.employee_id,
t2.name AS tax_agent_name,
e.lastname as username,
d.departmentname AS departmentName,
e.mobile,
e.workcode as job_num,
e.companystartdate as hiredate,
t1.business_healthy_insurance,
t1.tax_delay_endowment_insurance,
t1.other_deduction,
t1.deduction_allowed_donation
AND t1.id IN
#{id}
AND t1.employee_id = #{param.employeeId}
AND
(
e.lastname like CONCAT('%',#{param.keyword},'%')
OR d.departmentname like CONCAT('%',#{param.keyword},'%')
OR e.workcode like CONCAT('%',#{param.keyword},'%')
)
AND t1.declare_month = #{param.declareMonth[0]}
AND (t1.declare_month BETWEEN #{param.declareMonth[0]} AND #{param.declareMonth[1]})
AND e.lastname like CONCAT('%',#{param.username},'%')
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.workcode like CONCAT('%',#{param.jobNum},'%')
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like CONCAT('%',#{param.mobile},'%')
AND t1.id IN
#{id}
AND t1.employee_id = #{param.employeeId}
AND
(
e.lastname like '%'||#{param.keyword}||'%'
OR d.departmentname like '%'||#{param.keyword}||'%'
OR e.workcode like '%'||#{param.keyword}||'%'
)
AND t1.declare_month = #{param.declareMonth[0]}
AND (t1.declare_month BETWEEN #{param.declareMonth[0]} AND #{param.declareMonth[1]})
AND e.lastname like '%'||#{param.username}||'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.workcode like '%'||#{param.jobNum}||'%'
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like '%'||#{param.mobile}||'%'
AND t1.id IN
#{id}
AND t1.employee_id = #{param.employeeId}
AND
(
e.lastname like '%'+#{param.keyword}+'%'
OR d.departmentname like '%'+#{param.keyword}+'%'
OR e.workcode like '%'+#{param.keyword}+'%'
)
AND t1.declare_month = #{param.declareMonth[0]}
AND (t1.declare_month BETWEEN #{param.declareMonth[0]} AND #{param.declareMonth[1]})
AND e.lastname like '%'+#{param.username}+'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.workcode like '%'+#{param.jobNum}+'%'
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like '%'+#{param.mobile}+'%'
INSERT INTO hrsa_other_deduction(
employee_id,
tax_agent_id,
declare_month,
business_healthy_insurance,
tax_delay_endowment_insurance,
other_deduction,
deduction_allowed_donation,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.employeeId},
#{item.taxAgentId},
#{item.declareMonth},
#{item.businessHealthyInsurance},
#{item.taxDelayEndowmentInsurance},
#{item.otherDeduction},
#{item.deductionAllowedDonation},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
)
INSERT INTO hrsa_other_deduction(
employee_id,
tax_agent_id,
declare_month,
business_healthy_insurance,
tax_delay_endowment_insurance,
other_deduction,
deduction_allowed_donation,
create_time,
update_time,
creator,
tenant_key
)
select
#{item.employeeId},
#{item.taxAgentId},
#{item.declareMonth},
#{item.businessHealthyInsurance},
#{item.taxDelayEndowmentInsurance},
#{item.otherDeduction},
#{item.deductionAllowedDonation},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
from dual
INSERT INTO hrsa_other_deduction(
employee_id,
tax_agent_id,
declare_month,
business_healthy_insurance,
tax_delay_endowment_insurance,
other_deduction,
deduction_allowed_donation,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.employeeId},
#{item.taxAgentId},
#{item.declareMonth},
#{item.businessHealthyInsurance},
#{item.taxDelayEndowmentInsurance},
#{item.otherDeduction},
#{item.deductionAllowedDonation},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
)
update hrsa_other_deduction
when id=#{item.id} then #{item.businessHealthyInsurance}
when id=#{item.id} then #{item.taxDelayEndowmentInsurance}
when id=#{item.id} then #{item.otherDeduction}
when id=#{item.id} then #{item.deductionAllowedDonation}
where
id in
#{item.id}