|
|
@@ -1032,36 +1032,35 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="specially == 3">
|
|
|
- and a.order_status=2
|
|
|
- <if test="manageType ==0">
|
|
|
- and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.order_status=2 and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+
|
|
|
+ <if test="approval ==0">
|
|
|
+ and a.process_status in(4)
|
|
|
+ and a.approval = 0
|
|
|
+ </if>
|
|
|
+ <if test="approval ==1">
|
|
|
+ and a.process_status in(4)
|
|
|
+ and a.approval in(1)
|
|
|
+ </if>
|
|
|
+ <if test="approval ==2">
|
|
|
+ and a.approval in (2,3)
|
|
|
+ </if>
|
|
|
</if>
|
|
|
+ <if test="specially == 11">
|
|
|
+ and a.order_status=2
|
|
|
<if test="approval ==0">
|
|
|
and a.process_status in(4)
|
|
|
and a.approval = 0
|
|
|
</if>
|
|
|
<if test="approval ==1">
|
|
|
and a.process_status in(4)
|
|
|
- and a.approval in
|
|
|
- <if test="manageType ==0">
|
|
|
- (1)
|
|
|
- </if>
|
|
|
- <if test="manageType ==1">
|
|
|
- (4)
|
|
|
- </if>
|
|
|
+ and a.approval in (4)
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
- and a.approval in
|
|
|
- <if test="manageType ==0">
|
|
|
- (2,3)
|
|
|
- </if>
|
|
|
- <if test="manageType ==1">
|
|
|
- (5,6)
|
|
|
- </if>
|
|
|
-
|
|
|
+ and a.approval in (5,6)
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="specially !=3 ">
|
|
|
+ <if test="specially !=3 and specially !=11">
|
|
|
<if test="approval ==0">
|
|
|
and a.approval = 0
|
|
|
</if>
|
|
|
@@ -1186,31 +1185,43 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="outsource != null">
|
|
|
- and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <if test="specially == 0">
|
|
|
- <if test="approval ==null">
|
|
|
- and a.approval in(0,1,2,4,5,7,8)
|
|
|
- </if>
|
|
|
- and a.order_status in(0,1,2,4)
|
|
|
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
+ <if test="outsource != null">
|
|
|
+ and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="specially == 0">
|
|
|
+ <if test="approval ==null">
|
|
|
+ and a.approval in(0,1,2,4,5,7,8)
|
|
|
+ </if>
|
|
|
+ and a.order_status in(0,1,2,4)
|
|
|
+ and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="specially == 10">
|
|
|
and a.process_status = 1 and a.order_status in (0,1,2)
|
|
|
and mg.manager_id= #{aid}
|
|
|
</if>
|
|
|
- <if test="specially == 1">
|
|
|
- and a.process_status = 2 and a.order_status in (0,1,2)
|
|
|
- </if>
|
|
|
- <if test="specially == 2">
|
|
|
- and a.order_status in(3,5)
|
|
|
- and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
+ <if test="specially == 1">
|
|
|
+ and a.process_status = 2 and a.order_status in (0,1,2)
|
|
|
+ </if>
|
|
|
+ <if test="specially == 2">
|
|
|
+ and a.order_status in(3,5)
|
|
|
+ and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="specially == 3">
|
|
|
- <if test="manageType ==0">
|
|
|
- and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ and a.order_status=2 and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+
|
|
|
+ <if test="approval ==0">
|
|
|
+ and a.process_status in(4)
|
|
|
+ and a.approval = 0
|
|
|
+ </if>
|
|
|
+ <if test="approval ==1">
|
|
|
+ and a.process_status in(4)
|
|
|
+ and a.approval in(1)
|
|
|
+ </if>
|
|
|
+ <if test="approval ==2">
|
|
|
+ and a.approval in (2,3)
|
|
|
</if>
|
|
|
+ </if>
|
|
|
+ <if test="specially == 11">
|
|
|
and a.order_status=2
|
|
|
<if test="approval ==0">
|
|
|
and a.process_status in(4)
|
|
|
@@ -1218,26 +1229,13 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
</if>
|
|
|
<if test="approval ==1">
|
|
|
and a.process_status in(4)
|
|
|
- and a.approval in
|
|
|
- <if test="manageType ==0">
|
|
|
- (1)
|
|
|
- </if>
|
|
|
- <if test="manageType ==1">
|
|
|
- (4)
|
|
|
- </if>
|
|
|
+ and a.approval in (4)
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
- and a.approval in
|
|
|
- <if test="manageType ==0">
|
|
|
- (2,3)
|
|
|
- </if>
|
|
|
- <if test="manageType ==1">
|
|
|
- (5,6)
|
|
|
- </if>
|
|
|
-
|
|
|
+ and a.approval in (5,6)
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="specially !=3 ">
|
|
|
+ <if test="specially !=3 and specially !=11">
|
|
|
<if test="approval ==0">
|
|
|
and a.approval = 0
|
|
|
</if>
|
|
|
@@ -1251,10 +1249,10 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and a.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="specially == 4">
|
|
|
- and a.process_status in (3,5,6,7,99)
|
|
|
- and a.order_status in(1,2,3,4,6)
|
|
|
- </if>
|
|
|
+ <if test="specially == 4">
|
|
|
+ and a.process_status in (3,5,6,7,99)
|
|
|
+ and a.order_status in(1,2,3,4,6)
|
|
|
+ </if>
|
|
|
<if test="deps!=null">
|
|
|
and a.order_dep in
|
|
|
<foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
@@ -1273,48 +1271,49 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="distribution == 3">
|
|
|
and a.process_status = 7
|
|
|
</if>
|
|
|
- <if test="name != null">
|
|
|
- and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
- </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
<if test="projectType != null">
|
|
|
and c.project_type = #{projectType}
|
|
|
</if>
|
|
|
<if test="processStatus != null">
|
|
|
and a.process_status = #{processStatus}
|
|
|
</if>
|
|
|
- <if test="orderNo != null">
|
|
|
- and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
|
|
|
- </if>
|
|
|
- <if test="contractNo != null">
|
|
|
- and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
|
|
|
- </if>
|
|
|
- <if test="liquidationStatus != null">
|
|
|
- and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="contractNo != null">
|
|
|
+ and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="liquidationStatus != null">
|
|
|
+ and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="tag != null">
|
|
|
and a.tag= #{tag}
|
|
|
</if>
|
|
|
- <if test="amountStatus == 0">
|
|
|
- and a.total_amount < 10
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 1">
|
|
|
- and a.total_amount between 10 and 20
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 2">
|
|
|
- and a.total_amount between 20 and 30
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 3">
|
|
|
- and a.total_amount between 30 and 40
|
|
|
- </if>
|
|
|
- <if test="amountStatus == 4">
|
|
|
- and a.total_amount > 40
|
|
|
- </if>
|
|
|
- <if test="starTime !=null and endTime !=null">
|
|
|
- and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
+ <if test="amountStatus == 0">
|
|
|
+ and a.total_amount < 10
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 1">
|
|
|
+ and a.total_amount between 10 and 20
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 2">
|
|
|
+ and a.total_amount between 20 and 30
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 3">
|
|
|
+ and a.total_amount between 30 and 40
|
|
|
+ </if>
|
|
|
+ <if test="amountStatus == 4">
|
|
|
+ and a.total_amount > 40
|
|
|
+ </if>
|
|
|
+ <if test="starTime !=null and endTime !=null">
|
|
|
+ and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="contractStart !=null and contractEnd !=null">
|
|
|
and a.sign_time between #{contractStart,jdbcType=VARCHAR} and #{contractEnd,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.outOrderDunListBo">
|