From c15623a135260f0804bd2c5a69fce957f4b30abe Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期二, 08 七月 2025 09:03:53 +0800
Subject: [PATCH] 修改

---
 multi-system/src/main/resources/mapper/system/CatalogueMapper.xml |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
index 5855d20..9b34e41 100644
--- a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
@@ -9,7 +9,7 @@
     </insert>
 
     <insert id="insertCatalogueDataFile">
-        INSERT INTO `train_exam`.`catalogue_data_file`
+        INSERT INTO `catalogue_data_file`
             ( `catalogue_id`,`company_id`, `name`, `file_path`,`file_name`, `type`, `create_by`, `create_time` )
         VALUES
             ( #{catalogueId},#{companyId}, #{name}, #{filePath},#{fileName}, #{type}, #{createBy}, #{createTime} )
@@ -79,6 +79,9 @@
     <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>
+    <delete id="deleteByCatalogueDataFileId">
+        DELETE FROM catalogue_data_file WHERE id = #{id}
+    </delete>
 
     <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo">
         SELECT
@@ -98,7 +101,16 @@
           <if test="type!=null">
               and type = #{type}
           </if>
-        ORDER BY create_time ASC
+        ORDER BY
+        CAST(SUBSTRING_INDEX(number, '.', 1) AS UNSIGNED) ASC,
+        CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(number, '.', 2), '.', -1) AS UNSIGNED) ASC,  -- 第二级
+        CAST(
+        CASE
+        WHEN LENGTH(number) - LENGTH(REPLACE(number, '.', '')) >= 2
+        THEN SUBSTRING_INDEX(number, '.', -1)
+        ELSE '0'
+        END AS UNSIGNED
+        ) ASC
     </select>
     <select id="selectCatalogueDataList" resultType="com.gkhy.exam.system.domain.vo.CatalogueDataVo">
         SELECT

--
Gitblit v1.9.2