|
|
@@ -890,8 +890,8 @@
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
|
|
|
from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
|
|
|
- left join department d on o.order_dep=d.id left join ( select order_no, name from outsource_organization group by order_no,name) e
|
|
|
- on o.order_no=e.order_no where delete_sign = 0 and order_status = 2
|
|
|
+ left join department d on o.order_dep=d.id left join (select order_no,max(name) from outsource_organization group by order_no) e
|
|
|
+ on o.order_no=e.order_no where delete_sign = 0 and order_status = 2
|
|
|
and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 2">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
@@ -1030,8 +1030,8 @@
|
|
|
0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName 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,name from outsource_organization group by order_no,name) e on o.order_no=e.order_no
|
|
|
- where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
+ left join (select order_no,max(name) as name from outsource_organization group by order_no) e
|
|
|
+ on o.order_no=e.order_no where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|