|
@@ -0,0 +1,74 @@
|
|
|
+<?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.fs.system.mapper.SysKeywordMapper">
|
|
|
+
|
|
|
+ <resultMap type="SysKeyword" id="SysKeywordResult">
|
|
|
+ <result property="keywordId" column="keyword_id" />
|
|
|
+ <result property="keyword" column="keyword" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSysKeywordVo">
|
|
|
+ select keyword_id, keyword, type, company_id, create_time, update_time from sys_keyword
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSysKeywordList" parameterType="SysKeyword" resultMap="SysKeywordResult">
|
|
|
+ <include refid="selectSysKeywordVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="keyword != null and keyword != ''"> and keyword = #{keyword}</if>
|
|
|
+ <if test="type != null "> and type = #{type}</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSysKeywordById" parameterType="Long" resultMap="SysKeywordResult">
|
|
|
+ <include refid="selectSysKeywordVo"/>
|
|
|
+ where keyword_id = #{keywordId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSysKeyword" parameterType="SysKeyword" useGeneratedKeys="true" keyProperty="keywordId">
|
|
|
+ insert into sys_keyword
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="keyword != null">keyword,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="keyword != null">#{keyword},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateSysKeyword" parameterType="SysKeyword">
|
|
|
+ update sys_keyword
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="keyword != null">keyword = #{keyword},</if>
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where keyword_id = #{keywordId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteSysKeywordById" parameterType="Long">
|
|
|
+ delete from sys_keyword where keyword_id = #{keywordId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSysKeywordByIds" parameterType="String">
|
|
|
+ delete from sys_keyword where keyword_id in
|
|
|
+ <foreach item="keywordId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{keywordId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|