|
|
@@ -783,7 +783,7 @@
|
|
|
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
|
|
|
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}
|
|
|
<if test="o.processStatus == 3">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
@@ -841,13 +841,13 @@
|
|
|
and a.project_type = #{o.projectType}
|
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==1">
|
|
|
- and o.approval in (1,4)
|
|
|
+ and o.approval in (1,4,7)
|
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==2">
|
|
|
- and o.approval in (2,5)
|
|
|
+ and o.approval in (2,5,8)
|
|
|
</if>
|
|
|
<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 test="o.buyerName != null and o.buyerName != """>
|
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
@@ -871,7 +871,7 @@
|
|
|
<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
|
|
|
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">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</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}
|
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==1">
|
|
|
- and o.approval in (1,4)
|
|
|
+ and o.approval in (1,4,7)
|
|
|
</if>
|
|
|
<if test="o.approval != null and o.approval ==2">
|
|
|
- and o.approval in (2,5)
|
|
|
+ and o.approval in (2,5,8)
|
|
|
</if>
|
|
|
<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 test="o.buyerName != null and 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 test="specially == 0">
|
|
|
<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>
|
|
|
and a.order_status in(0,1,2,4)
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
@@ -1041,17 +1041,23 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==0">
|
|
|
(1)
|
|
|
</if>
|
|
|
- <if test="manageType ==1">
|
|
|
- (4)
|
|
|
- </if>
|
|
|
+ <if test="manageType ==1">
|
|
|
+ (4)
|
|
|
+ </if>
|
|
|
+ <if test="manageType ==2">
|
|
|
+ (7)
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
and a.approval in
|
|
|
<if test="manageType ==0">
|
|
|
- (2)
|
|
|
+ (2,3)
|
|
|
</if>
|
|
|
<if test="manageType ==1">
|
|
|
- (5)
|
|
|
+ (5,6)
|
|
|
+ </if>
|
|
|
+ <if test="manageType ==2">
|
|
|
+ (8,9)
|
|
|
</if>
|
|
|
</if>
|
|
|
</if>
|
|
|
@@ -1060,13 +1066,13 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and a.approval = 0
|
|
|
</if>
|
|
|
<if test="approval ==1">
|
|
|
- and a.approval in (1,4)
|
|
|
+ and a.approval in (1,4,7)
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
- and a.approval in (2,5)
|
|
|
+ and a.approval in (2,5,8)
|
|
|
</if>
|
|
|
<if test="approval ==4">
|
|
|
- and a.approval in (1,2,4,5)
|
|
|
+ and a.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="specially == 4">
|
|
|
@@ -1185,7 +1191,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
</if>
|
|
|
<if test="specially == 0">
|
|
|
<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>
|
|
|
and a.order_status in(0,1,2,4)
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
@@ -1216,29 +1222,35 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==1">
|
|
|
(4)
|
|
|
</if>
|
|
|
+ <if test="manageType ==2">
|
|
|
+ (7)
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
and a.approval in
|
|
|
<if test="manageType ==0">
|
|
|
- (2)
|
|
|
+ (2,3)
|
|
|
</if>
|
|
|
<if test="manageType ==1">
|
|
|
- (5)
|
|
|
+ (5,6)
|
|
|
+ </if>
|
|
|
+ <if test="manageType ==2">
|
|
|
+ (8,9)
|
|
|
</if>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <if test="specially !=3">
|
|
|
+ <if test="specially !=3 ">
|
|
|
<if test="approval ==0">
|
|
|
and a.approval = 0
|
|
|
</if>
|
|
|
<if test="approval ==1">
|
|
|
- and a.approval in (1,4)
|
|
|
+ and a.approval in (1,4,7)
|
|
|
</if>
|
|
|
<if test="approval ==2">
|
|
|
- and a.approval in (2,5)
|
|
|
+ and a.approval in (2,5,8)
|
|
|
</if>
|
|
|
<if test="approval ==4">
|
|
|
- and a.approval in (1,2,4,5)
|
|
|
+ and a.approval in (1,2,4,5,7,8)
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="specially == 4">
|
|
|
@@ -1566,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
|
|
|
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
|
|
|
- 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">
|
|
|
and o.process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1622,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 != """>
|
|
|
and a.project_type = #{o.projectType}
|
|
|
</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 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 test="o.buyerName != null and o.buyerName != """>
|
|
|
<bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
@@ -2085,7 +2100,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
</select>
|
|
|
<select id="getProcessName" resultType="com.goafanti.order.bo.OrderProcessName">
|
|
|
select a.order_no orderNo,a.approval,a.process_status processStatus ,b.name yxy,mg.name yxjl,
|
|
|
- yxgly.name yxgly,d.name cwzy,zc.name zc, zxsgly.name zxsgly,dsz.name dsz
|
|
|
+ yxgly.name yxgly,d.name cwzy,zc.name zc,fzc.name fzc, zxsgly.name zxsgly,dsz.name dsz
|
|
|
from t_order_new a left join admin b on a.salesman_id =b.id
|
|
|
left join admin mg on b.manager_id =mg.id left join department c on a.order_dep =c.id
|
|
|
left join (select a.department_id depId,group_concat(a.name) name
|
|
|
@@ -2096,6 +2111,9 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
|
|
|
where c.role_type in ('99998','99988') and a.status ='0' ) zc on 1=1
|
|
|
left join (select group_concat(a.name) name
|
|
|
+ from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
|
|
|
+ where c.role_type in ('99996') and a.status ='0' ) fzc on 1=1
|
|
|
+ left join (select group_concat(a.name) name
|
|
|
from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid =c.id
|
|
|
where c.role_type in ('99999','99989') and a.status ='0' ) dsz on 1=1
|
|
|
left join (select group_concat(a.name) name
|
|
|
@@ -2173,5 +2191,10 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
left join admin d on b.retrial_finance_id=d.id
|
|
|
where a.order_no =#{orderNo}
|
|
|
</select>
|
|
|
+ <select id="selectDepByOrderNo" resultType="com.goafanti.common.model.Department">
|
|
|
+ select a.id,a.name,a.province,a.finance_id financeId
|
|
|
+ from department a left join t_order_new b on a.id =b.order_dep
|
|
|
+ where b.order_no= #{orderNo}
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|