From d9aab59e3d4c8688eaf00c0d98f6926a218ff57f Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期一, 28 四月 2025 15:28:11 +0800
Subject: [PATCH] 拣货单出库完成,但是库存没减,日志埋点

---
 src/main/resources/mapper/PlaMapper.xml |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/PlaMapper.xml b/src/main/resources/mapper/PlaMapper.xml
index 1c1f62d..ea2d216 100644
--- a/src/main/resources/mapper/PlaMapper.xml
+++ b/src/main/resources/mapper/PlaMapper.xml
@@ -1,6 +1,17 @@
 <?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.zy.asrs.mapper.PlaMapper">
+    <update id="autoThaw">
+        update
+            asr_pla_detl
+        set
+            stock_freeze = 1
+        where
+            stock_freeze = 0
+          and status != '鍏ㄩ儴鍑哄簱'
+	and stock_freeze_date is not null
+	and datediff(day , stock_freeze_date, getdate()) > 90
+    </update>
     <select id="getStockStatisAll" resultType="com.zy.asrs.entity.Pla">
         select brand, matnr,workshop, sum(weight_anfme) as weight
         from asr_pla_detl
@@ -14,10 +25,22 @@
             <if test="etime != null">
                 and pakin_time &lt;= #{etime}
             </if>
+            <if test="status == null or status.trim() == ''">
+                and status in ('宸插叆搴�','閮ㄥ垎鍑哄簱','寰呭嚭搴�')
+            </if>
             <if test="status != null and status != ''">
                 and status = #{status}
             </if>
+            <if test="type != null and type != ''">
+                and type = #{type}
+            </if>
+            <if test="workshop != null and workshop != ''">
+                and workshop = #{workshop}
+            </if>
+            <if test="transfer != null and transfer != ''">
+                and transfer = #{transfer}
+            </if>
         </where>
-        GROUP BY brand,matnr,workshop ORDER BY matnr,workshop
+        GROUP BY brand,matnr,workshop HAVING SUM(weight_anfme) > 0 ORDER BY matnr,workshop
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1