<?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>
|