|
|
@@ -576,24 +576,31 @@ select
|
|
|
<if test="salesmanName !=null">
|
|
|
and d.name like concat('%',#{salesmanName},'%')
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState != 5 and processState != 7">
|
|
|
- and ((a.process_state >= #{processState} or a.back_status >= #{processState}))
|
|
|
- </if>
|
|
|
+ <if test="complete ==0 and processState != 5 and processState < 7">
|
|
|
+ and ((a.process_state >= #{processState} or a.back_status >= #{processState}))
|
|
|
+ </if>
|
|
|
<if test="complete ==0 and (processState == 5 or processState == 7)">
|
|
|
and ((a.process_state >= 1 and a.process_state < 10)or a.back_status >= #{processState})
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState != 6 and processState != 8 and processState != 9">
|
|
|
+ <if test="complete ==0 and processState == 8">
|
|
|
+ and ((a.process_state >= 8 and a.process_state < 10)or a.back_status >= #{processState}) and e.province !=11
|
|
|
+ </if>
|
|
|
+ <if test="complete ==0 and processState == 9">
|
|
|
+ and ((a.process_state = 9 )or a.back_status >= #{processState})
|
|
|
+ </if>
|
|
|
+ <if test="complete ==0 and processState == 10">
|
|
|
+ and ((a.process_state =10 )or a.back_status >= #{processState}) and e.province=11
|
|
|
+ </if>
|
|
|
+ <if test="complete ==1 and processState < 6">
|
|
|
and a.process_state = #{processState} and a.status in (0,1,2,3)
|
|
|
</if>
|
|
|
<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 == 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 ==1 and processState > 7">
|
|
|
+ and (a.process_state = #{processState} and a.status =1)
|
|
|
+ </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>
|
|
|
@@ -614,7 +621,7 @@ select
|
|
|
and a.status = 4
|
|
|
</if>
|
|
|
<if test="complete ==5 and processState != 3 and processState != 4">
|
|
|
- and a.back_status >= #{processState}
|
|
|
+ and a.back_status = #{processState}
|
|
|
</if>
|
|
|
<if test="complete ==6">
|
|
|
and a.status = 6
|
|
|
@@ -704,26 +711,29 @@ select
|
|
|
<if test="salesmanName !=null">
|
|
|
and d.name like concat('%',#{salesmanName},'%')
|
|
|
</if>
|
|
|
- <if test="complete ==0 and processState != 9 and processState != 5 and processState != 7">
|
|
|
- and (a.process_state >= #{processState} or a.back_status >= #{processState})
|
|
|
- </if>
|
|
|
- <if test="complete ==0 and processState == 9">
|
|
|
- and ((a.process_state >= #{processState} and a.process_state < 10)or a.back_status >= #{processState})
|
|
|
+ <if test="complete ==0 and processState != 5 and processState < 7">
|
|
|
+ and ((a.process_state >= #{processState} or a.back_status >= #{processState}))
|
|
|
</if>
|
|
|
<if test="complete ==0 and (processState == 5 or processState == 7)">
|
|
|
and ((a.process_state >= 1 and a.process_state < 10)or a.back_status >= #{processState})
|
|
|
</if>
|
|
|
- <if test="complete ==1 and processState != 6 and processState != 8 and processState != 9">
|
|
|
+ <if test="complete ==0 and processState == 8">
|
|
|
+ and ((a.process_state >= 8 and a.process_state < 10)or a.back_status >= #{processState}) and e.province !=11
|
|
|
+ </if>
|
|
|
+ <if test="complete ==0 and processState == 9">
|
|
|
+ and ((a.process_state = 9 )or a.back_status >= #{processState})
|
|
|
+ </if>
|
|
|
+ <if test="complete ==0 and processState == 10">
|
|
|
+ and ((a.process_state =10 )or a.back_status >= #{processState}) and e.province=11
|
|
|
+ </if>
|
|
|
+ <if test="complete ==1 and processState < 6">
|
|
|
and a.process_state = #{processState} and a.status in (0,1,2,3)
|
|
|
- </if>
|
|
|
- <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 == 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 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 = #{processState} and a.status =1)
|
|
|
</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}
|
|
|
@@ -743,9 +753,9 @@ select
|
|
|
<if test="complete ==4">
|
|
|
and a.status = 4
|
|
|
</if>
|
|
|
- <if test="complete ==5 and processState != 3 and processState != 4">
|
|
|
- and a.back_status >= #{processState}
|
|
|
- </if>
|
|
|
+ <if test="complete ==5 and processState != 3 and processState != 4">
|
|
|
+ and a.back_status = #{processState}
|
|
|
+ </if>
|
|
|
<if test="complete ==6">
|
|
|
and a.status = 6
|
|
|
</if>
|