From cf781983869a96d92069b20f6d2dfd4287d541fc Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期日, 28 四月 2024 11:31:32 +0800
Subject: [PATCH] 添加satoken权限控制
---
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml | 40 +++++++++++++++++++++++++++++++++++-----
1 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
index d3ab571..363a41e 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -17,13 +17,28 @@
<update id="updateOrderParameter">
update `order` o
left join
- (select a.order_id,sum(a.perimeter) as aa,sum(a.quantity) as b,sum(a.compute_gross_area) as c
- from sd.order_detail as a group by a.order_id) od
+ (select a.order_id,
+ round(sum(a.perimeter),2) as aa,
+ sum(a.quantity) as b,
+ sum(a.compute_gross_area) as c,
+ sum(a.gross_amount) as 'detailAmount'
+ from sd.order_detail as a group by a.order_id
+ ) as od
on o.order_id = od.order_id
+ left join (select oom.order_id,
+ sum(oom.money) as 'money'
+ from order_other_money as oom
+ where
+ oom.order_id = #{orderId}
+ group by oom.order_id
+ ) as c
+ on c.order_id = o.order_id
set
+ o.money = ifnull(od.detailAmount,0)+ifnull(c.money,0),
o.quantity = od.b,
o.area = od.c,
- o.perimeter= od.aa
+ o.perimeter= od.aa,
+ o.other_money = ifnull(c.money,0)
where
o.order_id = #{orderId}
@@ -31,9 +46,12 @@
<select id="getOrderList">
select
- *
+ *,
+ sum(fgi.quantity_available) as goodsQuantity
from
`order` as o
+ left join mm.finished_goods_inventory as fgi
+ on o.order_id = fgi.order_id
where date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
<if test="orderType!= null and orderType != ''">
@@ -91,7 +109,7 @@
<if test="order.deliveryAddress != null and order.deliveryAddress != ''">
and o.delivery_address REGEXP #{order.deliveryAddress}
</if>
-
+ group by o.id
order by o.id desc
limit #{offset},#{pageSize}
</select>
@@ -174,4 +192,16 @@
update `order` set money = #{order.money} where order_id = #{order.orderId}
</update>
+ <update id="cancelOrder">
+ update `order` as a set
+ a.create_order = - a.create_order,
+ a.process_review = - a.process_review,
+ a.order_review = - a.order_review,
+ a.production_order = - a.production_order,
+ a.processing_card = - a.processing_card,
+ a.warehousing = - a.warehousing,
+ a.delivery = - a.delivery
+ where order_id = #{order.orderId}
+ </update>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0