|
|
@@ -870,12 +870,13 @@
|
|
|
<!-- 查看所有待财务管理员分配的订单数据 -->
|
|
|
<select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
select * from (
|
|
|
- select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
- ,liquidation_status,o.finance_id as financeId,contract_no as contractNo
|
|
|
+ ,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName
|
|
|
from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
+ left join department d on o.order_dep=d.id
|
|
|
where delete_sign = 0
|
|
|
and order_status = 2
|
|
|
<if test="o.processStatus == 2">
|
|
|
@@ -903,12 +904,13 @@
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
union
|
|
|
- select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
- ,liquidation_status ,o.finance_id as financeId,contract_no as contractNo
|
|
|
+ ,liquidation_status ,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName
|
|
|
from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
+ left join department d on o.order_dep=d.id
|
|
|
where delete_sign = 0 and approval = 2 and finance_id is null and order_status = 2
|
|
|
<if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
@@ -1059,12 +1061,13 @@
|
|
|
</select>
|
|
|
<!-- 财务专员查看需要待收款的数据 -->
|
|
|
<select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
- select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
+ select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
o.process_status as processStatus,ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,o.approval,
|
|
|
a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
|
|
|
o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,o.create_time as createTime,
|
|
|
- 0 as companyId, "湖南科德信息咨询有限公司" as companyName
|
|
|
+ 0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName
|
|
|
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 admin a on o.salesman_id = a.id
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
@@ -1083,7 +1086,7 @@
|
|
|
and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.departmentId != null and o.departmentId != """>
|
|
|
- and a.department_id = #{o.departmentId,jdbcType=INTEGER}
|
|
|
+ and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
|
|
|
@@ -1126,7 +1129,7 @@
|
|
|
and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.departmentId != null and o.departmentId != """>
|
|
|
- and a.department_id = #{o.departmentId,jdbcType=INTEGER}
|
|
|
+ and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
|
|
|
@@ -1165,7 +1168,7 @@
|
|
|
</if>
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
- left join department dep on c.department_id=dep.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
<if test="specially == 2">
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
@@ -1249,6 +1252,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
count(*)
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
<if test="specially == 2">
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
@@ -1304,6 +1308,9 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and dep.id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|