Pu Zhibing
2025-04-01 8444084e6aa11efa23287e7f82474ac22378a5c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?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.ruoyi.system.mapper.config.QuickEntryMapper">
 
    <resultMap type="QuickEntry" id="QuickEntryResult">
        <result property="entryId"    column="entry_id"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="entrySort"    column="entry_sort"    />
        <result property="entryUrl"    column="entry_url"    />
        <result property="entryName"    column="entry_name"    />
        <result property="targetType"    column="target_type"    />
        <result property="linkUrl"    column="link_url"    />
        <result property="jumpId"    column="jump_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUserId"    column="create_user_id"    />
    </resultMap>
 
    <sql id="selectQuickEntryVo">
        select entry_id, del_flag, entry_sort, entry_url, entry_name, target_type, link_url, jump_id, create_time, create_user_id from t_quick_entry
    </sql>
 
    <select id="selectQuickEntryList" parameterType="QuickEntry" resultMap="QuickEntryResult">
        <include refid="selectQuickEntryVo"/>
        <where>
            <if test="entrySort != null "> and entry_sort = #{entrySort}</if>
            <if test="entryUrl != null  and entryUrl != ''"> and entry_url = #{entryUrl}</if>
            <if test="entryName != null  and entryName != ''"> and entry_name like concat('%', #{entryName}, '%')</if>
            <if test="targetType != null "> and target_type = #{targetType}</if>
            <if test="linkUrl != null  and linkUrl != ''"> and link_url = #{linkUrl}</if>
            <if test="jumpId != null  and jumpId != ''"> and jump_id = #{jumpId}</if>
            <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
        </where>
    </select>
 
    <select id="selectQuickEntryByEntryId" parameterType="Long" resultMap="QuickEntryResult">
        <include refid="selectQuickEntryVo"/>
        where entry_id = #{entryId}
    </select>
 
    <insert id="insertQuickEntry" parameterType="QuickEntry" useGeneratedKeys="true" keyProperty="entryId">
        insert into t_quick_entry
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">del_flag,</if>
            <if test="entrySort != null">entry_sort,</if>
            <if test="entryUrl != null">entry_url,</if>
            <if test="entryName != null">entry_name,</if>
            <if test="targetType != null">target_type,</if>
            <if test="linkUrl != null">link_url,</if>
            <if test="jumpId != null">jump_id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createUserId != null">create_user_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">#{delFlag},</if>
            <if test="entrySort != null">#{entrySort},</if>
            <if test="entryUrl != null">#{entryUrl},</if>
            <if test="entryName != null">#{entryName},</if>
            <if test="targetType != null">#{targetType},</if>
            <if test="linkUrl != null">#{linkUrl},</if>
            <if test="jumpId != null">#{jumpId},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createUserId != null">#{createUserId},</if>
        </trim>
    </insert>
 
    <update id="updateQuickEntry" parameterType="QuickEntry">
        update t_quick_entry
        <trim prefix="SET" suffixOverrides=",">
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="entrySort != null">entry_sort = #{entrySort},</if>
            <if test="entryUrl != null">entry_url = #{entryUrl},</if>
            <if test="entryName != null">entry_name = #{entryName},</if>
            <if test="targetType != null">target_type = #{targetType},</if>
            <if test="linkUrl != null">link_url = #{linkUrl},</if>
            <if test="jumpId != null">jump_id = #{jumpId},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createUserId != null">create_user_id = #{createUserId},</if>
        </trim>
        where entry_id = #{entryId}
    </update>
 
    <delete id="deleteQuickEntryByEntryId" parameterType="Long">
        delete from t_quick_entry where entry_id = #{entryId}
    </delete>
 
    <delete id="deleteQuickEntryByEntryIds" parameterType="String">
        delete from t_quick_entry where entry_id in
        <foreach item="entryId" collection="array" open="(" separator="," close=")">
            #{entryId}
        </foreach>
    </delete>
 
    <select id="listQuickEntryVo" resultType="com.ruoyi.system.domain.vo.AppQuickEntryVo">
        SELECT
        entry_id entryId,
        entry_url entryUrl,
        entry_name entryName,
        link_type linkType,
        target_type targetType,
        link_url linkUrl,
        jump_type jumpType,
        jump_id jumpId
        FROM t_quick_entry WHERE del_flag = 0
        ORDER BY entry_sort,create_time DESC
    </select>
 
    <select id="pageMgtQuickEntry" resultType="com.ruoyi.system.domain.vo.MgtQuickEntryPageVo">
        SELECT
            entry_id entryId,
            entry_url entryUrl,
            entry_name entryName,
            CASE target_type
                WHEN 1 THEN '外链'
                WHEN 2 THEN '内链'
                ELSE '无'
                END targetType,
            link_url linkUrl,
            create_time createTime,
            entry_sort entrySort
        FROM t_quick_entry WHERE del_flag = 0
        ORDER BY entry_sort,create_time DESC
    </select>
</mapper>