|
|
@@ -501,32 +501,32 @@ 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==2">
|
|
|
+ <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==3">
|
|
|
+ <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>
|
|
|
where 1=1
|
|
|
<if test="processState==0">
|
|
|
and b.salesman_id= #{aid}
|
|
|
</if>
|
|
|
- <if test="processState==2 and complete !=5">
|
|
|
+ <if test="processState==3 and complete !=5">
|
|
|
and x.aid=#{aid} and a.process_state >= 2
|
|
|
</if>
|
|
|
- <if test="processState==3 and complete !=5">
|
|
|
+ <if test="processState==4 and complete !=5">
|
|
|
and x.aid=#{aid} and a.process_state >= 3
|
|
|
</if>
|
|
|
- <if test="processState==2 and complete ==5">
|
|
|
+ <if test="processState==3 and complete ==5">
|
|
|
and x.aid=#{aid} and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="processState==3 and complete ==5">
|
|
|
+ <if test="processState==4 and complete ==5">
|
|
|
and x.aid=#{aid} and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="processState==5 and aid !=null">
|
|
|
+ <if test="processState==6 and aid !=null">
|
|
|
and e.finance_id =#{aid}
|
|
|
</if>
|
|
|
- <if test="processState==5 and aids !=null">
|
|
|
+ <if test="processState==6 and aids !=null">
|
|
|
and e.finance_id in
|
|
|
<foreach close=")" collection="aids" item="id" open="(" separator=",">
|
|
|
#{id}
|
|
|
@@ -559,35 +559,35 @@ select
|
|
|
<if test="salesmanName !=null">
|
|
|
and d.name like concat('%',#{salesmanName},'%')
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState != 8">
|
|
|
+ <if test="complete ==0 and processState != 9">
|
|
|
and (a.process_state >= #{processState} or a.back_status >= #{processState})
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState == 8">
|
|
|
- and (a.process_state >= #{processState} and a.process_state < 9)or a.back_status >= #{processState}
|
|
|
+ <if test="complete ==0 and processState == 9">
|
|
|
+ and (a.process_state >= #{processState} and a.process_state < 10)or a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
|
|
|
+ <if test="complete ==1 and processState != 7 and processState != 8 and processState != 9">
|
|
|
and a.process_state = #{processState}
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState == 5">
|
|
|
- and (a.process_state in(5,9) and a.status !=4)
|
|
|
+ <if test="complete ==1 and processState == 6">
|
|
|
+ and (a.process_state in(6) and a.status in (0,1,2,3,5,6))
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState == 7">
|
|
|
- and (a.process_state = 7 and a.status =1)
|
|
|
+ <if test="complete ==1 and processState == 9">
|
|
|
+ and (a.process_state = 8 and a.status =1)
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState == 8">
|
|
|
+ <if test="complete ==1 and processState == 9">
|
|
|
and (a.process_state = #{processState} and a.status =1)
|
|
|
</if>
|
|
|
- <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
|
|
|
+ <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 == 5">
|
|
|
- and (a.process_state > 5 and a.process_state < 9) or (a.process_state =9 and a.status=4)
|
|
|
- </if>
|
|
|
- <if test="complete ==2 and processState == 7">
|
|
|
- and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state > 7)
|
|
|
+ <if test="complete ==2 and processState == 6">
|
|
|
+ and a.process_state > 6 and a.process_state < 10
|
|
|
</if>
|
|
|
<if test="complete ==2 and processState == 8">
|
|
|
- and a.process_state = 8 and (a.status = 4 or a.status = 2)
|
|
|
+ and ((a.process_state = 8 and (a.status = 4 or a.status = 2))or a.process_state > 8)
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2 and processState == 9">
|
|
|
+ and a.process_state = 9 and (a.status = 4 or a.status = 2)
|
|
|
</if>
|
|
|
<if test="complete ==3">
|
|
|
and a.status = 2
|
|
|
@@ -595,7 +595,7 @@ select
|
|
|
<if test="complete ==4">
|
|
|
and a.status = 4
|
|
|
</if>
|
|
|
- <if test="complete ==5 and processState != 2 and processState != 3">
|
|
|
+ <if test="complete ==5 and processState != 3 and processState != 4">
|
|
|
and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
<if test="complete ==6">
|
|
|
@@ -611,32 +611,32 @@ 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==2">
|
|
|
+ <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==3">
|
|
|
+ <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>
|
|
|
where 1=1
|
|
|
<if test="processState==0">
|
|
|
and b.salesman_id= #{aid}
|
|
|
</if>
|
|
|
- <if test="processState==2 and complete !=5">
|
|
|
+ <if test="processState==3 and complete !=5">
|
|
|
and x.aid=#{aid} and a.process_state >= 2
|
|
|
</if>
|
|
|
- <if test="processState==3 and complete !=5">
|
|
|
+ <if test="processState==4 and complete !=5">
|
|
|
and x.aid=#{aid} and a.process_state >= 3
|
|
|
</if>
|
|
|
- <if test="processState==2 and complete ==5">
|
|
|
+ <if test="processState==3 and complete ==5">
|
|
|
and x.aid=#{aid} and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="processState==3 and complete ==5">
|
|
|
+ <if test="processState==4 and complete ==5">
|
|
|
and x.aid=#{aid} and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="processState==5 and aid !=null">
|
|
|
+ <if test="processState==6 and aid !=null">
|
|
|
and e.finance_id =#{aid}
|
|
|
</if>
|
|
|
- <if test="processState==5 and aids !=null">
|
|
|
+ <if test="processState==6 and aids !=null">
|
|
|
and e.finance_id in
|
|
|
<foreach close=")" collection="aids" item="id" open="(" separator=",">
|
|
|
#{id}
|
|
|
@@ -669,35 +669,35 @@ select
|
|
|
<if test="salesmanName !=null">
|
|
|
and d.name like concat('%',#{salesmanName},'%')
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState != 8">
|
|
|
+ <if test="complete ==0 and processState != 9">
|
|
|
and (a.process_state >= #{processState} or a.back_status >= #{processState})
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState == 8">
|
|
|
- and (a.process_state >= #{processState} and a.process_state < 9)or a.back_status >= #{processState}
|
|
|
+ <if test="complete ==0 and processState == 9">
|
|
|
+ and (a.process_state >= #{processState} and a.process_state < 10)or a.back_status >= #{processState}
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
|
|
|
+ <if test="complete ==1 and processState != 6 and processState != 8 and processState != 9">
|
|
|
and a.process_state = #{processState}
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState == 5">
|
|
|
- and (a.process_state in(5,9) and a.status !=4)
|
|
|
+ <if test="complete ==1 and processState == 6">
|
|
|
+ and (a.process_state in(6) and a.status in (0,1,2,3,5,6))
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState == 7">
|
|
|
- and (a.process_state = 7 and a.status =1)
|
|
|
- </if>
|
|
|
<if test="complete ==1 and processState == 8">
|
|
|
+ and (a.process_state = 8 and a.status =1)
|
|
|
+ </if>
|
|
|
+ <if test="complete ==1 and processState == 9">
|
|
|
and (a.process_state = #{processState} and a.status =1)
|
|
|
</if>
|
|
|
- <if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
|
|
|
+ <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 == 5">
|
|
|
- and (a.process_state > 5 and a.process_state < 9) or (a.process_state =9 and a.status=4)
|
|
|
- </if>
|
|
|
- <if test="complete ==2 and processState == 7">
|
|
|
- and ((a.process_state = 7 and (a.status = 4 or a.status = 2))or a.process_state > 7)
|
|
|
+ <if test="complete ==2 and processState == 6">
|
|
|
+ and a.process_state > 6 and a.process_state < 10
|
|
|
</if>
|
|
|
<if test="complete ==2 and processState == 8">
|
|
|
- and a.process_state = 8 and (a.status = 4 or a.status = 2)
|
|
|
+ and ((a.process_state = 8 and (a.status = 4 or a.status = 2))or a.process_state > 8)
|
|
|
+ </if>
|
|
|
+ <if test="complete ==2 and processState == 9">
|
|
|
+ and a.process_state = 9 and (a.status = 4 or a.status = 2)
|
|
|
</if>
|
|
|
<if test="complete ==3">
|
|
|
and a.status = 2
|
|
|
@@ -705,7 +705,7 @@ select
|
|
|
<if test="complete ==4">
|
|
|
and a.status = 4
|
|
|
</if>
|
|
|
- <if test="complete ==5 and processState != 2 and processState != 3">
|
|
|
+ <if test="complete ==5 and processState != 3 and processState != 4">
|
|
|
and a.back_status >= #{processState}
|
|
|
</if>
|
|
|
<if test="complete ==6">
|