|
@@ -0,0 +1,87 @@
|
|
|
|
+<?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.HyperlinkMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="Hyperlink" id="HyperlinkResult">
|
|
|
|
+ <result property="hyperlinkId" column="hyperlink_id" />
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
+ <result property="url" column="url" />
|
|
|
|
+ <result property="type" column="type" />
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectHyperlinkVo">
|
|
|
|
+ select hyperlink_id, name, url, type, create_by, create_time, update_by, update_time, remark from hyperlink
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectHyperlinkList" parameterType="Hyperlink" resultMap="HyperlinkResult">
|
|
|
|
+ <include refid="selectHyperlinkVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="url != null and url != ''"> and url = #{url}</if>
|
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
+ </where>
|
|
|
|
+ order by create_time
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectHyperlinkByHyperlinkId" parameterType="Long" resultMap="HyperlinkResult">
|
|
|
|
+ <include refid="selectHyperlinkVo"/>
|
|
|
|
+ where hyperlink_id = #{hyperlinkId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertHyperlink" parameterType="Hyperlink" useGeneratedKeys="true" keyProperty="hyperlinkId">
|
|
|
|
+ insert into hyperlink
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
|
+ <if test="url != null">url,</if>
|
|
|
|
+ <if test="type != null">type,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
|
+ <if test="url != null">#{url},</if>
|
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateHyperlink" parameterType="Hyperlink">
|
|
|
|
+ update hyperlink
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
+ <if test="url != null">url = #{url},</if>
|
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where hyperlink_id = #{hyperlinkId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteHyperlinkByHyperlinkId" parameterType="Long">
|
|
|
|
+ delete from hyperlink where hyperlink_id = #{hyperlinkId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteHyperlinkByHyperlinkIds" parameterType="String">
|
|
|
|
+ delete from hyperlink where hyperlink_id in
|
|
|
|
+ <foreach item="hyperlinkId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{hyperlinkId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|