Browse Source

修改咨询师、咨询师管理员的审核列表

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

+ 6 - 4
src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml

@@ -607,7 +607,8 @@ from new_order_change a  where 1=1
   a.process_state processState from new_order_change a left join t_order_new b on a.order_no=b.order_no 
   left join user c on b.buyer_id=c.id left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id 
 	<if test="processState==2 or processState==3 "> 
-	left join t_order_task f on a.order_no=f.order_no
+	left join (select x.order_no,x.aid from (SELECT order_no,task_allocator aid FROM t_order_task where task_allocator is not null
+  UNION SELECT order_no,task_receiver aid FROM t_order_task  where task_receiver is not null)x group by order_no,aid) f on a.order_no=f.order_no
 	</if> 
 	where 1=1
 	<if test="processState==0">
@@ -620,7 +621,7 @@ from new_order_change a  where 1=1
   	</foreach>
 	</if>
 	<if test="processState==2 or processState==3 ">
-	and(f.task_receiver=#{aid} or f.task_allocator=#{aid})
+	and f.aid=#{aid}
 	</if>
 	<if test="processState==5">
 	and b.finance_id =#{aid}
@@ -662,7 +663,8 @@ from new_order_change a  where 1=1
   select count(*) from new_order_change a left join t_order_new b on a.order_no=b.order_no left join user c on b.buyer_id=c.id 
   left join admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
 	<if test="processState==2 or processState==3 "> 
-	left join t_order_task f on a.order_no=f.order_no
+	left join (select x.order_no,x.aid from (SELECT order_no,task_allocator aid FROM t_order_task where task_allocator is not null
+  UNION SELECT order_no,task_receiver aid FROM t_order_task  where task_receiver is not null)x group by order_no,aid) f on a.order_no=f.order_no
 	</if> 
 	where 1=1
 	<if test="processState==0">
@@ -675,7 +677,7 @@ from new_order_change a  where 1=1
   	</foreach>
 	</if>
 	<if test="processState==2 or processState==3 ">
-	and(f.task_receiver=#{aid} or f.task_allocator=#{aid})
+	and f.aid=#{aid}
 	</if>
 	<if test="processState==5">
 	and b.finance_id =#{aid}