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

138 lines
6.1 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.SceneTabMapper">
<resultMap type="com.zdxt.knowledge.domain.SceneTab" id="SceneTabResult">
<result property="guid" column="guid"/>
<result property="title" column="title"/>
<result property="pagePath" column="page_path"/>
<result property="selectedColor" column="selected_color"/>
<result property="type" column="type"/>
<result property="sort" column="sort"/>
<result property="hide" column="hide"/>
<result property="iconPath" column="icon_path"/>
<result property="selectedIconPath" column="selected_icon_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="selectSceneTabVo">
select guid,
title,
page_path,
selected_color,
type,
sort,
hide,
icon_path,
selected_icon_path,
creator,
create_time,
update_by,
update_time
from scene_tab
</sql>
<select id="selectSceneTabList" parameterType="SceneTab" resultMap="SceneTabResult">
<include refid="selectSceneTabVo"/>
<where>
<if test="title != null and title != ''">and `title` like concat('%', #{title}, '%')</if>
<if test="creator != null and creator != ''">and creator = #{creator}</if>
</where>
order by sort ASC
</select>
<select id="selectSceneTabById" parameterType="String" resultMap="SceneTabResult">
<include refid="selectSceneTabVo"/>
where guid = #{guid}
</select>
<insert id="insertSceneTab" parameterType="SceneTab">
insert into scene_tab
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="guid != null ">guid,</if>
<if test="title != null and title != ''">`title`,</if>
<if test="pagePath != null and pagePath != ''">page_path,</if>
<if test="selectedColor != null and selectedColor != ''">selected_color,</if>
<if test="iconPath != null and iconPath != ''">icon_path,</if>
<if test="selectedIconPath != null and selectedIconPath != ''">selected_icon_path,</if>
<if test="sort != null ">sort,</if>
<if test="hide != null and hide != ''">`hide`,</if>
<if test="type != null and type != ''">`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="title != null and title != ''">#{title},</if>
<if test="pagePath != null and pagePath != ''">#{pagePath},</if>
<if test="selectedColor != null and selectedColor != ''">#{selectedColor},</if>
<if test="iconPath != null and iconPath != ''">#{iconPath},</if>
<if test="selectedIconPath != null and selectedIconPath != ''">#{selectedIconPath},</if>
<if test="sort != null ">#{sort},</if>
<if test="hide != null and hide != ''">#{hide},</if>
<if test="type != null and type != ''">#{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="updateSceneTab" parameterType="SceneTab">
update scene_tab
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>
<if test="pagePath != null and pagePath != ''">page_path = #{pagePath},</if>
<if test="selectedColor != null and selectedColor != ''">selected_color = #{selectedColor},</if>
<if test="iconPath != null and iconPath != ''">icon_path = #{iconPath},</if>
<if test="selectedIconPath != null and selectedIconPath != ''">selected_icon_path = #{selectedIconPath},
</if>
<if test="sort != null ">sort = #{sort},</if>
<if test="hide != null ">hide = #{hide},</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="deleteSceneTabById" parameterType="String">
delete
from scene_tab
where guid = #{guid}
</delete>
<delete id="deleteSceneTabByIds" parameterType="String">
delete from scene_tab where guid in
<foreach item="guid" collection="array" open="(" separator="," close=")">
#{guid}
</foreach>
</delete>
<select id="selectMinSort" resultType="INTEGER">
select MAX(sort) as sort
from scene_Tab
</select>
<select id="selectLastSort" parameterType="INTEGER" resultMap="SceneTabResult">
SELECT guid, sort
FROM scene_Tab
WHERE sort = (SELECT MAX(sort) FROM scene_tab where sort &lt; #{sort});
</select>
<select id="selectSceneTabListAll" parameterType="SceneTab" resultMap="SceneTabResult">
select cu.guid, cu.name, zd.upload_path
from scene_tab as cu
inner join zdxt_file as zd
on cu.guid = zd.business_id
where cu.hide = 1
order by cu.sort ASC
</select>
</mapper>