|
|
@@ -522,10 +522,20 @@
|
|
|
</select>
|
|
|
<select id="selectByaidAndType" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccount">
|
|
|
SELECT
|
|
|
- <include refid="selectDtailsSql"/>
|
|
|
+ a.id, a.prid, a.order_no orderNo, o.contract_no contractNo ,tm.buyer_name buyerName, a.aid, a.aname, a.`type`,
|
|
|
+ a.type_other typeOther , a.status,a.process_status processStatus,a.total_amount totalAmount,a.debit_id debitId,
|
|
|
+ a.attachment_url attachmentUrl,a.apply_dep applyDep, a.pay_dep payDep, a.eaaid,a.district_name districtName,
|
|
|
+ a.user_names userNames,a.create_time, a.release_start,a.release_end, a.duration,b.name appDepName,
|
|
|
+ c.name payDepName,d.name ,d.bank ,d.accounts ,t0.amount settlementAmount,
|
|
|
+ a.liquidation_status liquidationStatus, a.remarks,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,
|
|
|
+ date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStartStr,
|
|
|
+ date_format(a.release_end,'%Y-%m-%d %H:%i:%S')releaseEndStr
|
|
|
FROM expense_account a left join department b on a.apply_dep =b.id left join department c on a.pay_dep =c.id
|
|
|
left join expense_account_private d on a.eaaid=d.id left join t_order_new o on a.order_no =o.order_no
|
|
|
left join t_order_mid tm on a.order_no =tm.order_no
|
|
|
+ left join (select debit_id ,sum(settlement_amount) amount from expense_account where debit_id is not null and
|
|
|
+ id != #{id} group by debit_id )t0 on a.id =t0.debit_id
|
|
|
WHERE a.status=2 and a.liquidation_status in (0,1,2)
|
|
|
and a.aid= #{aid} and a.type= #{type} and a.pay_dep= #{depId}
|
|
|
order by a.create_time desc
|