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.
105 lines
5.5 KiB
105 lines
5.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.zc.mapper.IotBoardTemplateContentMapper">
|
|
|
|
<resultMap type="com.zc.domain.IotBoardTemplateContent" id="IotBoardTemplateContentResult">
|
|
<result property="id" column="id" />
|
|
<result property="templateId" column="template_id" />
|
|
<result property="content" column="content" />
|
|
<result property="fontColor" column="font_color" />
|
|
<result property="fontSize" column="font_size" />
|
|
<result property="fontType" column="font_type" />
|
|
<result property="fontSpacing" column="font_spacing" />
|
|
<result property="coordinate" column="coordinate" />
|
|
<result property="imageUrl" column="image_url" />
|
|
<result property="height" column="height" />
|
|
<result property="width" column="width" />
|
|
</resultMap>
|
|
|
|
<sql id="selectIotBoardTemplateContentVo">
|
|
select id, template_id, content, font_color, font_size, font_type, font_spacing, coordinate, image_url, height, width from iot_board_template_content
|
|
</sql>
|
|
|
|
<select id="selectSdVmsTemplateContentList" parameterType="com.zc.domain.IotBoardTemplateContent" resultMap="IotBoardTemplateContentResult">
|
|
<include refid="selectIotBoardTemplateContentVo"/>
|
|
<where>
|
|
<if test="templateId != null and templateId != ''"> and template_id = #{templateId}</if>
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
<if test="fontColor != null and fontColor != ''"> and font_color = #{fontColor}</if>
|
|
<if test="fontSize != null "> and font_size = #{fontSize}</if>
|
|
<if test="fontType != null and fontType != ''"> and font_type = #{fontType}</if>
|
|
<if test="fontSpacing != null "> and font_spacing = #{fontSpacing}</if>
|
|
<if test="coordinate != null and coordinate != ''"> and coordinate = #{coordinate}</if>
|
|
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
|
|
<if test="height != null and height != ''"> and height = #{height}</if>
|
|
<if test="width != null and width != ''"> and width = #{width}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSdVmsTemplateContentById" parameterType="Long" resultMap="IotBoardTemplateContentResult">
|
|
<include refid="selectIotBoardTemplateContentVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSdVmsTemplateContent" parameterType="com.zc.domain.IotBoardTemplateContent" useGeneratedKeys="true" keyProperty="id">
|
|
insert into iot_board_template_content
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="templateId != null">template_id,</if>
|
|
<if test="content != null">content,</if>
|
|
<if test="fontColor != null">font_color,</if>
|
|
<if test="fontSize != null">font_size,</if>
|
|
<if test="fontType != null">font_type,</if>
|
|
<if test="fontSpacing != null">font_spacing,</if>
|
|
<if test="coordinate != null">coordinate,</if>
|
|
<if test="imageUrl != null">image_url,</if>
|
|
<if test="height != null">height,</if>
|
|
<if test="width != null">width,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="templateId != null">#{templateId},</if>
|
|
<if test="content != null">#{content},</if>
|
|
<if test="fontColor != null">#{fontColor},</if>
|
|
<if test="fontSize != null">#{fontSize},</if>
|
|
<if test="fontType != null">#{fontType},</if>
|
|
<if test="fontSpacing != null">#{fontSpacing},</if>
|
|
<if test="coordinate != null">#{coordinate},</if>
|
|
<if test="imageUrl != null">#{imageUrl},</if>
|
|
<if test="height != null">#{height},</if>
|
|
<if test="width != null">#{width},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSdVmsTemplateContent" parameterType="com.zc.domain.IotBoardTemplateContent">
|
|
update iot_board_template_content
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="templateId != null">template_id = #{templateId},</if>
|
|
<if test="content != null">content = #{content},</if>
|
|
<if test="fontColor != null">font_color = #{fontColor},</if>
|
|
<if test="fontSize != null">font_size = #{fontSize},</if>
|
|
<if test="fontType != null">font_type = #{fontType},</if>
|
|
<if test="fontSpacing != null">font_spacing = #{fontSpacing},</if>
|
|
<if test="coordinate != null">coordinate = #{coordinate},</if>
|
|
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
|
<if test="height != null">height = #{height},</if>
|
|
<if test="width != null">width = #{width},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSdVmsTemplateContentById" parameterType="Long">
|
|
delete from iot_board_template_content where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSdVmsTemplateContentByIds" parameterType="String">
|
|
delete from iot_board_template_content where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<delete id="deleteContentByTemplateId" parameterType="String">
|
|
delete from iot_board_template_content where template_id = #{templateId}
|
|
</delete>
|
|
</mapper>
|
|
|