2025-09-10 14:17:16 +08:00
|
|
|
<?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.bonus.web.mapper.ArchiveMapper">
|
|
|
|
|
<insert id="saveArchivalCatalogue">
|
|
|
|
|
INSERT INTO da_ky_files_contents
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="contentName != null and contentName != ''">content_name,</if>
|
|
|
|
|
<if test="parentId != null">parent_id,</if>
|
|
|
|
|
<if test="level != null">`level`,</if>
|
|
|
|
|
<if test="sort != null">sort,</if>
|
|
|
|
|
<if test="markCode != null and markCode != ''">mark_code,</if>
|
|
|
|
|
<if test="term != null and term != ''">term,</if>
|
|
|
|
|
<if test="unitName != null and unitName != ''">unit_name,</if>
|
|
|
|
|
<if test="major != null and major != ''">major,</if>
|
|
|
|
|
<if test="classifyMark != null and classifyMark != ''">classify_mark,</if>
|
|
|
|
|
<if test="createUserId != null">create_user_id,</if>
|
|
|
|
|
<if test="createUserName != null and createUserName != ''">create_user_name,</if>
|
|
|
|
|
<if test="updateUserId != null">update_user_id,</if>
|
|
|
|
|
<if test="updateUserName != null and updateUserName != ''">update_user_name,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
VALUES
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="contentName != null and contentName != ''">#{contentName},</if>
|
|
|
|
|
<if test="parentId != null">#{parentId},</if>
|
|
|
|
|
<if test="level != null">#{level},</if>
|
|
|
|
|
<if test="sort != null">#{sort},</if>
|
|
|
|
|
<if test="markCode != null and markCode != ''">#{markCode},</if>
|
|
|
|
|
<if test="term != null and term != ''">#{term},</if>
|
|
|
|
|
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
|
|
|
|
<if test="major != null and major != ''">#{major},</if>
|
|
|
|
|
<if test="classifyMark != null and classifyMark != ''">#{classifyMark},</if>
|
|
|
|
|
<if test="createUserId != null">#{createUserId},</if>
|
|
|
|
|
<if test="createUserName != null and createUserName != ''">#{createUserName},</if>
|
|
|
|
|
<if test="updateUserId != null">#{updateUserId},</if>
|
|
|
|
|
<if test="updateUserName != null and updateUserName != ''">#{updateUserName},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="editArchivalCatalogue">
|
|
|
|
|
UPDATE da_ky_files_contents
|
|
|
|
|
<set>
|
|
|
|
|
<if test="contentName != null and contentName != ''">content_name = #{contentName},</if>
|
|
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
|
|
<if test="level != null">`level` = #{level},</if>
|
|
|
|
|
<if test="sort != null">sort = #{sort},</if>
|
|
|
|
|
<if test="markCode != null and markCode != ''">mark_code = #{markCode},</if>
|
|
|
|
|
<if test="term != null and term != ''">term = #{term},</if>
|
|
|
|
|
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
|
|
|
|
<if test="major != null and major != ''">major = #{major},</if>
|
|
|
|
|
<if test="classifyMark != null and classifyMark != ''">classify_mark = #{classifyMark},</if>
|
|
|
|
|
<if test="createUserId != null">create_user_id = #{createUserId},</if>
|
|
|
|
|
<if test="createUserName != null and createUserName != ''">create_user_name = #{createUserName},</if>
|
|
|
|
|
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
|
|
|
|
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
|
|
|
|
|
</set>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
<delete id="delArchivalCatalogue">
|
|
|
|
|
DELETE FROM da_ky_files_contents
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="getArchivalCatalogueTree" resultType="com.bonus.web.domain.ArchivalCatalogueDto">
|
|
|
|
|
SELECT
|
2025-09-15 16:08:16 +08:00
|
|
|
t1.id,
|
|
|
|
|
t1.content_name AS contentName,
|
|
|
|
|
t1.parent_id AS parentId,
|
|
|
|
|
t2.content_name AS parentName,
|
|
|
|
|
t1.`level` AS LEVEL,
|
|
|
|
|
t1.sort,
|
|
|
|
|
t1.mark_code AS markCode,
|
|
|
|
|
t1.term,
|
|
|
|
|
t1.unit_name AS unitName,
|
|
|
|
|
t1.major,
|
|
|
|
|
t1.classify_mark AS classifyMark,
|
|
|
|
|
t1.create_time AS createTime,
|
|
|
|
|
t1.update_time AS updateTime,
|
|
|
|
|
t1.create_user_id AS createUserId,
|
|
|
|
|
t1.create_user_name AS createUserName,
|
|
|
|
|
t1.update_user_id AS updateUserId,
|
|
|
|
|
t1.update_user_name AS updateUserName,
|
|
|
|
|
t1.del_flag AS delFlag
|
2025-09-10 14:17:16 +08:00
|
|
|
FROM
|
2025-09-15 16:08:16 +08:00
|
|
|
da_ky_files_contents t1
|
|
|
|
|
LEFT JOIN da_ky_files_contents t2 ON t1.parent_id = t2.id
|
2025-09-10 14:17:16 +08:00
|
|
|
WHERE
|
2025-09-15 16:08:16 +08:00
|
|
|
t1.del_flag = '1'
|
|
|
|
|
AND t1.LEVEL IN ( 0, 1, 2, 3 )
|
2025-09-10 14:17:16 +08:00
|
|
|
<if test="contentName != null and contentName != ''">
|
2025-09-15 16:08:33 +08:00
|
|
|
and t1.content_name like concat('%', #{contentName}, '%')
|
2025-09-10 14:17:16 +08:00
|
|
|
</if>
|
|
|
|
|
ORDER BY
|
2025-09-15 16:08:16 +08:00
|
|
|
t1.`level`,t1.sort
|
2025-09-10 14:17:16 +08:00
|
|
|
</select>
|
|
|
|
|
<select id="getArchivalCatalogue" resultType="com.bonus.web.domain.ArchivalCatalogueDto">
|
|
|
|
|
SELECT
|
2025-09-15 16:10:19 +08:00
|
|
|
id,
|
|
|
|
|
content_name AS contentName,
|
|
|
|
|
parent_id AS parentId,
|
|
|
|
|
`level` AS level,
|
|
|
|
|
sort,
|
|
|
|
|
mark_code AS markCode,
|
|
|
|
|
term,
|
|
|
|
|
unit_name AS unitName,
|
|
|
|
|
major,
|
|
|
|
|
classify_mark AS classifyMark,
|
|
|
|
|
create_time AS createTime,
|
|
|
|
|
update_time AS updateTime,
|
|
|
|
|
create_user_id AS createUserId,
|
|
|
|
|
create_user_name AS createUserName,
|
|
|
|
|
update_user_id AS updateUserId,
|
|
|
|
|
update_user_name AS updateUserName
|
2025-09-10 14:17:16 +08:00
|
|
|
FROM
|
2025-09-15 16:10:19 +08:00
|
|
|
da_ky_files_contents
|
2025-09-10 14:17:16 +08:00
|
|
|
WHERE
|
2025-09-15 16:10:19 +08:00
|
|
|
del_flag = '1' and parent_id = #{parentId} and level = 4
|
2025-09-10 14:17:16 +08:00
|
|
|
<if test="contentName != null and contentName != ''">
|
2025-09-15 16:10:19 +08:00
|
|
|
and content_name like concat('%', #{contentName}, '%')
|
2025-09-10 14:17:16 +08:00
|
|
|
</if>
|
2025-09-15 16:10:19 +08:00
|
|
|
order by create_time desc
|
2025-09-10 14:17:16 +08:00
|
|
|
</select>
|
|
|
|
|
<select id="getArchivalCatalogueById" resultType="com.bonus.web.domain.ArchivalCatalogueDto">
|
|
|
|
|
SELECT
|
|
|
|
|
t1.id,
|
|
|
|
|
t1.content_name AS contentName,
|
|
|
|
|
t1.parent_id AS parentId,
|
|
|
|
|
t2.content_name as parentName,
|
|
|
|
|
t1.`level` AS level,
|
|
|
|
|
t1.sort,
|
|
|
|
|
t1.mark_code AS markCode,
|
|
|
|
|
t1.term,
|
|
|
|
|
t1.unit_name AS unitName,
|
|
|
|
|
t1.major,
|
|
|
|
|
t1.classify_mark AS classifyMark,
|
|
|
|
|
t1.create_time AS createTime,
|
|
|
|
|
t1.update_time AS updateTime,
|
|
|
|
|
t1.create_user_id AS createUserId,
|
|
|
|
|
t1.create_user_name AS createUserName,
|
|
|
|
|
t1.update_user_id AS updateUserId,
|
|
|
|
|
t1.update_user_name AS updateUserName
|
|
|
|
|
FROM
|
|
|
|
|
da_ky_files_contents t1
|
|
|
|
|
left join da_ky_files_contents t2 on t1.parent_id = t2.id
|
|
|
|
|
WHERE
|
|
|
|
|
t1.id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getchild" resultType="java.lang.Integer">
|
|
|
|
|
SELECT
|
|
|
|
|
count(t1.id)
|
|
|
|
|
FROM
|
|
|
|
|
da_ky_files_contents t1
|
|
|
|
|
left join da_ky_files_contents t2 on t1.parent_id = t2.id
|
|
|
|
|
WHERE
|
|
|
|
|
t2.id = #{id} and t1.del_flag = '1'
|
|
|
|
|
</select>
|
2025-09-15 15:43:00 +08:00
|
|
|
<select id="getFilesClassifyMarkSelect" resultType="com.bonus.web.domain.SelectDto">
|
|
|
|
|
SELECT
|
|
|
|
|
id,
|
|
|
|
|
classify_mark_name AS name
|
|
|
|
|
FROM
|
|
|
|
|
da_ky_files_classify_mark
|
|
|
|
|
WHERE
|
|
|
|
|
del_flag = '1'
|
|
|
|
|
</select>
|
2025-09-10 14:17:16 +08:00
|
|
|
|
|
|
|
|
</mapper>
|