<iftest="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
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 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
</if>
<iftest="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() < '202201' ">
t_salary_account_hro_2021 a
left join t_salary_account_item_hro_2021 enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item_hro_2021 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,a.BANK_NO as bankNo
,a.BANK_NAME as bankName
,if(a.ANNUAL_BONUS_TYPE='1','单独','合并') as annualBonusType
,ap.AREA_NAME as bankProvince
,ac.AREA_NAME as bankCity
,a.BANK_SUB_NAME as bankSubName
,if(a.SALARY_STYLE='0','现金','银行') as salaryStyle
,if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime
,a.DEDU_SOCIAL_MONTH as deduSocialMonth
,a.DEDU_PROVIDENT_MONTH as deduProvidentMonth
,if(a.SOCIAL_PRIORITY='1','缴纳月','生成月') as socialPriority
,if(a.FUND_PRIORITY='1','缴纳月','生成月') as fundPriority
,if(a.IS_DEDUCT_SOCIAL='0','否','是') as isDeductSocial
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
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 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0