select pay.id ,
'01234567890' as payAccountNo,
'0123456789' as payCustomerNo,
'上海美都环卫服务有限公司' as accountName,
pay.paymentamount amount,
extra.account as  receiveAccountNo,
case when LENGTH(extra.unitname) > 0 then extra.unitname
	else supplier.unit_name  end as receiveAccountName,
extra.deposit_bank as receiveAcountBank,
'01' as currency,
CASE
	WHEN instr( extra.deposit_bank, '光大' ) > 0 THEN
	'0' ELSE '1' end AS transferType,
<#-- 跨行汇款--> 
'0' as payType,
<#-- 非紧急--> 
'0' as urgent,
<#-- 付款用途--> 
'服务进度款' as usefor,
<#-- 单位账户--> 
'0' as accountSign,
extra.linkbankno as receiveAcountBankNo
from t_b_contract_payment pay 
left join t_b_related_units supplier on pay.partnerid = supplier.id
left join t_b_related_units_extrainfo extra on  pay.partnerid = extra.related_units_id
where pay.paystatus = '0'
	<#if ( applyIDs )?? && applyIDs ?size gt 0>
		and pay.id in( 
			<#list applyIDs as item>  
				 '${item}' 
				 <#if item_has_next>,</#if> 
			</#list> 
			) 
	</#if> 
