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
, t.private_pension
, t.free_income
, t.derate_deduction
UPDATE hrsa_other_deduction
SET delete_type = 1
WHERE delete_type = 0
AND id IN
#{id}
UPDATE hrsa_other_deduction
SET delete_type=1
WHERE id = #{id} AND delete_type = 0
t1
.
id
,
t1.declare_month,
t1.employee_id,
t2.id AS tax_agent_id,
t2.name AS tax_agent_name,
e.lastname as username,
e.certificatenum as idNo,
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,
t1.private_pension,
t1.free_income,
t1.derate_deduction
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.declareMonthDate[0]}
AND (t1.declare_month BETWEEN #{param.declareMonthDate[0]} AND #{param.declareMonthDate[1]})
AND e.lastname like CONCAT('%',#{param.username},'%')
AND t1.tax_agent_id = #{param.taxAgentId}
AND t1.tax_agent_id IN
#{id}
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.declareMonthDate[0]}
AND (t1.declare_month BETWEEN #{param.declareMonthDate[0]} AND #{param.declareMonthDate[1]})
AND e.lastname like '%'||#{param.username}||'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND t1.tax_agent_id IN
#{id}
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.declareMonthDate[0]}
AND (t1.declare_month BETWEEN #{param.declareMonthDate[0]} AND #{param.declareMonthDate[1]})
AND e.lastname like '%'+#{param.username}+'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND t1.tax_agent_id IN
#{id}
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,
private_pension,
free_income,
derate_deduction,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.employeeId},
#{item.taxAgentId},
#{item.declareMonth},
#{item.businessHealthyInsurance},
#{item.taxDelayEndowmentInsurance},
#{item.otherDeduction},
#{item.deductionAllowedDonation},
#{item.privatePension},
#{item.freeIncome},
#{item.derateDeduction},
#{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,
private_pension,
free_income,
derate_deduction,
create_time,
update_time,
creator,
tenant_key
)
select
#{item.employeeId,jdbcType=DOUBLE},
#{item.taxAgentId,jdbcType=DOUBLE},
#{item.declareMonth,jdbcType=DATE},
#{item.businessHealthyInsurance,jdbcType=VARCHAR},
#{item.taxDelayEndowmentInsurance,jdbcType=VARCHAR},
#{item.otherDeduction,jdbcType=VARCHAR},
#{item.deductionAllowedDonation,jdbcType=VARCHAR},
#{item.privatePension,jdbcType=VARCHAR},
#{item.freeIncome,jdbcType=VARCHAR},
#{item.derateDeduction,jdbcType=VARCHAR},
#{item.createTime,jdbcType=DATE},
#{item.updateTime,jdbcType=DATE},
#{item.creator,jdbcType=DOUBLE},
#{item.tenantKey,jdbcType=VARCHAR}
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,
private_pension,
free_income,
derate_deduction,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.employeeId},
#{item.taxAgentId},
#{item.declareMonth},
#{item.businessHealthyInsurance},
#{item.taxDelayEndowmentInsurance},
#{item.otherDeduction},
#{item.deductionAllowedDonation},
#{item.privatePension},
#{item.freeIncome},
#{item.derateDeduction},
#{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}
when id=#{item.id} then #{item.privatePension}
when id=#{item.id} then #{item.freeIncome}
when id=#{item.id} then #{item.derateDeduction}
when id=#{item.id} then #{item.updateTime}
where
id in
#{item.id}
INSERT INTO hrsa_other_deduction
business_healthy_insurance,
create_time,
creator,
declare_month,
deduction_allowed_donation,
delete_type,
derate_deduction,
employee_id,
free_income,
other_deduction,
private_pension,
tax_agent_id,
tax_delay_endowment_insurance,
tenant_key,
update_time,
#{businessHealthyInsurance},
#{createTime},
#{creator},
#{declareMonth},
#{deductionAllowedDonation},
#{deleteType},
#{derateDeduction},
#{employeeId},
#{freeIncome},
#{otherDeduction},
#{privatePension},
#{taxAgentId},
#{taxDelayEndowmentInsurance},
#{tenantKey},
#{updateTime},
select hrsa_other_deduction_id.currval from dual
INSERT INTO hrsa_other_deduction
business_healthy_insurance,
create_time,
creator,
declare_month,
deduction_allowed_donation,
delete_type,
derate_deduction,
employee_id,
free_income,
other_deduction,
private_pension,
tax_agent_id,
tax_delay_endowment_insurance,
tenant_key,
update_time,
#{businessHealthyInsurance},
#{createTime},
#{creator},
#{declareMonth},
#{deductionAllowedDonation},
#{deleteType},
#{derateDeduction},
#{employeeId},
#{freeIncome},
#{otherDeduction},
#{privatePension},
#{taxAgentId},
#{taxDelayEndowmentInsurance},
#{tenantKey},
#{updateTime},