|
|
@@ -501,11 +501,25 @@ select
|
|
|
a.process_state processState,a.back_status backStatus from new_order_change noc left join new_order_change a on noc.id=a.id
|
|
|
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==3">
|
|
|
- left join (select order_no, aid from order_examine where`type`=0 group by order_no,aid)x on a.order_no = x.order_no
|
|
|
+ <if test="processState==3">
|
|
|
+ left join (select order_no, aid from order_examine where`type`=0
|
|
|
+ <if test="complete ==1">
|
|
|
+ and status=0
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2">
|
|
|
+ and status=1
|
|
|
+ </if>
|
|
|
+ group by order_no,aid)x on a.order_no = x.order_no
|
|
|
</if>
|
|
|
- <if test="processState==4">
|
|
|
- left join (select order_no, aid from order_examine where`type`=1 group by order_no,aid)x on a.order_no = x.order_no
|
|
|
+ <if test="processState==4">
|
|
|
+ left join (select order_no, aid from order_examine where`type`=1
|
|
|
+ <if test="complete ==1">
|
|
|
+ and status=0
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2">
|
|
|
+ and status=1
|
|
|
+ </if>
|
|
|
+ group by order_no,aid)x on a.order_no = x.order_no
|
|
|
</if>
|
|
|
where 1=1
|
|
|
<if test="processState==0">
|
|
|
@@ -580,7 +594,7 @@ select
|
|
|
<if test="complete ==1 and processState == 9">
|
|
|
and (a.process_state = #{processState} and a.status =1)
|
|
|
</if>
|
|
|
- <if test="complete ==2 and processState != 6 and processState != 8 and processState != 9">
|
|
|
+ <if test="complete ==2 and processState != 6 and processState != 8 and processState != 9 and processState !=3 and processState !=4">
|
|
|
and a.process_state > #{processState}
|
|
|
</if>
|
|
|
<if test="complete ==2 and processState == 6">
|
|
|
@@ -614,12 +628,26 @@ select
|
|
|
select count(*) from new_order_change noc left join new_order_change a on noc.id=a.id
|
|
|
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==3">
|
|
|
- left join (select order_no, aid from order_examine where`type`=0 group by order_no,aid)x on a.order_no = x.order_no
|
|
|
- </if>
|
|
|
- <if test="processState==4">
|
|
|
- left join (select order_no, aid from order_examine where`type`=1 group by order_no,aid)x on a.order_no = x.order_no
|
|
|
- </if>
|
|
|
+ <if test="processState==3">
|
|
|
+ left join (select order_no, aid from order_examine where`type`=0
|
|
|
+ <if test="complete ==1">
|
|
|
+ and status=0
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2">
|
|
|
+ and status=1
|
|
|
+ </if>
|
|
|
+ group by order_no,aid)x on a.order_no = x.order_no
|
|
|
+ </if>
|
|
|
+ <if test="processState==4">
|
|
|
+ left join (select order_no, aid from order_examine where`type`=1
|
|
|
+ <if test="complete ==1">
|
|
|
+ and status=0
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2">
|
|
|
+ and status=1
|
|
|
+ </if>
|
|
|
+ group by order_no,aid)x on a.order_no = x.order_no
|
|
|
+ </if>
|
|
|
where 1=1
|
|
|
<if test="processState==0">
|
|
|
and b.salesman_id= #{aid}
|
|
|
@@ -693,9 +721,9 @@ select
|
|
|
<if test="complete ==1 and processState == 9">
|
|
|
and (a.process_state = #{processState} and a.status =1)
|
|
|
</if>
|
|
|
- <if test="complete ==2 and processState != 6 and processState != 8 and processState != 9">
|
|
|
- and a.process_state > #{processState}
|
|
|
- </if>
|
|
|
+ <if test="complete ==2 and processState != 6 and processState != 8 and processState != 9 and processState !=3 and processState !=4">
|
|
|
+ and a.process_state > #{processState}
|
|
|
+ </if>
|
|
|
<if test="complete ==2 and processState == 6">
|
|
|
and a.process_state > 6 and a.process_state < 10
|
|
|
</if>
|