t
.
add_up_accumulation_fund_total
, t.add_up_advance_tax
, t.add_up_allowed_donation
, t.add_up_child_education
, t.add_up_continuing_education
, t.add_up_enterprise_and_other
, t.add_up_housing_loan_interest
, t.add_up_housing_rent
, t.add_up_income
, t.add_up_other_deduction
, t.add_up_social_security_total
, t.add_up_subtraction
, t.add_up_support_elderly
, t.add_up_tax_exempt_income
, t.create_time
, t.creator
, t.delete_type
, t.employee_id
, t.id
, t.tax_agent_id
, t.tax_year_month
, t.tenant_key
, t.update_time
, t.year
INSERT INTO hrsa_add_up_situation
add_up_accumulation_fund_total,
add_up_advance_tax,
add_up_allowed_donation,
add_up_child_education,
add_up_continuing_education,
add_up_enterprise_and_other,
add_up_housing_loan_interest,
add_up_housing_rent,
add_up_income,
add_up_other_deduction,
add_up_social_security_total,
add_up_subtraction,
add_up_support_elderly,
add_up_tax_exempt_income,
create_time,
creator,
delete_type,
employee_id,
id,
tax_agent_id,
tax_year_month,
tenant_key,
update_time,
year,
#{addUpAccumulationFundTotal},
#{addUpAdvanceTax},
#{addUpAllowedDonation},
#{addUpChildEducation},
#{addUpContinuingEducation},
#{addUpEnterpriseAndOther},
#{addUpHousingLoanInterest},
#{addUpHousingRent},
#{addUpIncome},
#{addUpOtherDeduction},
#{addUpSocialSecurityTotal},
#{addUpSubtraction},
#{addUpSupportElderly},
#{addUpTaxExemptIncome},
#{createTime},
#{creator},
#{deleteType},
#{employeeId},
#{id},
#{taxAgentId},
#{taxYearMonth},
#{tenantKey},
#{updateTime},
#{year},
INSERT INTO hrsa_add_up_situation
add_up_accumulation_fund_total,
add_up_advance_tax,
add_up_allowed_donation,
add_up_child_education,
add_up_continuing_education,
add_up_enterprise_and_other,
add_up_housing_loan_interest,
add_up_housing_rent,
add_up_income,
add_up_other_deduction,
add_up_social_security_total,
add_up_subtraction,
add_up_support_elderly,
add_up_tax_exempt_income,
create_time,
creator,
delete_type,
employee_id,
id,
tax_agent_id,
tax_year_month,
tenant_key,
update_time,
year,
#{addUpAccumulationFundTotal},
#{addUpAdvanceTax},
#{addUpAllowedDonation},
#{addUpChildEducation},
#{addUpContinuingEducation},
#{addUpEnterpriseAndOther},
#{addUpHousingLoanInterest},
#{addUpHousingRent},
#{addUpIncome},
#{addUpOtherDeduction},
#{addUpSocialSecurityTotal},
#{addUpSubtraction},
#{addUpSupportElderly},
#{addUpTaxExemptIncome},
#{createTime},
#{creator},
#{deleteType},
#{employeeId},
#{id},
#{taxAgentId},
#{taxYearMonth},
#{tenantKey},
#{updateTime},
#{year},
UPDATE hrsa_add_up_situation
add_up_accumulation_fund_total=#{addUpAccumulationFundTotal},
add_up_advance_tax=#{addUpAdvanceTax},
add_up_allowed_donation=#{addUpAllowedDonation},
add_up_child_education=#{addUpChildEducation},
add_up_continuing_education=#{addUpContinuingEducation},
add_up_enterprise_and_other=#{addUpEnterpriseAndOther},
add_up_housing_loan_interest=#{addUpHousingLoanInterest},
add_up_housing_rent=#{addUpHousingRent},
add_up_income=#{addUpIncome},
add_up_other_deduction=#{addUpOtherDeduction},
add_up_social_security_total=#{addUpSocialSecurityTotal},
add_up_subtraction=#{addUpSubtraction},
add_up_support_elderly=#{addUpSupportElderly},
add_up_tax_exempt_income=#{addUpTaxExemptIncome},
create_time=#{createTime},
creator=#{creator},
delete_type=#{deleteType},
employee_id=#{employeeId},
tax_agent_id=#{taxAgentId},
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
year=#{year},
WHERE id = #{id} AND delete_type = 0
UPDATE hrsa_add_up_situation
add_up_accumulation_fund_total=#{addUpAccumulationFundTotal},
add_up_advance_tax=#{addUpAdvanceTax},
add_up_allowed_donation=#{addUpAllowedDonation},
add_up_child_education=#{addUpChildEducation},
add_up_continuing_education=#{addUpContinuingEducation},
add_up_enterprise_and_other=#{addUpEnterpriseAndOther},
add_up_housing_loan_interest=#{addUpHousingLoanInterest},
add_up_housing_rent=#{addUpHousingRent},
add_up_income=#{addUpIncome},
add_up_other_deduction=#{addUpOtherDeduction},
add_up_social_security_total=#{addUpSocialSecurityTotal},
add_up_subtraction=#{addUpSubtraction},
add_up_support_elderly=#{addUpSupportElderly},
add_up_tax_exempt_income=#{addUpTaxExemptIncome},
create_time=#{createTime},
creator=#{creator},
delete_type=#{deleteType},
employee_id=#{employeeId},
tax_agent_id=#{taxAgentId},
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
year=#{year},
WHERE id = #{id} AND delete_type = 0
UPDATE hrsa_add_up_situation
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
t1
.
id
,
t1.tax_year_month,
t1.employee_id,
e.lastname as username,
d.departmentName AS departmentName,
e.mobile,
e.workcode as job_num,
e.companystartdate as hiredate,
t2.name AS tax_agent_name,
t1.add_up_income,
t1.add_up_subtraction,
t1.add_up_social_security_total,
t1.add_up_accumulation_fund_total,
t1.add_up_child_education,
t1.add_up_continuing_education,
t1.add_up_housing_loan_interest,
t1.add_up_housing_rent,
t1.add_up_support_elderly,
t1.add_up_enterprise_and_other,
t1.add_up_other_deduction,
t1.add_up_tax_exempt_income,
t1.add_up_allowed_donation,
t1.add_up_advance_tax
AND t1.id IN
#{id}
AND t1.year = #{param.year}
AND t1.employee_id = #{param.employeeId}
AND
(
e.username like CONCAT('%',#{param.keyword},'%')
OR d.name like CONCAT('%',#{param.keyword},'%')
OR e.job_num like CONCAT('%',#{param.keyword},'%')
)
AND t1.tax_year_month = #{param.taxYearMonth[0]}
AND (t1.tax_year_month BETWEEN #{param.taxYearMonth[0]} AND #{param.taxYearMonth[1]})
AND e.username like CONCAT('%',#{param.username},'%')
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.job_num like CONCAT('%',#{param.jobNum},'%')
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like CONCAT('%',#{param.mobile},'%')
AND t1.id IN
#{id}
AND t1.year = #{param.year}
AND t1.employee_id = #{param.employeeId}
AND
(
e.username like '%'||#{param.keyword}||'%'
OR d.name like '%'||#{param.keyword}||'%'
OR e.job_num like '%'||#{param.keyword}||'%'
)
AND t1.tax_year_month = #{param.taxYearMonth[0]}
AND (t1.tax_year_month BETWEEN #{param.taxYearMonth[0]} AND #{param.taxYearMonth[1]})
AND e.username like '%'||#{param.username}||'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.job_num like '%'||#{param.jobNum}||'%'
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like '%'||#{param.mobile}||'%'
AND t1.id IN
#{id}
AND t1.year = #{param.year}
AND t1.employee_id = #{param.employeeId}
AND
(
e.username like '%'+#{param.keyword}+'%'
OR d.name like '%'+#{param.keyword}+'%'
OR e.job_num like '%'+#{param.keyword}+'%'
)
AND t1.tax_year_month = #{param.taxYearMonth[0]}
AND (t1.tax_year_month BETWEEN #{param.taxYearMonth[0]} AND #{param.taxYearMonth[1]})
AND e.username like '%'+#{param.username}+'%'
AND t1.tax_agent_id = #{param.taxAgentId}
AND d.id IN
#{id}
AND e.job_num like '%'+#{param.jobNum}+'%'
AND (e.hiredate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
AND e.mobile like '%'+#{param.mobile}+'%'
INSERT INTO hrsa_add_up_situation(
id,
employee_id,
tax_agent_id,
tax_year_month,
year,
add_up_income,
add_up_subtraction,
add_up_social_security_total,
add_up_accumulation_fund_total,
add_up_child_education,
add_up_continuing_education,
add_up_housing_loan_interest,
add_up_housing_rent,
add_up_support_elderly,
add_up_enterprise_and_other,
add_up_other_deduction,
add_up_tax_exempt_income,
add_up_allowed_donation,
add_up_advance_tax,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.taxAgentId},
#{item.taxYearMonth},
#{item.year},
#{item.addUpIncome},
#{item.addUpSubtraction},
#{item.addUpSocialSecurityTotal},
#{item.addUpAccumulationFundTotal},
#{item.addUpChildEducation},
#{item.addUpContinuingEducation},
#{item.addUpHousingLoanInterest},
#{item.addUpHousingRent},
#{item.addUpSupportElderly},
#{item.addUpEnterpriseAndOther},
#{item.addUpOtherDeduction},
#{item.addUpTaxExemptIncome},
#{item.addUpAllowedDonation},
#{item.addUpAdvanceTax},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
)
INSERT INTO hrsa_add_up_situation(
id,
employee_id,
tax_agent_id,
tax_year_month,
year,
add_up_income,
add_up_subtraction,
add_up_social_security_total,
add_up_accumulation_fund_total,
add_up_child_education,
add_up_continuing_education,
add_up_housing_loan_interest,
add_up_housing_rent,
add_up_support_elderly,
add_up_enterprise_and_other,
add_up_other_deduction,
add_up_tax_exempt_income,
add_up_allowed_donation,
add_up_advance_tax,
create_time,
update_time,
creator,
tenant_key
)
select
#{item.id},
#{item.employeeId},
#{item.taxAgentId},
#{item.taxYearMonth},
#{item.year},
#{item.addUpIncome},
#{item.addUpSubtraction},
#{item.addUpSocialSecurityTotal},
#{item.addUpAccumulationFundTotal},
#{item.addUpChildEducation},
#{item.addUpContinuingEducation},
#{item.addUpHousingLoanInterest},
#{item.addUpHousingRent},
#{item.addUpSupportElderly},
#{item.addUpEnterpriseAndOther},
#{item.addUpOtherDeduction},
#{item.addUpTaxExemptIncome},
#{item.addUpAllowedDonation},
#{item.addUpAdvanceTax},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
from dual
INSERT INTO hrsa_add_up_situation(
id,
employee_id,
tax_agent_id,
tax_year_month,
year,
add_up_income,
add_up_subtraction,
add_up_social_security_total,
add_up_accumulation_fund_total,
add_up_child_education,
add_up_continuing_education,
add_up_housing_loan_interest,
add_up_housing_rent,
add_up_support_elderly,
add_up_enterprise_and_other,
add_up_other_deduction,
add_up_tax_exempt_income,
add_up_allowed_donation,
add_up_advance_tax,
create_time,
update_time,
creator,
tenant_key
)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.taxAgentId},
#{item.taxYearMonth},
#{item.year},
#{item.addUpIncome},
#{item.addUpSubtraction},
#{item.addUpSocialSecurityTotal},
#{item.addUpAccumulationFundTotal},
#{item.addUpChildEducation},
#{item.addUpContinuingEducation},
#{item.addUpHousingLoanInterest},
#{item.addUpHousingRent},
#{item.addUpSupportElderly},
#{item.addUpEnterpriseAndOther},
#{item.addUpOtherDeduction},
#{item.addUpTaxExemptIncome},
#{item.addUpAllowedDonation},
#{item.addUpAdvanceTax},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.tenantKey}
)
update hrsa_add_up_situation
when id=#{item.id} then #{item.addUpIncome}
when id=#{item.id} then #{item.addUpSubtraction}
when id=#{item.id} then #{item.addUpSocialSecurityTotal}
when id=#{item.id} then #{item.addUpAccumulationFundTotal}
when id=#{item.id} then #{item.addUpChildEducation}
when id=#{item.id} then #{item.addUpContinuingEducation}
when id=#{item.id} then #{item.addUpHousingLoanInterest}
when id=#{item.id} then #{item.addUpHousingRent}
when id=#{item.id} then #{item.addUpSupportElderly}
when id=#{item.id} then #{item.addUpEnterpriseAndOther}
when id=#{item.id} then #{item.addUpOtherDeduction}
when id=#{item.id} then #{item.addUpTaxExemptIncome}
when id=#{item.id} then #{item.addUpAllowedDonation}
when id=#{item.id} then #{item.addUpAdvanceTax}
where
id in
#{item.id}