From 390574e0d9d01618c867c5db6a9ab21a43057eda Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期五, 08 八月 2025 15:40:11 +0800
Subject: [PATCH] 部分新功能

---
 multi-system/src/main/resources/mapper/system/ProductItemMapper.xml |   45 +++++++++++++++------------------------------
 1 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/multi-system/src/main/resources/mapper/system/ProductItemMapper.xml b/multi-system/src/main/resources/mapper/system/ProductItemMapper.xml
index a8f39a9..a020fd6 100644
--- a/multi-system/src/main/resources/mapper/system/ProductItemMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/ProductItemMapper.xml
@@ -11,6 +11,8 @@
             pi.`catalogue_id`,
             CONCAT(c.`number`, ' ', c.`mess`) AS catalogue_name,
             pi.`company_id`,
+            pi.`item_id`,
+            i.item_name,
             sc.`name` as company_name,
             pi.`number`,
             pi.`erdact`,
@@ -24,45 +26,28 @@
             pi.`update_time`
         FROM
             product_item pi
-                LEFT JOIN sys_company sc on pi.company_id = sc.id
-        left join catalogue c on pi.catalogue_id = c.id
+            LEFT JOIN sys_company sc on pi.company_id = sc.id
+            left join catalogue c on pi.catalogue_id = c.id
+            LEFT JOIN item i ON pi.item_id = i.id
+            LEFT JOIN item_user iu ON i.id = iu.item_id
         WHERE
             pi.del_flag = 1 and pi.type = #{type}
         <if test="companyId!=null and companyId!=''">
             and pi.company_id =#{companyId}
         </if>
+        <if test="userId!=null">
+            and iu.user_id = #{userId}
+        </if>
+        <if test="itemId!=null">
+            and pi.item_id = #{itemId}
+        </if>
         <if test="catalogueId!=null and catalogueId!=''">
             and pi.catalogue_id = #{catalogueId}
         </if>
+        GROUP BY
+            pi.id
         ORDER BY
             pi.create_time ASC
     </select>
-    <select id="writeProduct" resultType="com.gkhy.exam.system.domain.ProductItem">
-        SELECT
-        pi.`id`,
-        pi.`catalogue_id`,
-        c.`mess` as catalogue_name,
-        pi.`company_id`,
-        sc.`name` as company_name,
-        pi.`number`,
-        pi.`erdact`,
-        pi.`file_name`,
-        pi.`file_path`,
-        pi.`del_flag`,
-        pi.`create_by`,
-        pi.`create_time`,
-        pi.`update_by`,
-        pi.`update_time`
-        FROM
-        product_item pi
-        LEFT JOIN sys_company sc on pi.company_id = sc.id
-        left join catalogue c on pi.catalogue_id = c.id
-        WHERE
-        pi.del_flag = 1 and pi.company_id = #{companyId}  and pi.catalogue_id in
-        (<foreach collection="catalogueIds" item="catalogueId" separator=",">
-            #{catalogueId}
-         </foreach>)
-        ORDER BY
-        pi.create_time ASC
-    </select>
+
 </mapper>

--
Gitblit v1.9.2