From f9feae49eee21286708bcef1cea91be34d9e9241 Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期二, 25 十一月 2025 09:04:59 +0800
Subject: [PATCH] 修改新增
---
multi-system/src/main/resources/mapper/system/CatalogueMapper.xml | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 47 insertions(+), 3 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..eb12005 100644
--- a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
@@ -9,10 +9,21 @@
</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} )
+ </insert>
+ <insert id="insertCatalogue" useGeneratedKeys="true" keyProperty="id">
+ INSERT INTO `catalogue` ( `parent_id`, `number`, `mess`, `type`,`company_id` )
+ VALUES
+ (
+ #{parentId},
+ #{number},
+ #{mess},
+ #{type},
+ #{companyId}
+ )
</insert>
<update id="updateCatalogueData">
@@ -79,15 +90,23 @@
<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
`id`,
+ company_id,
`parent_id`,
`number`,
`mess`,
`type`,
+ `file_name`,
+ `file_path`,
+ `is_file`,
`del_flag`,
+ `sort`,
`create_by`,
`create_time`,
`update_by`,
@@ -95,10 +114,35 @@
FROM
catalogue
WHERE del_flag = 1
- <if test="type!=null">
+ <if test="type!=null and type!=''">
and type = #{type}
</if>
- ORDER BY create_time ASC
+ <if test="companyId!=null and companyId!=''">
+ and company_id = #{companyId}
+ </if>
+ <if test="number!=null">
+ and (
+ CAST(SUBSTRING_INDEX(number, '.', 1) AS UNSIGNED) >= 4
+ OR
+ number LIKE '4.%'
+ OR number = '4'
+ )
+ </if>
+ 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
+ <if test="type!=1 and type!=null">
+ ,sort asc
+ </if>
+ ,create_time asc
+
</select>
<select id="selectCatalogueDataList" resultType="com.gkhy.exam.system.domain.vo.CatalogueDataVo">
SELECT
--
Gitblit v1.9.2