小程序后台代码
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.
 
 
 
 
 
 

98 lines
4.2 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.SceneMessageMapper">
<resultMap type="com.zdxt.knowledge.domain.SceneMessage" id="SceneMessageResult">
<result property="guid" column="guid"/>
<result property="title" column="title"/>
<result property="content" column="content"/>
<result property="open" column="open"/>
<result property="uploadPath" column="upload_path"/>
<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="selectSceneMessageVo">
select guid,
content,
title,
`open`,
upload_path,
creator,
create_time,
update_by,
update_time
from scene_message
</sql>
<select id="selectSceneMessageList" parameterType="SceneMessage" resultMap="SceneMessageResult">
<include refid="selectSceneMessageVo"/>
<where>
<if test="open != null">and `open` = #{open}</if>
<if test="title != null and title != ''">and `title` = #{title}</if>
<if test="creator != null and creator != ''">and creator = #{creator}</if>
</where>
order by create_time desc
</select>
<select id="selectSceneMessageById" parameterType="String" resultMap="SceneMessageResult">
<include refid="selectSceneMessageVo"/>
where guid = #{guid}
</select>
<insert id="insertSceneMessage" parameterType="SceneMessage">
insert into scene_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="guid != null ">guid,</if>
<if test="title != null and title != ''">`title`,</if>
<if test="content != null and content != ''">`content`,</if>
<if test="open != null ">`open`,</if>
<if test="uploadPath != null and uploadPath != ''">`upload_path`,</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="title != null and title != ''">#{title},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="open != null ">#{open},</if>
<if test="uploadPath != null and uploadPath != ''">#{uploadPath},</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="updateSceneMessage" parameterType="SceneMessage">
update scene_message
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="open != null ">`open` = #{open},</if>
<if test="uploadPath != null and uploadPath != ''">upload_path = #{uploadPath},</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="deleteSceneMessageById" parameterType="String">
delete
from scene_message
where guid = #{guid}
</delete>
<delete id="deleteSceneMessageByIds" parameterType="String">
delete from scene_message where guid in
<foreach item="guid" collection="array" open="(" separator="," close=")">
#{guid}
</foreach>
</delete>
</mapper>