|
|
@@ -1079,17 +1079,20 @@
|
|
|
</select>
|
|
|
<!-- 财务专员查看需要待收款的数据 -->
|
|
|
<select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
- select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
- o.process_status as processStatus,ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,o.approval,
|
|
|
- a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
|
|
|
- o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,date_format(o.create_time, '%Y-%m-%d %H:%i:%s') as createTime,e.name as outsourceName,
|
|
|
- 0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName,f.transaction_amount finalReceivables ,
|
|
|
- f.finalReceivablesTime,g.invoiceAmount from t_order_new o left join department d on o.order_dep=d.id left join `user` u on o.buyer_id = u.id
|
|
|
- left join admin a on o.salesman_id = a.id left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new group by order_no ) b
|
|
|
- on b.order_no = o.order_no left join (select order_no,max(name) as name from outsource_organization group by order_no) e
|
|
|
- on o.order_no=e.order_no left join (select transaction_amount ,order_no,date_format(max(create_time), '%Y-%m-%d %H:%i:%s')finalReceivablesTime from t_order_bill_new group by order_no) f
|
|
|
- on o.order_no=f.order_no left join (select order_no ,sum(amount) invoiceAmount from t_order_invoice where status=2 group by order_no ) g
|
|
|
- on o.order_no=g.order_no where delete_sign != 1 and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
+ select
|
|
|
+ o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
+ o.process_status as processStatus, ifnull(b.amount, 0) as actuallyTotalAmount, o.contract_no as contractNo,
|
|
|
+ o.approval, a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
|
|
|
+ o.first_amount as signFirstPayment, o.total_amount as signTotalAmount, date_format(o.create_time, '%Y-%m-%d %H:%i:%s') as createTime,
|
|
|
+ e.name as outsourceName, 0 as companyId, "湖南科德信息咨询有限公司" as companyName, d.name as departmentName,
|
|
|
+ f.transaction_amount finalReceivables , date_format(f.maxTime, '%Y-%m-%d %H:%i:%s')finalReceivablesTime, g.invoiceAmount from t_order_new o
|
|
|
+left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
|
|
|
+left join ( select sum(transaction_amount) as amount , order_no from t_order_bill_new group by order_no ) b on b.order_no = o.order_no
|
|
|
+left join ( select order_no, max(name) as name from outsource_organization group by order_no) e on o.order_no = e.order_no
|
|
|
+left join ( select x.order_no, y.maxTime, x.transaction_amount from t_order_bill_new x inner join ( select order_no, max(create_time) maxTime
|
|
|
+ from t_order_bill_new group by order_no)y on x.order_no = y.order_no and x.create_time = y.maxTime) f on o.order_no = f.order_no
|
|
|
+left join ( select order_no , sum(amount) invoiceAmount from t_order_invoice where status = 2 group by order_no ) g on o.order_no = g.order_no
|
|
|
+where delete_sign != 1 and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|