|
|
@@ -1501,12 +1501,10 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
</select>
|
|
|
|
|
|
<select id="countTotalAndActually" parameterType="Map" resultType="java.util.Map">
|
|
|
- select sum(ifnull(b.amount,0)) actuallyTotalAmount,sum(o.total_amount) signTotalAmount 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= #{outsource,jdbcType=INTEGER}
|
|
|
+ select sum(b.amount) actuallyTotalAmount,sum(o.total_amount) signTotalAmount 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 ( 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
|
|
|
+ where delete_sign != 1 and outsource= #{outsource,jdbcType=INTEGER}
|
|
|
<if test="processStatus == 3">
|
|
|
and o.process_status = #{processStatus,jdbcType=INTEGER}
|
|
|
</if>
|