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 |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 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 12a9917..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,17 +15,17 @@
 
     <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
@@ -33,13 +33,13 @@
     </select>
 
     <select id="selectMaxOrderIdByYear">
-       select ifnull((select
-            SUBSTR(order_id from 5)
+       select
+           ifnull(SUBSTR(max(right(order_id,8)) from 3),0)
         from
             `order` as a
         where
             year(a.create_time)  = year(now())
-        order by  id desc limit 1),0) temp
+            and a.id>400
     </select>
 
     <select id="selectOrderIdMin">
@@ -50,6 +50,22 @@
         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>

--
Gitblit v1.8.0