From f99d902db3c31e57229439962abd2746bb06868d Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期三, 02 七月 2025 16:33:23 +0800
Subject: [PATCH] 新增

---
 multi-system/src/main/resources/mapper/system/CatalogueMapper.xml |   41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
index e03a1a3..5855d20 100644
--- a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
@@ -16,8 +16,8 @@
     </insert>
 
     <update id="updateCatalogueData">
-        UPDATE `train_exam`.`catalogue_data`
-        SET
+        UPDATE `catalogue_data`
+        <set>
             <if test="companyId!=null">
                 `company_id` = #{companyId},
             </if>
@@ -27,23 +27,25 @@
             <if test="content!=null and content!=''">
                 `content` = #{content},
             </if>
-            <if test="analysic!=null and analysic!=''">
+            <if test="analysis!=null and analysis!=''">
                 `analysis` = #{analysis},
             </if>
             <if test="delFlag!=null and delFlag!=''">
                 `del_flag` = #{delFlag},
             </if>
-            <if test="updateBy!=null and update!=''">
+            <if test="updateBy!=null and updateBy!=''">
                 `update_by` = #{updateBy},
             </if>
             <if test="updateTime!=null">
                 `update_time` = #{updateTime}
             </if>
+        </set>
         WHERE
             `id` = #{id}
     </update>
     <update id="updateCatalogueDataFile">
-            UPDATE `train_exam`.`catalogue_data_file`
+            UPDATE `catalogue_data_file`
+            <set>
                 <if test="catalogueId!=null">
                     `catalogue_id` = #{catalogueId},
                 </if>
@@ -63,7 +65,7 @@
                     `type` = #{type},
                 </if>
                 <if test="delFlag != null and delFlag != ''" >
-                    del_flag = #{item.delFlag},
+                    del_flag = #{delFlag},
                 </if>
                 <if test="updateBy != null" >
                     update_by = #{updateBy},
@@ -71,7 +73,11 @@
                 <if test="updateTime != null" >
                     update_time = #{updateTime}
                 </if>
+            </set>
             where id = #{id}
+    </update>
+    <update id="updateCatalogueDataFileByCompanyId">
+        UPDATE catalogue_data_file set del_flag = #{delFlag} ,update_by = #{updateBy} , update_time=#{updateTime} where company_id =#{companyId} and catalogue_id = #{catalogueId}
     </update>
 
     <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo">
@@ -123,21 +129,23 @@
         SELECT
             id,
             `catalogue_data_id`,
+            company_id,
+            catalogue_id,
             `name`,
             `file_path`,
+            file_name,
             `type`,
             `create_by`,
             `create_time`
         FROM
             catalogue_data_file
         WHERE
-            company_id = #{companyId} and catalogue_id = #{catalogueId}
+            company_id = #{companyId} and catalogue_id = #{catalogueId} and del_flag =1
     </select>
     <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.CatalogueData">
         SELECT
             `id`,
             `company_id`,
-            name,
             `catalogue_id`,
             `content`,
             `analysis`,
@@ -148,7 +156,22 @@
             `update_time`
         FROM
             catalogue_data
-        where company_id = #{companyId} and del_flag = 1
+        where company_id = #{companyId} and del_flag = 1 and catalogue_id = #{catalogueId}
 
     </select>
+    <select id="selectCatalogueDataById" resultType="com.gkhy.exam.system.domain.CatalogueData">
+        SELECT
+            `id`,
+            `company_id`,
+            `catalogue_id`,
+            `content`,
+            `analysis`,
+            `del_flag`,
+            `create_by`,
+            `create_time`,
+            `update_by`,
+            `update_time`
+        FROM
+            catalogue_data where del_flag = 1 and id=#{catalogueDataId}
+    </select>
 </mapper>

--
Gitblit v1.9.2