From 99132a43bf344f2aafdd9894b0762d2eedd9767b Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期二, 01 七月 2025 17:15:25 +0800
Subject: [PATCH] 修改

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

diff --git a/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
new file mode 100644
index 0000000..170cccb
--- /dev/null
+++ b/multi-system/src/main/resources/mapper/system/CatalogueMapper.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gkhy.exam.system.mapper.CatalogueMapper">
+    <insert id="insertCatalogueData" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO  `catalogue_data`
+            (  `company_id`, `catalogue_id`, `content`, `analysis`,  `create_by`, `create_time` )
+        VALUES
+            ( #{companyId}, #{catalogueId}, #{content}, #{analysis}, #{createBy}, #{createTime} )
+    </insert>
+
+    <insert id="insertCatalogueDataFile">
+        INSERT INTO `train_exam`.`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>
+
+    <update id="updateCatalogueData">
+        UPDATE `catalogue_data`
+        SET
+            <if test="companyId!=null">
+                `company_id` = #{companyId},
+            </if>
+            <if test="catalogueId!=null">
+                `catalogue_id` = #{catalogueId},
+            </if>
+            <if test="content!=null and content!=''">
+                `content` = #{content},
+            </if>
+            <if test="analysic!=null and analysic!=''">
+                `analysis` = #{analysis},
+            </if>
+            <if test="delFlag!=null and delFlag!=''">
+                `del_flag` = #{delFlag},
+            </if>
+            <if test="updateBy!=null and update!=''">
+                `update_by` = #{updateBy},
+            </if>
+            <if test="updateTime!=null">
+                `update_time` = #{updateTime}
+            </if>
+        WHERE
+            `id` = #{id}
+    </update>
+    <update id="updateCatalogueDataFile">
+            UPDATE `catalogue_data_file`
+                set
+                <if test="catalogueId!=null">
+                    `catalogue_id` = #{catalogueId},
+                </if>
+                <if test="companyId!=null">
+                    `company_id` = #{companyId},
+                </if>
+                <if test="name!=null">
+                    `name` = #{name},
+                </if>
+                <if test="filePath!=null">
+                    `file_path` = #{filePath},
+                </if>
+                <if test="fileName!=null">
+                    `file_name` = #{fileName},
+                </if>
+                <if test="type!=null">
+                    `type` = #{type},
+                </if>
+                <if test="delFlag != null and delFlag != ''" >
+                    del_flag = #{delFlag},
+                </if>
+                <if test="updateBy != null" >
+                    update_by = #{updateBy},
+                </if>
+                <if test="updateTime != null" >
+                    update_time = #{updateTime}
+                </if>
+            where id = #{id}
+    </update>
+
+    <select id="selectCatalogueList" resultType="com.gkhy.exam.system.domain.vo.CatalogueVo">
+        SELECT
+            `id`,
+            `parent_id`,
+            `number`,
+            `mess`,
+            `type`,
+            `del_flag`,
+            `create_by`,
+            `create_time`,
+            `update_by`,
+            `update_time`
+        FROM
+            catalogue
+        WHERE del_flag = 1
+          <if test="type!=null">
+              and type = #{type}
+          </if>
+        ORDER BY create_time ASC
+    </select>
+    <select id="selectCatalogueDataList" resultType="com.gkhy.exam.system.domain.vo.CatalogueDataVo">
+        SELECT
+            cd.`id`,
+            cd.`company_id`,
+            sc.name,
+            cd.`catalogue_id`,
+            cd.`content`,
+            cd.`analysis`,
+            cd.`del_flag`,
+            cd.`create_by`,
+            cd.`create_time`,
+            cd.`update_by`,
+            cd.`update_time`
+        FROM
+            catalogue_data cd
+        left join sys_company sc on cd.company_id = sc.id
+        WHERE
+            cd.del_flag = 1
+          <if test="catalogueId!=null">
+              and cd.catalogue_id = #{catalogueId}
+          </if>
+        <if test="companyId!=null">
+            and cd.company_id = #{companyId}
+        </if>
+    </select>
+    <select id="selectCatalogueDataFile" resultType="com.gkhy.exam.system.domain.CatalogueDataFile">
+        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} and del_flag =1
+    </select>
+    <select id="selectByCompanyId" resultType="com.gkhy.exam.system.domain.CatalogueData">
+        SELECT
+            `id`,
+            `company_id`,
+            name,
+            `catalogue_id`,
+            `content`,
+            `analysis`,
+            `del_flag`,
+            `create_by`,
+            `create_time`,
+            `update_by`,
+            `update_time`
+        FROM
+            catalogue_data
+        where company_id = #{companyId} and del_flag = 1
+
+    </select>
+</mapper>

--
Gitblit v1.9.2