From 3c87c3ff67c2193ab5bfaa31f0fb1ad5a68cd5af Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 15 三月 2024 09:09:10 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/sd/Delivery.xml | 94 ++++++++++++++++++++++++++++++++++++----------
1 files changed, 73 insertions(+), 21 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
index 8dfb8d0..bdeccd8 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
@@ -29,21 +29,33 @@
</resultMap>
+ <delete id="deleteDelivery">
+ delete from sd.delivery where delivery_id=#{deliveryId}
+ </delete>
+ <update id="updateDeliveryToExamine">
+ update sd.delivery set delivery_state=#{deliveryState} where delivery_id=#{deliveryId}
+ </update>
+
<update id="updatedelivery">
update sd.delivery set area=#{area},quantity=#{quantity},money=#{money} where delivery_id=#{oddNumber}
</update>
+
<select id="getmaximum" >
select count(*) from sd.delivery where date(create_time)=CURDATE()
</select>
+ <select id="getDeliveryConut" >
+ select count(*) from sd.delivery where delivery_id=#{deliveryId}
+ </select>
+
<insert id="insertDelivery" useGeneratedKeys="true" >
- insert into sd.delivery(delivery_state,stock_state,delivery_id,order_id,project,customer_id,customer_name,
+ insert into sd.delivery(delivery_state,stock_state,payment_terms,delivery_id,order_id,project,customer_id,customer_name,
delivery_date,pay_method,pay_date,salesman_id,salesman,creator_id,creator,contacts,contact_number,delivery_address,
area,quantity,money,remarks,create_time)
values (
- 0,0,#{number} ,#{orderId},#{delivery.project},#{delivery.customerId},#{delivery.customerName},#{delivery.deliveryDate},#{delivery.payMethod},
+ 0,0,#{delivery.paymentTerms},#{number} ,#{orderId},#{delivery.project},#{delivery.customerId},#{delivery.customerName},#{delivery.deliveryDate},#{delivery.payMethod},
#{delivery.payDate},#{delivery.salesmanId},#{delivery.salesman},#{delivery.creatorId},#{delivery.creator},#{delivery.contacts},#{delivery.contactNumber},#{delivery.deliveryAddress},
0,0,0,#{delivery.remarks},now()
)
@@ -73,7 +85,7 @@
from sd.`order` o
left join mm.finished_goods_inventory fgi on o.order_id = fgi.order_id
<where>
- fgi.quantity_available > 0
+ fgi.quantity_available > 0 and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
<if test="order.orderId != null and order.orderId != ''">
and o.order_id REGEXP #{order.orderId}
</if>
@@ -93,10 +105,10 @@
and o.batch REGEXP #{order.batch}
</if>
<if test="order.money != null and order.money != ''">
- and o.money REGEXP #{order.money}
+ and o.money REGEXP REGEXP_REPLACE(#{order.money},'\\.0+$','')
</if>
<if test="order.area != null and order.area != ''">
- and o.area REGEXP #{order.area}
+ and o.area REGEXP REGEXP_REPLACE(#{order.area},'\\.0+$','')
</if>
<if test="order.packType != null and order.packType != ''">
and o.pack_type REGEXP #{order.packType}
@@ -114,19 +126,20 @@
and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable}
</if>
</where>
- group by o.order_id
+ group by o.order_id order by o.id desc
limit #{offset},#{pageSize};
</select>
<select id="getSelectOrderInventoryPageTotal" >
- select CEILING(count(zu.order_id)/#{pageSize}) from
+ select CEILING(count(zu.order_id)/#{pageSize}) as 'pageTotal',
+ count(zu.order_id) as 'total' from
(select o.create_order,o.process_review,o.order_review,o.production_order,
o.processing_card,o.warehousing,o.delivery,o.order_id,o.customer_id,
o.customer_name,o.quantity,sum(fgi.quantity_available),o.project,o.batch,
o.money,o.area,o.create_time,o.pack_type,o.order_type,o.creator
from sd.`order` o left join mm.finished_goods_inventory fgi on o.order_id=fgi.order_id
<where>
- fgi.quantity_available > 0
+ fgi.quantity_available > 0 and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
<if test="order.orderId != null and order.orderId != ''">
and o.order_id REGEXP #{order.orderId}
</if>
@@ -146,10 +159,10 @@
and o.batch REGEXP #{order.batch}
</if>
<if test="order.money != null and order.money != ''">
- and o.money REGEXP #{order.money}
+ and o.money REGEXP REGEXP_REPLACE(#{order.money},'\\.0+$','')
</if>
<if test="order.area != null and order.area != ''">
- and o.area REGEXP #{order.area}
+ and o.area REGEXP REGEXP_REPLACE(#{order.area},'\\.0+$','')
</if>
<if test="order.packType != null and order.packType != ''">
and o.pack_type REGEXP #{order.packType}
@@ -167,16 +180,16 @@
and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable}
</if>
</where>
- group by o.order_id) as zu
- limit #{offset},#{pageSize};
+ group by o.order_id limit #{offset},#{pageSize}) as zu;
</select>
- <select id="getseletShippingOrderDetaildelivery" >
+ <select id="getSelectShippingOrderDetailDelivery" >
select
+ d.delivery_state,d.stock_state,d.payment_terms,
d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
from sd.delivery d
@@ -190,8 +203,8 @@
</select>
- <select id="getseletShippingOrderDetaildeliverys" >
- select customer_id,customer_name,project,salesman,salesman_id from sd.`order`
+ <select id="getSelectShippingOrderDetailDeliverys" >
+ select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order`
<where>
<if test="orderDetail.orderId != null and orderDetail.orderId != ''">
and order_id regexp #{orderDetail.orderId}
@@ -201,9 +214,10 @@
limit 0,1
</select>
- <select id="getseletShippingOrder">
+ <select id="getSelectShippingOrder">
select * from sd.delivery d
<where>
+ date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate}
<if test="delivery.deliveryId != null and delivery.deliveryId != ''">
and d.delivery_id regexp #{delivery.deliveryId}
</if>
@@ -232,14 +246,52 @@
and d.quantity regexp #{delivery.quantity}
</if>
<if test="delivery.area != null and delivery.area != ''">
- and d.area regexp #{delivery.area}
+ and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','')
</if>
- </where>
+
+ </where>
+ order by d.id desc
+ limit #{offset},#{pageSize};
</select>
- <select id="getseletShippingOrderPageTotal">
+ <select id="getSelectShippingOrderPageTotal">
select
- CEILING(count(id)/#{pageSize})
- from sd.delivery
+ CEILING(count(id)/#{pageSize}) as 'pageTotal',
+ count(id) as 'total'
+ from sd.delivery d
+ <where>
+ date(d.create_time)>=#{startDate} and date(d.create_time) <= #{endDate}
+ <if test="delivery.deliveryId != null and delivery.deliveryId != ''">
+ and d.delivery_id regexp #{delivery.deliveryId}
+ </if>
+ <if test="delivery.creator != null and delivery.creator != ''">
+ and d.creator regexp #{delivery.creator}
+ </if>
+ <if test="delivery.deliveryDate != null and delivery.deliveryDate != ''">
+ and d.delivery_date regexp #{delivery.deliveryDate}
+ </if>
+ <if test="delivery.customerId != null and delivery.customerId != ''">
+ and d.customer_id regexp #{delivery.customerId}
+ </if>
+ <if test="delivery.customerName != null and delivery.customerName != ''">
+ and d.customer_name regexp #{delivery.customerName}
+ </if>
+ <if test="delivery.project != null and delivery.project != ''">
+ and d.project regexp #{delivery.project}
+ </if>
+ <if test="delivery.orderId != null and delivery.orderId != ''">
+ and d.order_id regexp #{delivery.orderId}
+ </if>
+ <if test="delivery.payMethod != null and delivery.payMethod != ''">
+ and d.pay_method regexp #{delivery.payMethod}
+ </if>
+ <if test="delivery.quantity != null and delivery.quantity != ''">
+ and d.quantity regexp #{delivery.quantity}
+ </if>
+ <if test="delivery.area != null and delivery.area != ''">
+ and d.area regexp REGEXP_REPLACE(#{delivery.area},'\\.0+$','')
+ </if>
+ </where>
+ limit #{offset},#{pageSize};
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0