From 25c7cdf3ea9c4e63f16bbb52ce40e28bc65dc87c Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期六, 13 九月 2025 11:08:50 +0800
Subject: [PATCH] 1

---
 src/main/resources/mapper/OrderMapper.xml |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/OrderMapper.xml b/src/main/resources/mapper/OrderMapper.xml
index f422abc..2d0db2c 100644
--- a/src/main/resources/mapper/OrderMapper.xml
+++ b/src/main/resources/mapper/OrderMapper.xml
@@ -42,4 +42,123 @@
 
     </resultMap>
 
+    <update id="updateSettle">
+        update man_order
+        set settle = #{settle}
+        ,update_time = getdate()
+        <if test="userId != null">
+            ,update_by = #{userId}
+        </if>
+        where 1=1
+        and id = #{orderId}
+    </update>
+    <update id="updateSettleByOrderNo">
+        update man_order
+        set settle = #{status}
+        ,update_time = getdate()
+        <if test="userId != null">
+            ,update_by = #{userId}
+        </if>
+        where 1=1
+        and order_no = #{orderNo}
+        and settle != #{status}
+    </update>
+    <update id="updateStatusByOrderNo">
+        update man_order set account_day = #{status},update_time = getdate(),update_by = #{userId} where order_no = #{orderNo}
+    </update>
+    <update id="updatePendingSettleByOrderNo">
+        update man_order set settle = #{status},update_time = getdate() where order_no = #{orderNo} and settle = 1
+    </update>
+
+    <select id="selectComplete" resultMap="BaseResultMap">
+        select
+            top 5 mo.*
+        from
+            man_order mo
+                inner join man_doc_type mt on
+                mo.doc_type = mt.doc_id
+        where
+            mt.pakout = 1
+          and mo.settle = 5
+          and mo.status = 1
+        order by
+            mo.create_time asc
+    </select>
+
+    <select id="selectComplete2" resultMap="BaseResultMap">
+        select
+            top 5 mo.*
+        from
+            man_order mo
+                inner join man_doc_type mt on
+                mo.doc_type = mt.doc_id
+        where
+            mt.pakout = 1
+          and mo.settle = 5
+          and mo.status = 1
+          and mo.doc_type = 26
+        order by
+            mo.create_time asc
+    </select>
+
+    <insert id="addToLogTable">
+        INSERT INTO man_order_log SELECT * FROM man_order WHERE id = #{id}
+    </insert>
+
+    <select id="selectorderNoL" resultMap="BaseResultMap">
+        select top 10 *
+        from man_order
+        where 1=1
+        <if test="orderNo != null">
+            and order_no = #{orderNo}
+        </if>
+    </select>
+    <select id="selectStockUpOrderDetl" resultType="java.lang.String">
+        select
+            DISTINCT md.brand
+        from
+            man_order mo
+                left join man_order_detl md on
+                mo.order_no = md.order_no
+        where
+            mo.doc_type = 21
+          and mo.account_day = 1
+          and md.inspect = 0
+          and mo.settle = 1
+    </select>
+    <select id="selectOrderNosByOrderNoLike" resultType="java.lang.String">
+        select order_no from man_order where settle = 4 and order_no like '%' + #{orderNo} + '%' and doc_type in(21,23)
+    </select>
+    <select id="getUnfulfilledOrders" resultType="com.zy.asrs.entity.OrderStatisticsDto">
+        select
+            mo.order_no orderNo,
+            count(mo.order_no) sum,
+	        count(case when md.work_qty = 0 then 1 end) toShipQuantity,
+	        count(case when md.work_qty != 0 and md.qty = 0 then 1 end) workQuantity,
+		count(case when md.anfme = md.qty then 1 end) completedQuantity
+        from
+            man_order mo
+            LEFT JOIN man_order_detl md on
+            mo.id = md.order_id
+        where
+            mo.doc_type = 21
+          and mo.settle in(1, 2)
+        <if test="orderNo != ''">
+            and mo.order_no = #{orderNo}
+        </if>
+        GROUP BY
+            mo.order_no
+    </select>
+    <select id="selectOrderByOrderNo" resultMap="BaseResultMap">
+        select *
+        from man_order
+        where order_no = #{orderNo}
+    </select>
+    <select id="getOrderNosByDocType" resultType="String">
+        select order_no
+        from man_order
+        where doc_type =#{docType}
+        and status = 0
+    </select>
+
 </mapper>

--
Gitblit v1.9.1