You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
3.5 KiB
87 lines
3.5 KiB
<?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.zdxt.knowledge.mapper.SceneTextMapper">
|
|
|
|
<resultMap type="com.zdxt.knowledge.domain.SceneText" id="SceneTextResult">
|
|
<result property="guid" column="guid"/>
|
|
<result property="content" column="content"/>
|
|
<result property="type" column="type"/>
|
|
<result property="creator" column="creator"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectSceneTextVo">
|
|
select guid,
|
|
content,
|
|
type,
|
|
creator,
|
|
create_time,
|
|
update_by,
|
|
update_time
|
|
from scene_text
|
|
</sql>
|
|
|
|
<select id="selectSceneTextList" parameterType="SceneText" resultMap="SceneTextResult">
|
|
<include refid="selectSceneTextVo"/>
|
|
<where>
|
|
<if test="type != null">and `type` = #{type}</if>
|
|
<if test="creator != null and creator != ''">and creator = #{creator}</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectSceneTextById" parameterType="String" resultMap="SceneTextResult">
|
|
<include refid="selectSceneTextVo"/>
|
|
where guid = #{guid}
|
|
</select>
|
|
|
|
<insert id="insertSceneText" parameterType="SceneText">
|
|
insert into scene_text
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">guid,</if>
|
|
<if test="content != null and content != ''">`content`,</if>
|
|
<if test="type != null ">`type`,</if>
|
|
<if test="creator != null and creator != ''">creator,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null ">updateTime,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">#{guid},</if>
|
|
<if test="content != null and content != ''">#{content},</if>
|
|
<if test="type != null ">#{type},</if>
|
|
<if test="creator != null and creator != ''">#{creator},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null ">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSceneText" parameterType="SceneText">
|
|
update scene_text
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="content != null and content != ''">content = #{content},</if>
|
|
<if test="type != null ">`type` = #{type},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where guid = #{guid}
|
|
</update>
|
|
|
|
<delete id="deleteSceneTextById" parameterType="String">
|
|
delete
|
|
from scene_text
|
|
where guid = #{guid}
|
|
</delete>
|
|
|
|
<delete id="deleteSceneTextByIds" parameterType="String">
|
|
delete from scene_text where guid in
|
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
|
#{guid}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|