|
|
@@ -825,15 +825,21 @@
|
|
|
select * from (
|
|
|
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
|
|
|
+ ,liquidation_status,contract_no as contractNo
|
|
|
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
|
|
|
where delete_sign = 0
|
|
|
and order_status = 2
|
|
|
- <if test="o.processStatus != null">
|
|
|
+ <if test="o.processStatus == 2">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
+ <if test="o.processStatus == 3">
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="o.processStatus == null or o.processStatus ==''">
|
|
|
+ and process_status >= 2
|
|
|
+ </if>
|
|
|
<if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -852,7 +858,7 @@
|
|
|
union
|
|
|
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
|
|
|
+ ,liquidation_status ,contract_no as contractNo
|
|
|
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
|
|
|
@@ -893,9 +899,15 @@
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
where delete_sign = 0
|
|
|
and order_status = 2
|
|
|
- <if test="o.processStatus != null">
|
|
|
+ <if test="o.processStatus == 2">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
+ <if test="o.processStatus == 3">
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="o.processStatus == null or o.processStatus ==''">
|
|
|
+ and process_status >= 2
|
|
|
+ </if>
|
|
|
<if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1009,9 +1021,9 @@
|
|
|
</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 ,
|
|
|
- ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,
|
|
|
o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,o.create_time as createTime,
|
|
|
0 as companyId, "湖南科德信息咨询有限公司" as companyName
|
|
|
from t_order_new o
|
|
|
@@ -1020,7 +1032,13 @@
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
where delete_sign = 0
|
|
|
- and process_status >= 3
|
|
|
+ <if test='o.processStatus == 3'>
|
|
|
+ and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test='o.processStatus == 4'>
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ and process_status
|
|
|
and (approval = 0 or approval = 2)
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
<if test='o.orderStatus != null and o.orderStatus != ""'>
|
|
|
@@ -1060,7 +1078,12 @@
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
where delete_sign = 0
|
|
|
- and process_status >= 3
|
|
|
+ <if test='o.processStatus == 3'>
|
|
|
+ and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test='o.processStatus == 4'>
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
and (approval = 0 or approval = 2)
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
<if test='o.orderStatus != null and o.orderStatus != ""'>
|
|
|
@@ -1391,4 +1414,9 @@
|
|
|
left join t_order_new b on a.order_no=b.order_no
|
|
|
where a.id= #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
+ <update id="updateFinance" parameterType="string">
|
|
|
+ update t_order_new set finance_id= #{newFinance,jdbcType=VARCHAR}
|
|
|
+ where order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
+ and finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
</mapper>
|