Browse Source

修改导入

anderx 6 years ago
parent
commit
e970db8ae0

+ 7 - 4
src/main/java/com/goafanti/common/mapper/TemporaryReceivablesMapper.xml

@@ -536,9 +536,12 @@
   </insert>
   
   <update id="updateRepeatOrderNo" >
-	update temporary_receivables x ,(select a.id from temporary_receivables a left join (select * from (select order_no,amount,aid,count(*) counts from temporary_receivables
-	group by order_no,amount,aid)a where a.counts>1 and a.aid=  #{aid} ) b  on a.order_no=b.order_no 
-	where a.amount=b.amount and a.aid= #{aid} )y  set status=1
-	where x.id=y.id
+	update temporary_receivables x ,(select a.order_no,a.amount,a.receivables_time,a.nickname 
+	from (select a.order_no,a.corporate_name,a.amount,a.receivables_time,b.nickname,count(1) counts 
+	from temporary_receivables a left join (select x1.order_no,y1.nickname from t_order_new x1 
+	left join user y1 on x1.buyer_id=y1.id )b on a.order_no=b.order_no where a.corporate_name=b.nickname 
+	group by a.order_no,a.corporate_name,a.amount,a.receivables_time)a where a.counts>1 )y set x.status=1 
+	where x.order_no=y.order_no and x.amount=y.amount and x.receivables_time=y.receivables_time 
+	and x.corporate_name=y.nickname and a.aid= #{aid}
   </update>
 </mapper>