<?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.yunfeiyun.agmp.fms.mapper.TssTracecodetplparamMapper">
    
    <resultMap type="TssTracecodetplparam" id="TssTracecodetplparamResult">
        <result property="tplparamId"    column="tplparamId"    />
        <result property="tracecodetplId"    column="tracecodetplId"    />
        <result property="tplparamSeq"    column="tplparamSeq"    />
        <result property="tplparamRemark"    column="tplparamRemark"    />
        <result property="tplparamMediatype"    column="tplparamMediatype"    />
        <result property="tplparamBustype"    column="tplparamBustype"    />
        <result property="tplparamWidth"    column="tplparamWidth"    />
        <result property="tplparamHeight"    column="tplparamHeight"    />
        <result property="tplparamPosx"    column="tplparamPosx"    />
        <result property="tplparamPosy"    column="tplparamPosy"    />
        <result property="tplparamBgcolor"    column="tplparamBgcolor"    />
        <result property="tplparamFontfamily"    column="tplparamFontfamily"    />
        <result property="tplparamFontstyle"    column="tplparamFontstyle"    />
        <result property="tplparamFontsize"    column="tplparamFontsize"    />
        <result property="tplparamLinewidth"    column="tplparamLinewidth"    />
        <result property="tplparamMargin"    column="tplparamMargin"    />
        <result property="tplparamData"    column="tplparamData"    />
    </resultMap>

    <sql id="selectTssTracecodetplparamVo">
        select tplparamId, tracecodetplId, tplparamSeq, tplparamRemark, tplparamMediatype, tplparamBustype, tplparamWidth, tplparamHeight, tplparamPosx, tplparamPosy, tplparamBgcolor, tplparamFontfamily, tplparamFontstyle, tplparamFontsize, tplparamLinewidth, tplparamMargin, tplparamData from TssTracecodetplparam
    </sql>

    <select id="selectTssTracecodetplparamList" parameterType="TssTracecodetplparam" resultMap="TssTracecodetplparamResult">
        <include refid="selectTssTracecodetplparamVo"/>
        <where>  
            <if test="tracecodetplId != null  and tracecodetplId != ''"> and tracecodetplId = #{tracecodetplId}</if>
            <if test="tplparamSeq != null "> and tplparamSeq = #{tplparamSeq}</if>
            <if test="tplparamRemark != null  and tplparamRemark != ''"> and tplparamRemark = #{tplparamRemark}</if>
            <if test="tplparamMediatype != null  and tplparamMediatype != ''"> and tplparamMediatype = #{tplparamMediatype}</if>
            <if test="tplparamBustype != null  and tplparamBustype != ''"> and tplparamBustype = #{tplparamBustype}</if>
            <if test="tplparamWidth != null "> and tplparamWidth = #{tplparamWidth}</if>
            <if test="tplparamHeight != null "> and tplparamHeight = #{tplparamHeight}</if>
            <if test="tplparamPosx != null "> and tplparamPosx = #{tplparamPosx}</if>
            <if test="tplparamPosy != null "> and tplparamPosy = #{tplparamPosy}</if>
            <if test="tplparamBgcolor != null  and tplparamBgcolor != ''"> and tplparamBgcolor = #{tplparamBgcolor}</if>
            <if test="tplparamFontfamily != null  and tplparamFontfamily != ''"> and tplparamFontfamily = #{tplparamFontfamily}</if>
            <if test="tplparamFontstyle != null "> and tplparamFontstyle = #{tplparamFontstyle}</if>
            <if test="tplparamFontsize != null "> and tplparamFontsize = #{tplparamFontsize}</if>
            <if test="tplparamLinewidth != null "> and tplparamLinewidth = #{tplparamLinewidth}</if>
            <if test="tplparamMargin != null "> and tplparamMargin = #{tplparamMargin}</if>
            <if test="tplparamData != null  and tplparamData != ''"> and tplparamData = #{tplparamData}</if>
        </where>
        order by tplparamSeq
    </select>
    
    <select id="selectTssTracecodetplparam" parameterType="TssTracecodetplparam" resultMap="TssTracecodetplparamResult">
        <include refid="selectTssTracecodetplparamVo"/>
        <where>
            <if test="tracecodetplId != null  and tracecodetplId != ''"> and tracecodetplId = #{tracecodetplId}</if>
            <if test="tplparamSeq != null "> and tplparamSeq = #{tplparamSeq}</if>
            <if test="tplparamRemark != null  and tplparamRemark != ''"> and tplparamRemark = #{tplparamRemark}</if>
            <if test="tplparamMediatype != null  and tplparamMediatype != ''"> and tplparamMediatype = #{tplparamMediatype}</if>
            <if test="tplparamBustype != null  and tplparamBustype != ''"> and tplparamBustype = #{tplparamBustype}</if>
            <if test="tplparamWidth != null "> and tplparamWidth = #{tplparamWidth}</if>
            <if test="tplparamHeight != null "> and tplparamHeight = #{tplparamHeight}</if>
            <if test="tplparamPosx != null "> and tplparamPosx = #{tplparamPosx}</if>
            <if test="tplparamPosy != null "> and tplparamPosy = #{tplparamPosy}</if>
            <if test="tplparamBgcolor != null  and tplparamBgcolor != ''"> and tplparamBgcolor = #{tplparamBgcolor}</if>
            <if test="tplparamFontfamily != null  and tplparamFontfamily != ''"> and tplparamFontfamily = #{tplparamFontfamily}</if>
            <if test="tplparamFontstyle != null "> and tplparamFontstyle = #{tplparamFontstyle}</if>
            <if test="tplparamFontsize != null "> and tplparamFontsize = #{tplparamFontsize}</if>
            <if test="tplparamLinewidth != null "> and tplparamLinewidth = #{tplparamLinewidth}</if>
            <if test="tplparamMargin != null "> and tplparamMargin = #{tplparamMargin}</if>
            <if test="tplparamData != null  and tplparamData != ''"> and tplparamData = #{tplparamData}</if>
        </where>
    </select>
    <select id="selectTssTracecodetplparamByTplparamIdAndBusType"
            resultType="com.yunfeiyun.agmp.fms.domain.TssTracecodetplparam">
        <include refid="selectTssTracecodetplparamVo"/>
        <where>
            <if test="tracecodetplId != null  and tracecodetplId != ''"> and tracecodetplId = #{tracecodetplId}</if>
            <if test="tplparamBustype != null  and tplparamBustype != ''"> and tplparamBustype = #{tplparamBustype}</if>
        </where>
    </select>

    <insert id="insertTssTracecodetplparam" parameterType="TssTracecodetplparam">
        insert into TssTracecodetplparam
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="tplparamId != null">tplparamId,</if>
            <if test="tracecodetplId != null">tracecodetplId,</if>
            <if test="tplparamSeq != null">tplparamSeq,</if>
            <if test="tplparamRemark != null">tplparamRemark,</if>
            <if test="tplparamMediatype != null">tplparamMediatype,</if>
            <if test="tplparamBustype != null">tplparamBustype,</if>
            <if test="tplparamWidth != null">tplparamWidth,</if>
            <if test="tplparamHeight != null">tplparamHeight,</if>
            <if test="tplparamPosx != null">tplparamPosx,</if>
            <if test="tplparamPosy != null">tplparamPosy,</if>
            <if test="tplparamBgcolor != null">tplparamBgcolor,</if>
            <if test="tplparamFontfamily != null">tplparamFontfamily,</if>
            <if test="tplparamFontstyle != null">tplparamFontstyle,</if>
            <if test="tplparamFontsize != null">tplparamFontsize,</if>
            <if test="tplparamLinewidth != null">tplparamLinewidth,</if>
            <if test="tplparamMargin != null">tplparamMargin,</if>
            <if test="tplparamData != null">tplparamData,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="tplparamId != null">#{tplparamId},</if>
            <if test="tracecodetplId != null">#{tracecodetplId},</if>
            <if test="tplparamSeq != null">#{tplparamSeq},</if>
            <if test="tplparamRemark != null">#{tplparamRemark},</if>
            <if test="tplparamMediatype != null">#{tplparamMediatype},</if>
            <if test="tplparamBustype != null">#{tplparamBustype},</if>
            <if test="tplparamWidth != null">#{tplparamWidth},</if>
            <if test="tplparamHeight != null">#{tplparamHeight},</if>
            <if test="tplparamPosx != null">#{tplparamPosx},</if>
            <if test="tplparamPosy != null">#{tplparamPosy},</if>
            <if test="tplparamBgcolor != null">#{tplparamBgcolor},</if>
            <if test="tplparamFontfamily != null">#{tplparamFontfamily},</if>
            <if test="tplparamFontstyle != null">#{tplparamFontstyle},</if>
            <if test="tplparamFontsize != null">#{tplparamFontsize},</if>
            <if test="tplparamLinewidth != null">#{tplparamLinewidth},</if>
            <if test="tplparamMargin != null">#{tplparamMargin},</if>
            <if test="tplparamData != null">#{tplparamData},</if>
         </trim>
    </insert>

    <update id="updateTssTracecodetplparam" parameterType="TssTracecodetplparam">
        update TssTracecodetplparam
        <trim prefix="SET" suffixOverrides=",">
            <if test="tracecodetplId != null">tracecodetplId = #{tracecodetplId},</if>
            <if test="tplparamSeq != null">tplparamSeq = #{tplparamSeq},</if>
            <if test="tplparamRemark != null">tplparamRemark = #{tplparamRemark},</if>
            <if test="tplparamMediatype != null">tplparamMediatype = #{tplparamMediatype},</if>
            <if test="tplparamBustype != null">tplparamBustype = #{tplparamBustype},</if>
            <if test="tplparamWidth != null">tplparamWidth = #{tplparamWidth},</if>
            <if test="tplparamHeight != null">tplparamHeight = #{tplparamHeight},</if>
            <if test="tplparamPosx != null">tplparamPosx = #{tplparamPosx},</if>
            <if test="tplparamPosy != null">tplparamPosy = #{tplparamPosy},</if>
            <if test="tplparamBgcolor != null">tplparamBgcolor = #{tplparamBgcolor},</if>
            <if test="tplparamFontfamily != null">tplparamFontfamily = #{tplparamFontfamily},</if>
            <if test="tplparamFontstyle != null">tplparamFontstyle = #{tplparamFontstyle},</if>
            <if test="tplparamFontsize != null">tplparamFontsize = #{tplparamFontsize},</if>
            <if test="tplparamLinewidth != null">tplparamLinewidth = #{tplparamLinewidth},</if>
            <if test="tplparamMargin != null">tplparamMargin = #{tplparamMargin},</if>
            <if test="tplparamData != null">tplparamData = #{tplparamData},</if>
        </trim>
        where tplparamId = #{tplparamId}
    </update>

    <update id="updateTssTracecodetplparamBusInfo" parameterType="String">
        update TssTracecodetplparam
        set tplparamData =#{data}
        where tracecodetplId = #{tracecodetplId}
        and tplparamBustype = #{busType}
    </update>



    <delete id="deleteTssTracecodetplparamByTplparamId" parameterType="String">
        delete from TssTracecodetplparam where tplparamId = #{tplparamId}
    </delete>

    <delete id="deleteTssTracecodetplparamByTplparamIds" parameterType="String">
        delete from TssTracecodetplparam where tplparamId in 
        <foreach item="tplparamId" collection="array" open="(" separator="," close=")">
            #{tplparamId}
        </foreach>
    </delete>
</mapper>