From a2cd0f560c226d7830c79fa3c0a6cb3db72927b4 Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期三, 26 二月 2025 08:25:31 +0800
Subject: [PATCH] 修改

---
 billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml |   63 +++++++++++++++++++++++++++++--
 1 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
index 1fc153e..25c5522 100644
--- a/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
+++ b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
@@ -26,6 +26,61 @@
         select id, work_order_no, sales_order_code, product_code, line_code, plan_qty, plan_start_time, plan_end_time, order_status, create_time, update_time, create_by, update_by, remarks, del_flag from om_production_order_info
     </sql>
 
+    <!-- 鏌ヨ order_status 涓� 1 涓� plan_start_time 鏈�鏃╃殑涓�鏉¤褰� -->
+    <select id="selectEarliestOrder" resultType="OmProductionOrderInfo">
+            SELECT TOP 1 *
+            FROM om_production_order_info
+            WHERE order_status IN (1, 2)
+            ORDER BY plan_start_time ASC
+    </select>
+
+    <select id="selectEarliestOrder2" resultType="OmProductionOrderInfo">
+        SELECT TOP 1 *
+        FROM om_production_order_info
+        WHERE order_status IN (5)
+        ORDER BY plan_start_time ASC
+    </select>
+
+    <select id="updateOrderStatus" resultType="OmProductionOrderInfo">
+        UPDATE om_production_order_info
+        SET order_status = 5
+        WHERE id = (
+            SELECT TOP 1 id
+            FROM om_production_order_info
+            WHERE order_status IN (1, 2)
+            ORDER BY plan_start_time ASC
+        );
+    </select>
+    <select id="updateOrderStatus2" resultType="OmProductionOrderInfo">
+        UPDATE om_production_order_info
+        SET order_status = 2
+        WHERE id = (
+            SELECT TOP 1 id
+            FROM om_production_order_info
+            WHERE order_status IN (1, 2)
+            ORDER BY plan_start_time ASC
+        );
+    </select>
+
+    <select id="getSerialNumber" resultType="OmProductionOrderInfo">
+        SELECT  *
+        FROM om_production_order_info
+        WHERE id = 1
+    </select>
+
+    <select id="updateSerialNumber" resultType="OmProductionOrderInfo">
+        UPDATE om_production_order_info
+        SET plan_qty = plan_qty + 1
+        WHERE id = 1;
+    </select>
+    <select id="updateYear" resultType="OmProductionOrderInfo">
+        UPDATE om_production_order_info
+        SET remarks = remarks + 1,
+            qty = 1
+        WHERE id = 1;
+    </select>
+
+
     <select id="selectOmProductionOrderInfoList" parameterType="OmProductionOrderInfo" resultMap="OmProductionOrderInfoResult">
         <include refid="selectOmProductionOrderInfoVo"/>
         <where>  
@@ -33,13 +88,13 @@
             <if test="salesOrderCode != null  and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if>
             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
             <if test="orderStatus != null  and orderStatus != ''"> and order_status = #{orderStatus}</if>
-            and del_flag = "0"
+            and del_flag = 0
         </where>
     </select>
     
     <select id="selectOmProductionOrderInfoById" parameterType="Long" resultMap="OmProductionOrderInfoResult">
         <include refid="selectOmProductionOrderInfoVo"/>
-        where id = #{id} and del_flag = "0"
+        where id = #{id} and del_flag = 0
     </select>
 
     <insert id="insertOmProductionOrderInfo" parameterType="OmProductionOrderInfo" useGeneratedKeys="true" keyProperty="id">
@@ -100,11 +155,11 @@
     </update>
 
     <update id="deleteOmProductionOrderInfoById" parameterType="Long">
-        update om_production_order_info set del_flag = "1" where id = #{id}
+        update om_production_order_info set del_flag = 1 where id = #{id}
     </update>
 
     <update id="deleteOmProductionOrderInfoByIds" parameterType="String">
-        update om_production_order_info set del_flag = "1" where id in
+        update om_production_order_info set del_flag = 1 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

--
Gitblit v1.9.3