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.
101 lines
4.2 KiB
101 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.SceneMedalMapper">
|
|
|
|
<resultMap type="com.zdxt.knowledge.domain.SceneMedal" id="SceneMedalResult">
|
|
<result property="guid" column="guid"/>
|
|
<result property="name" column="name"/>
|
|
<result property="iconPath" column="icon_path"/>
|
|
<result property="earnIconPath" column="earn_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="selectSceneMedalVo">
|
|
select guid,
|
|
name,
|
|
icon_path,
|
|
earn_icon_path,
|
|
creator,
|
|
create_time,
|
|
update_by,
|
|
update_time
|
|
from scene_medal
|
|
</sql>
|
|
|
|
<select id="selectSceneMedalList" parameterType="SceneMedal" resultMap="SceneMedalResult">
|
|
<include refid="selectSceneMedalVo"/>
|
|
<where>
|
|
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
<if test="creator != null and creator != ''">and creator = #{creator}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSceneMedalById" parameterType="String" resultMap="SceneMedalResult">
|
|
<include refid="selectSceneMedalVo"/>
|
|
where guid = #{guid}
|
|
</select>
|
|
|
|
<insert id="insertSceneMedal" parameterType="SceneMedal">
|
|
insert into scene_medal
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">guid,</if>
|
|
<if test="name != null and name != ''">`name`,</if>
|
|
<if test="iconPath != null and iconPath != ''">icon_path,</if>
|
|
<if test="earnIconPath != null and earnIconPath != ''">earn_icon_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 ">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null ">#{guid},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="iconPath != null and iconPath != ''">#{iconPath},</if>
|
|
<if test="earnIconPath != null and earnIconPath != ''">#{earnIconPath},</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="updateSceneMedal" parameterType="SceneMedal">
|
|
update scene_medal
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="iconPath != null and iconPath != ''">icon_path = #{iconPath},</if>
|
|
<if test="earnIconPath != null and earnIconPath != ''">earn_icon_path = #{earnIconPath},</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="deleteSceneMedalById" parameterType="String">
|
|
delete
|
|
from scene_medal
|
|
where guid = #{guid}
|
|
</delete>
|
|
|
|
<delete id="deleteSceneMedalByIds" parameterType="String">
|
|
delete from scene_medal where guid in
|
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
|
#{guid}
|
|
</foreach>
|
|
</delete>
|
|
|
|
|
|
<select id="selectSceneMedalListAll" parameterType="SceneMedal" resultMap="SceneMedalResult">
|
|
select cu.guid, cu.name, zd.upload_path
|
|
from scene_medal 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>
|