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.
161 lines
8.1 KiB
161 lines
8.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.zc.mapper.IotBoardTemplateMapper">
|
|
|
|
<resultMap type="com.zc.domain.IotBoardTemplate" id="IotBoardTemplateResult">
|
|
<result property="id" column="id" />
|
|
<result property="screenSize" column="screen_size" />
|
|
<result property="inScreenMode" column="in_screen_mode" />
|
|
<result property="rollSpeed" column="roll_speed" />
|
|
<result property="stopTime" column="stop_time" />
|
|
<result property="applyType" column="apply_type" />
|
|
<result property="isCurrency" column="is_currency" />
|
|
<result property="templateType" column="template_type" />
|
|
<result property="vmsType" column="vms_type" />
|
|
<result property="remark" column="remark" />
|
|
<result property="category" column="category" />
|
|
<result property="dictLable" column="dict_lable" />
|
|
<result property="screenMode" column="screenMode" />
|
|
<association property="tcontent" column="template_id" javaType="com.zc.domain.IotBoardTemplateContent" resultMap="contentResult"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="contentResult" type="com.zc.domain.IotBoardTemplateContent">
|
|
<id property="templateId" column="template_id" />
|
|
<result property="id" column="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="selectIotBoardTemplateVo">
|
|
select a.id, a.screen_size, a.in_screen_mode, a.roll_speed, a.stop_time, a.apply_type, a.is_currency,
|
|
a.template_type, a.vms_type, a.remark, b.id, b.template_id, b.content, b.font_color, b.font_size,
|
|
b.font_type, b.font_spacing, b.coordinate, b.image_url, b.height, b.width, a.category, c.dict_label,d.dict_label screenMode
|
|
from iot_board_template a
|
|
left join iot_board_template_content b on a.id = b.template_id
|
|
left join sys_dict_data c on c.dict_type = "iot_template_category" and a.category = c.dict_value
|
|
left join sys_dict_data d on d.dict_type = "iot_device_font_inScreen_mode" and a.in_screen_mode = d.dict_value
|
|
</sql>
|
|
|
|
<select id="selectSdVmsTemplateList" parameterType="com.zc.domain.IotBoardTemplate" resultMap="IotBoardTemplateResult">
|
|
<include refid="selectIotBoardTemplateVo"/>
|
|
<where>
|
|
<if test="screenSize != null and screenSize != ''"> and a.screen_size = #{screenSize}</if>
|
|
<if test="applyType != null and applyType != ''"> and a.apply_type = #{applyType}</if>
|
|
<if test="isCurrency != null "> and a.is_currency = #{isCurrency}</if>
|
|
<if test="templateType != null "> and a.template_type = #{templateType}</if>
|
|
<if test="vmsType != null and vmsType != ''"> and a.vms_type = #{vmsType}</if>
|
|
<if test="category != null and category != ''"> and a.category = #{category}</if>
|
|
<if test="searchValue != null and searchValue != ''"> and b.content LIKE CONCAT('%',#{searchValue},'%')</if>
|
|
<if test="ids != null and ids != ''"> and FIND_IN_SET(a.id,#{ids}) > 0</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectTemplateList" resultMap="IotBoardTemplateResult">
|
|
select a.id, a.screen_size, a.in_screen_mode, a.roll_speed, a.stop_time, a.apply_type, a.is_currency,
|
|
a.template_type, a.vms_type, a.remark, a.category
|
|
from iot_board_template a
|
|
where 1=1
|
|
<if test="category != null and category != ''"> and a.category = #{category}</if>
|
|
<if test="devicePixel != null and devicePixel != ''"> and a.screen_size = #{devicePixel}</if>
|
|
</select>
|
|
|
|
<select id="selectSdVmsTemplateById" parameterType="Long" resultMap="IotBoardTemplateResult">
|
|
<include refid="selectIotBoardTemplateVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSdVmsTemplate" parameterType="com.zc.domain.IotBoardTemplate">
|
|
insert into iot_board_template
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="screenSize != null">screen_size,</if>
|
|
<if test="inScreenMode != null">in_screen_mode,</if>
|
|
<if test="rollSpeed != null">roll_speed,</if>
|
|
<if test="stopTime != null">stop_time,</if>
|
|
<if test="applyType != null">apply_type,</if>
|
|
<if test="isCurrency != null">is_currency,</if>
|
|
<if test="templateType != null">template_type,</if>
|
|
<if test="vmsType != null">vms_type,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="category != null">category,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="screenSize != null">#{screenSize},</if>
|
|
<if test="inScreenMode != null">#{inScreenMode},</if>
|
|
<if test="rollSpeed != null">#{rollSpeed},</if>
|
|
<if test="stopTime != null">#{stopTime},</if>
|
|
<if test="applyType != null">#{applyType},</if>
|
|
<if test="isCurrency != null">#{isCurrency},</if>
|
|
<if test="templateType != null">#{templateType},</if>
|
|
<if test="vmsType != null">#{vmsType},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="category != null">#{category},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSdVmsTemplate" parameterType="com.zc.domain.IotBoardTemplate">
|
|
update iot_board_template
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="screenSize != null">screen_size = #{screenSize},</if>
|
|
<if test="inScreenMode != null">in_screen_mode = #{inScreenMode},</if>
|
|
<if test="rollSpeed != null">roll_speed = #{rollSpeed},</if>
|
|
<if test="stopTime != null">stop_time = #{stopTime},</if>
|
|
<if test="applyType != null">apply_type = #{applyType},</if>
|
|
<if test="isCurrency != null">is_currency = #{isCurrency},</if>
|
|
<if test="vmsType != null">vms_type = #{vmsType},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="category != null">category = #{category},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSdVmsTemplateById" parameterType="Long">
|
|
delete from iot_board_template where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSdVmsTemplateByIds" parameterType="Long">
|
|
delete from iot_board_template where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectSdVmsTemplateId" resultType="Long">
|
|
SELECT id from iot_board_template ORDER BY id desc LIMIT 1
|
|
</select>
|
|
|
|
<select id="getAllSdVmsTemplateList" resultType="hashmap">
|
|
select a.id value, a.screen_size devicePixel, a.category, b.id contentId, b.template_id templateId, b.content label
|
|
from iot_board_template a
|
|
right join iot_board_template_content b on a.id = b.template_id
|
|
GROUP BY b.template_id
|
|
</select>
|
|
|
|
<select id="getSdVmsTemplateContent" parameterType="java.lang.Long" resultType="hashmap">
|
|
SELECT
|
|
bt.id,
|
|
bt.screen_size,
|
|
btc.content,
|
|
btc.font_color,
|
|
btc.font_size,
|
|
btc.font_type,
|
|
btc.font_spacing,
|
|
btc.coordinate,
|
|
bt.stop_time
|
|
FROM
|
|
iot_board_template bt
|
|
LEFT JOIN iot_board_template_content btc ON bt.id = btc.template_id
|
|
WHERE
|
|
1 =1
|
|
AND bt.id = #{id}
|
|
</select>
|
|
</mapper>
|
|
|