From f67161d150eb5720b28fd3f9fbb40c4145d1146c Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 10 六月 2026 11:42:37 +0800
Subject: [PATCH] feat:1.已审核只能编辑单价 2.添加完成按钮 3.添加标签打印和单据打印次数展示

---
 src/main/resources/mapper/basic/ProductModelMapper.xml |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/basic/ProductModelMapper.xml b/src/main/resources/mapper/basic/ProductModelMapper.xml
index cb80816..9a7e927 100644
--- a/src/main/resources/mapper/basic/ProductModelMapper.xml
+++ b/src/main/resources/mapper/basic/ProductModelMapper.xml
@@ -56,6 +56,22 @@
             <if test="c.parentName != null and c.parentName != ''">
                 AND pt.top_name LIKE CONCAT('%', #{c.parentName}, '%')
             </if>
+            <if test="c.topProductParentId != null and c.topProductParentId > 0">
+                and p.id in (
+                    WITH RECURSIVE product_tree AS (
+                        SELECT id
+                        FROM product
+                        WHERE id = #{c.topProductParentId}
+                        
+                        UNION ALL
+                        
+                        SELECT p.id
+                        FROM product p
+                        INNER JOIN product_tree pt ON p.parent_id = pt.id
+                    )
+                    select id from product_tree
+                )
+            </if>
         </where>
         ORDER BY pm.id DESC
     </select>

--
Gitblit v1.9.3