left join t_salary_standard s on s.id = a.SALARY_FORM_ID
left join hrms.t_settle_domain d on d.id = a.SETTLE_DEPART_ID
left join hrms.t_customer_info i on i.id = d.CUSTOMER_ID
left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary'
left join t_salary_account_item exemptionPersionTax on exemptionPersionTax.SALARY_ACCOUNT_ID = a.id and exemptionPersionTax.JAVA_FIED_NAME='exemptionPersionTax'
left join t_salary_account_item costReduction on costReduction.SALARY_ACCOUNT_ID = a.id and costReduction.JAVA_FIED_NAME='costReduction'
left join t_salary_account_item sumChildEduMoney on sumChildEduMoney.SALARY_ACCOUNT_ID = a.id and sumChildEduMoney.JAVA_FIED_NAME='sumChildEduMoney'
left join t_salary_account_item sumHousingLoanMoney on sumHousingLoanMoney.SALARY_ACCOUNT_ID = a.id and sumHousingLoanMoney.JAVA_FIED_NAME='sumHousingLoanMoney'
left join t_salary_account_item sumHousingRentMoney on sumHousingRentMoney.SALARY_ACCOUNT_ID = a.id and sumHousingRentMoney.JAVA_FIED_NAME='sumHousingRentMoney'
left join t_salary_account_item sumSupportElderlyMoney on sumSupportElderlyMoney.SALARY_ACCOUNT_ID = a.id and sumSupportElderlyMoney.JAVA_FIED_NAME='sumSupportElderlyMoney'
left join t_salary_account_item sumContinuingEducationMoney on sumContinuingEducationMoney.SALARY_ACCOUNT_ID = a.id and sumContinuingEducationMoney.JAVA_FIED_NAME='sumContinuingEducationMoney'
left join t_salary_account_item sumBabyMoney on sumBabyMoney.SALARY_ACCOUNT_ID = a.id and sumBabyMoney.JAVA_FIED_NAME='sumBabyMoney'
left join t_salary_account_item personalSocial on personalSocial.SALARY_ACCOUNT_ID = a.id and personalSocial.JAVA_FIED_NAME='personalSocial'
left join t_salary_account_item personalFund on personalFund.SALARY_ACCOUNT_ID = a.id and personalFund.JAVA_FIED_NAME='personalFund'
left join t_salary_account_item withholidingPersonSocial on withholidingPersonSocial.SALARY_ACCOUNT_ID = a.id and withholidingPersonSocial.JAVA_FIED_NAME='withholidingPersonSocial'
left join t_salary_account_item withholidingPersonFund on withholidingPersonFund.SALARY_ACCOUNT_ID = a.id and withholidingPersonFund.JAVA_FIED_NAME='withholidingPersonFund'
left join t_salary_account_item actualSalarySum on actualSalarySum.SALARY_ACCOUNT_ID = a.id and actualSalarySum.JAVA_FIED_NAME='actualSalarySum'
left join t_salary_account_item salaryTax on salaryTax.SALARY_ACCOUNT_ID = a.id and salaryTax.JAVA_FIED_NAME='salaryTax'
left join t_salary_account_item specialDeduMoney on specialDeduMoney.SALARY_ACCOUNT_ID = a.id and specialDeduMoney.JAVA_FIED_NAME='specialDeduMoney'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item annualBonusTax on annualBonusTax.SALARY_ACCOUNT_ID = a.id and annualBonusTax.JAVA_FIED_NAME='annualBonusTax'
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME='annualBonus'
where
a.SETTLEMENT_MONTH = #{lastMonth} and a.DELETE_FLAG = 0 and a.SALARY_TYPE != '7' and a.SALARY_TYPE != '3'
and s.DELETE_FLAG = 0
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,a.SETTLEMENT_MONTH)