From acaf8ca38cd32bc474bb46b593db2a8d75b9bfdd Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期六, 12 十月 2024 08:26:23 +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 |   45 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 41 insertions(+), 4 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 d6672cf..b4dd989 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -15,23 +15,60 @@
 
     <select id="selectMaxOrderId">
         select
-           ifnull(SUBSTR(max(order_id) from 9),0)
+           ifnull(SUBSTR(max(right(order_id,8)) from 7),0)
         from
             `order` as a
         where
             date(a.create_time) = curdate()
-        order by id desc,order_id	desc limit  1
+        /*order by order_id desc,order_id	desc limit  1*/
     </select>
 
     <select id="selectMaxOrderIdByMonth">
         select
-            ifnull(SUBSTR(max(order_id) from 7),0)
+            ifnull(SUBSTR(max(right(order_id,8)) from 5),0)
         from
             `order` as a
         where
             date(a.create_time)  BETWEEN DATE_FORMAT(DATE(NOW()), '%Y-%m-01') AND DATE(NOW())
     </select>
-    
+
+    <select id="selectMaxOrderIdByYear">
+       select
+           ifnull(SUBSTR(max(right(order_id,8)) from 3),0)
+        from
+            `order` as a
+        where
+            year(a.create_time)  = year(now())
+            and a.id>400
+    </select>
+
+    <select id="selectOrderIdMin">
+        select count(*) from sd.`order` where SUBSTR(order_id,3,11)>#{substringInt}
+    </select>
+
+    <select id="selectOrderIdIs">
+        select count(*) from sd.`order` where SUBSTR(order_id,3,11)=#{substringInt}
+    </select>
+
+    <select id="selectOrderIdDay">
+        select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},9,2)=01
+    </select>
+
+    <select id="selectOrderIdMonth">
+        select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},7,4)=0001
+    </select>
+
+    <select id="selectOrderIdYear">
+        select count(*) from sd.`order` where order_id=#{oldOrderId} and SUBSTR(#{oldOrderId},5,2)=000001
+    </select>
+
+    <select id="selectOrderId">
+        select * from sd.`order` where order_id=#{orderId}
+    </select>
+
+    <update id="updateOrderId">
+        update sd.`order` set order_id=#{newOrderId} where order_id=#{oldOrderId}
+    </update>
 
     <update id="updateOrderParameter">
         update `order` o

--
Gitblit v1.8.0