|
|
@@ -783,8 +783,8 @@
|
|
|
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,7,8)
|
|
|
- and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
+ 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 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>
|
|
|
@@ -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,4,5,7,8) and outsource= #{o.outsource,jdbcType=INTEGER}
|
|
|
+ where delete_sign in(0,2) 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>
|
|
|
@@ -955,9 +955,10 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
select o.order_no orderNo ,o.salesman_id as salesmanId, a.name as salesmanName,e.name managerName,
|
|
|
o.contract_no contractNo,a.email ,u.nickname as userName,o.order_dep orderDep,d.name departmentName,
|
|
|
- d.finance_id financeId
|
|
|
+ d.finance_id financeId,d.approval approvalStatus,d.approval_aid,ad.name approvalName
|
|
|
from t_order_new o left join admin a on o.salesman_id = a.id left join `user` u on u.id = o.buyer_id
|
|
|
left join department d on o.order_dep=d.id left join admin e on a.manager_id=e.id
|
|
|
+ left join admin ad on d.approval_aid=ad.id
|
|
|
where order_no = #{_parameter,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
@@ -1030,6 +1031,9 @@ 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">
|
|
|
+ <if test="manageType ==0">
|
|
|
+ and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
and a.order_status=2
|
|
|
<if test="approval ==0">
|
|
|
and a.process_status in(4)
|
|
|
@@ -1044,9 +1048,6 @@ 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
|
|
|
@@ -1056,9 +1057,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==1">
|
|
|
(5,6)
|
|
|
</if>
|
|
|
- <if test="manageType ==2">
|
|
|
- (8,9)
|
|
|
- </if>
|
|
|
+
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="specially !=3 ">
|
|
|
@@ -1208,6 +1207,9 @@ 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">
|
|
|
+ <if test="manageType ==0">
|
|
|
+ and dep.approval_aid= #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
and a.order_status=2
|
|
|
<if test="approval ==0">
|
|
|
and a.process_status in(4)
|
|
|
@@ -1222,9 +1224,6 @@ 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
|
|
|
@@ -1234,9 +1233,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
<if test="manageType ==1">
|
|
|
(5,6)
|
|
|
</if>
|
|
|
- <if test="manageType ==2">
|
|
|
- (8,9)
|
|
|
- </if>
|
|
|
+
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="specially !=3 ">
|
|
|
@@ -2100,25 +2097,20 @@ 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,fzc.name fzc, zxsgly.name zxsgly,dsz.name dsz
|
|
|
+ yxgly.name yxgly,d.name cwzy, zxsgly.name zxsgly,dsz.name dsz,dep.approval approvalStatus ,da.name approvalName
|
|
|
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
|
|
|
- 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 ='9996' and a.status ='0' group by a.department_id )yxgly on c.id =yxgly.depId
|
|
|
- left join (select order_no ,group_concat(aname)name from t_order_examine WHERE type=0 group by order_no ) d on a.order_no=d.order_no
|
|
|
- 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 ('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
|
|
|
- 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 ('9998') and a.status ='0' ) zxsgly on 1=1
|
|
|
+ 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
|
|
|
+ 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 ='9996' and a.status ='0' group by a.department_id )yxgly on c.id =yxgly.depId
|
|
|
+ left join (select order_no ,group_concat(aname)name from t_order_examine WHERE type=0 group by order_no ) d on a.order_no=d.order_no
|
|
|
+ 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
|
|
|
+ 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 ('9998') and a.status ='0' ) zxsgly on 1=1
|
|
|
+ left join department dep on a.order_dep =dep.id left join admin da on dep.approval_aid=da.id
|
|
|
where a.order_no = #{orderNo}
|
|
|
</select>
|
|
|
<select id="selectByuidandAid" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
@@ -2192,7 +2184,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
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
|
|
|
+ select a.id,a.name,a.province,a.finance_id financeId,a.approval ,a.approval_aid approvalAid
|
|
|
from department a left join t_order_new b on a.id =b.order_dep
|
|
|
where b.order_no= #{orderNo}
|
|
|
</select>
|