Browse Source

重复BUG修复

anderx 6 years ago
parent
commit
c72764653a
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

+ 4 - 3
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1089,10 +1089,11 @@
 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,x.create_time,x.transaction_amount from t_order_bill_new x right 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 LIMIT 1) f on o.order_no = f.order_no
+left join (select x1.order_no,max(create_time) create_time,max(transaction_amount)transaction_amount from 
+(select x.order_no,x.create_time,x.transaction_amount from t_order_bill_new x right 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)x1 group by x1.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}
+where delete_sign != 1  and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>