|
@@ -783,7 +783,7 @@
|
|
|
a.other_cost_actual otherCostActual , a.expect_profit expectProfit ,a.actual_profit actualProfit,a.service_type serviceType,
|
|
a.other_cost_actual otherCostActual , a.expect_profit expectProfit ,a.actual_profit actualProfit,a.service_type serviceType,
|
|
|
a.service_project serviceProject,o.examine_name examineName
|
|
a.service_project serviceProject,o.examine_name examineName
|
|
|
from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
|
|
from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
|
|
|
- left join (select * from t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2,4,5)
|
|
|
|
|
|
|
+ left join (select * from t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2,4,5,7,8)
|
|
|
and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
<if test="o.processStatus == 3">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
@@ -841,13 +841,13 @@
|
|
|
and a.project_type = #{o.projectType}
|
|
and a.project_type = #{o.projectType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==1">
|
|
<if test="o.approval != null and o.approval ==1">
|
|
|
- and o.approval in (1,4)
|
|
|
|
|
|
|
+ and o.approval in (1,4,7)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==2">
|
|
<if test="o.approval != null and o.approval ==2">
|
|
|
- and o.approval in (2,5)
|
|
|
|
|
|
|
+ and o.approval in (2,5,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==4">
|
|
<if test="o.approval != null and o.approval ==4">
|
|
|
- and o.approval in (1,2,4,5)
|
|
|
|
|
|
|
+ and o.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
@@ -871,7 +871,7 @@
|
|
|
<select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
|
|
<select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id
|
|
select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id
|
|
|
left join department d on o.order_dep = d.id left join t_order_mid a on o.order_no=a.order_no
|
|
left join department d on o.order_dep = d.id left join t_order_mid a on o.order_no=a.order_no
|
|
|
- where delete_sign in(0,2) and approval in(0,1,2) and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ where delete_sign in(0,2) and approval in(0,1,2,4,5,7,8) and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
<if test="o.processStatus == 3">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
</if>
|
|
@@ -928,13 +928,13 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and a.project_type = #{o.projectType}
|
|
and a.project_type = #{o.projectType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==1">
|
|
<if test="o.approval != null and o.approval ==1">
|
|
|
- and o.approval in (1,4)
|
|
|
|
|
|
|
+ and o.approval in (1,4,7)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==2">
|
|
<if test="o.approval != null and o.approval ==2">
|
|
|
- and o.approval in (2,5)
|
|
|
|
|
|
|
+ and o.approval in (2,5,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==4">
|
|
<if test="o.approval != null and o.approval ==4">
|
|
|
- and o.approval in (1,2,4,5)
|
|
|
|
|
|
|
+ and o.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
@@ -1013,7 +1013,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
</if>
|
|
</if>
|
|
|
<if test="specially == 0">
|
|
<if test="specially == 0">
|
|
|
<if test="approval ==null">
|
|
<if test="approval ==null">
|
|
|
- and a.approval in(0,1,2,4,5)
|
|
|
|
|
|
|
+ and a.approval in(0,1,2,4,5,7,8)
|
|
|
</if>
|
|
</if>
|
|
|
and a.order_status in(0,1,2,4)
|
|
and a.order_status in(0,1,2,4)
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
@@ -1044,20 +1044,20 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==1">
|
|
<if test="manageType ==1">
|
|
|
(4)
|
|
(4)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="manageType ==1">
|
|
|
|
|
|
|
+ <if test="manageType ==2">
|
|
|
(7)
|
|
(7)
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
<if test="approval ==2">
|
|
|
and a.approval in
|
|
and a.approval in
|
|
|
<if test="manageType ==0">
|
|
<if test="manageType ==0">
|
|
|
- (2)
|
|
|
|
|
|
|
+ (2,3)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="manageType ==1">
|
|
<if test="manageType ==1">
|
|
|
- (5)
|
|
|
|
|
|
|
+ (5,6)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="manageType ==1">
|
|
|
|
|
- (8)
|
|
|
|
|
|
|
+ <if test="manageType ==2">
|
|
|
|
|
+ (8,9)
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
@@ -1191,7 +1191,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
</if>
|
|
</if>
|
|
|
<if test="specially == 0">
|
|
<if test="specially == 0">
|
|
|
<if test="approval ==null">
|
|
<if test="approval ==null">
|
|
|
- and a.approval in(0,1,2,4,5)
|
|
|
|
|
|
|
+ and a.approval in(0,1,2,4,5,7,8)
|
|
|
</if>
|
|
</if>
|
|
|
and a.order_status in(0,1,2,4)
|
|
and a.order_status in(0,1,2,4)
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
@@ -1222,20 +1222,20 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==1">
|
|
<if test="manageType ==1">
|
|
|
(4)
|
|
(4)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="manageType ==1">
|
|
|
|
|
|
|
+ <if test="manageType ==2">
|
|
|
(7)
|
|
(7)
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
<if test="approval ==2">
|
|
|
and a.approval in
|
|
and a.approval in
|
|
|
<if test="manageType ==0">
|
|
<if test="manageType ==0">
|
|
|
- (2)
|
|
|
|
|
|
|
+ (2,3)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="manageType ==1">
|
|
<if test="manageType ==1">
|
|
|
- (5)
|
|
|
|
|
|
|
+ (5,6)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="manageType ==1">
|
|
|
|
|
- (8)
|
|
|
|
|
|
|
+ <if test="manageType ==2">
|
|
|
|
|
+ (8,9)
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
@@ -1578,7 +1578,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
select IFNULL( sum(o.settlement_amount),0) actuallyTotalAmount,IFNULL(sum(o.total_amount),0) signTotalAmount
|
|
select IFNULL( sum(o.settlement_amount),0) actuallyTotalAmount,IFNULL(sum(o.total_amount),0) signTotalAmount
|
|
|
from t_order_new o
|
|
from t_order_new o
|
|
|
left join department d on o.order_dep=d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
|
|
left join department d on o.order_dep=d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
|
|
|
- where o.delete_sign in(0,2,3) and (o.approval = 0 or o.approval = 2) and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ where o.delete_sign in(0,2,3) and o.approval in(0,1,2,4,5,7,8) and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
<if test="o.processStatus == 3">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
</if>
|
|
@@ -1634,11 +1634,14 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="o.projectType != null and o.projectType != """>
|
|
<if test="o.projectType != null and o.projectType != """>
|
|
|
and a.project_type = #{o.projectType}
|
|
and a.project_type = #{o.projectType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="o.approval != null and o.approval < 3">
|
|
|
|
|
- and o.approval = #{o.approval}
|
|
|
|
|
|
|
+ <if test="o.approval != null and o.approval ==1">
|
|
|
|
|
+ and o.approval in (1,4,7)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="o.approval != null and o.approval ==2">
|
|
|
|
|
+ and o.approval in (2,5,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==4">
|
|
<if test="o.approval != null and o.approval ==4">
|
|
|
- and o.approval in (1,2)
|
|
|
|
|
|
|
+ and o.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
</if>
|
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
<if test="o.buyerName != null and o.buyerName != """>
|
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|