From decd9f8bf3e6119efce34e6bbc0c320a2a2446c1 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 02 二月 2024 15:41:50 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 164 insertions(+), 0 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
new file mode 100644
index 0000000..fcf7a2d
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.erp.mapper.sd.OrderMapper">
+ <select id="selectMaxOrderId">
+ select
+ COUNT(a.order_id)
+ from
+ `order` as a
+ where
+ date(a.create_time) = curdate()
+ </select>
+
+
+ <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
+ on o.order_id = od.order_id
+ set
+ o.quantity = od.b,
+ o.area = od.c,
+ o.perimeter= od.aa
+ where
+ o.order_id = #{orderId}
+
+ </update>
+
+ <select id="getOrderList">
+ select
+ *
+ from
+ `order` as o
+ where o.create_time>=#{startDate} and o.create_time <= #{endDate}
+
+ <if test="orderType!= null and orderType != ''">
+ and o.create_order = #{orderType}
+ </if>
+
+ <if test="order.orderId != null and order.orderId != ''">
+ and o.order_id REGEXP #{order.orderId}
+ </if>
+
+ <if test="order.customerId != null and order.customerId != ''">
+ and o.customer_id REGEXP #{customerId}
+ </if>
+ <if test="order.customerName != null and order.customerName != ''">
+ and o.customer_name REGEXP #{customerName}
+ </if>
+ <if test="order.project != null and order.project != ''">
+ and o.project REGEXP #{order.project}
+ </if>
+ <if test="order.batch != null and order.batch != ''">
+ and o.batch REGEXP #{order.batch}
+ </if>
+ <if test="order.quantity != null and order.quantity != ''">
+ and o.quantity REGEXP #{order.quantity}
+ </if>
+
+ <if test="order.area != null and order.area != ''">
+ and o.area REGEXP #{order.area}
+ </if>
+ <if test="order.createTime != null and order.createTime != ''">
+ and date(o.create_time) = #{order.createTime}
+ </if>
+ <if test="order.packType != null and order.packType != ''">
+ and o.pack_type REGEXP #{order.packType}
+ </if>
+ <if test="order.orderType != null and order.orderType != ''">
+ and o.order_type REGEXP #{order.orderType}
+ </if>
+ <if test="order.salesman != null and order.salesman != ''">
+ and o.salesman REGEXP #{order.salesman}
+ </if>
+
+ <if test="order.perimeter != null and order.perimeter != ''">
+ and o.perimeter REGEXP #{order.perimeter}
+ </if>
+ <if test="order.deliveryDate != null and order.deliveryDate != ''">
+ and o.delivery_date REGEXP #{order.deliveryDate}
+ </if>
+ <if test="order.customerBatch != null and order.customerBatch != ''">
+ and o.customer_batch REGEXP #{order.customerBatch}
+ </if>
+ <if test="order.otherRemarks != null and order.otherRemarks != ''">
+ and o.other_remarks REGEXP #{order.otherRemarks}
+ </if>
+ <if test="order.deliveryAddress != null and order.deliveryAddress != ''">
+ and o.delivery_address REGEXP #{order.deliveryAddress}
+ </if>
+
+ order by o.id desc
+ limit #{offset},#{pageSize}
+ </select>
+
+ <select id="getPageTotal">
+ select
+ CEILING(count(o.id)/#{pageSize})
+ from
+ `order` as o
+ where o.create_time>=#{startDate} and o.create_time <= #{endDate}
+ <if test="orderType!= null and orderType != ''">
+ and o.create_order = #{orderType}
+ </if>
+
+ <if test="order.orderId != null and order.orderId != ''">
+ and o.order_id REGEXP #{order.orderId}
+ </if>
+
+ <if test="order.customerId != null and order.customerId != ''">
+ and o.customer_id REGEXP #{customerId}
+ </if>
+ <if test="order.customerName != null and order.customerName != ''">
+ and o.customer_name REGEXP #{customerName}
+ </if>
+ <if test="order.project != null and order.project != ''">
+ and o.project REGEXP #{order.project}
+ </if>
+ <if test="order.batch != null and order.batch != ''">
+ and o.batch REGEXP #{order.batch}
+ </if>
+ <if test="order.quantity != null and order.quantity != ''">
+ and o.quantity REGEXP #{order.quantity}
+ </if>
+
+ <if test="order.area != null and order.area != ''">
+ and o.area REGEXP #{order.area}
+ </if>
+ <if test="order.createTime != null and order.createTime != ''">
+ and date(o.create_time) = #{order.createTime}
+ </if>
+ <if test="order.packType != null and order.packType != ''">
+ and o.pack_type REGEXP #{order.packType}
+ </if>
+ <if test="order.orderType != null and order.orderType != ''">
+ and o.order_type REGEXP #{order.orderType}
+ </if>
+ <if test="order.salesman != null and order.salesman != ''">
+ and o.salesman REGEXP #{order.salesman}
+ </if>
+
+ <if test="order.perimeter != null and order.perimeter != ''">
+ and o.perimeter REGEXP #{order.perimeter}
+ </if>
+ <if test="order.deliveryDate != null and order.deliveryDate != ''">
+ and o.delivery_date REGEXP #{order.deliveryDate}
+ </if>
+ <if test="order.customerBatch != null and order.customerBatch != ''">
+ and o.customer_batch REGEXP #{order.customerBatch}
+ </if>
+ <if test="order.otherRemarks != null and order.otherRemarks != ''">
+ and o.other_remarks REGEXP #{order.otherRemarks}
+ </if>
+ <if test="order.deliveryAddress != null and order.deliveryAddress != ''">
+ and o.delivery_address REGEXP #{order.deliveryAddress}
+ </if>
+
+ order by o.id desc
+ limit #{offset},#{pageSize}
+ </select>
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0