<?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.TssTracecodetplMapper">
    
    <resultMap type="TssTracecodetpl" id="TssTracecodetplResult">
        <result property="tracecodetplId"    column="tracecodetplId"    />
        <result property="tracecodetplTitle"    column="tracecodetplTitle"    />
        <result property="tracecodetplMaxscan"    column="tracecodetplMaxscan"    />
        <result property="tracecodetplWidth"    column="tracecodetplWidth"    />
        <result property="tracecodetplHeight"    column="tracecodetplHeight"    />
        <result property="tracecodetplBitcolor"    column="tracecodetplBitcolor"    />
    </resultMap>

    <sql id="selectTssTracecodetplVo">
        select tracecodetplId, tracecodetplTitle, tracecodetplMaxscan, tracecodetplWidth, tracecodetplHeight, tracecodetplBitcolor from TssTracecodetpl
    </sql>

    <select id="selectTssTracecodetplList" parameterType="TssTracecodetpl" resultMap="TssTracecodetplResult">
        <include refid="selectTssTracecodetplVo"/>
        <where>
            <if test="tracecodetplId !=null and tracecodetplId != ''">and tracecodetplId = #{tracecodetplId}</if>
            <if test="tracecodetplTitle != null  and tracecodetplTitle != ''"> and tracecodetplTitle = #{tracecodetplTitle}</if>
            <if test="tracecodetplMaxscan != null "> and tracecodetplMaxscan = #{tracecodetplMaxscan}</if>
            <if test="tracecodetplWidth != null "> and tracecodetplWidth = #{tracecodetplWidth}</if>
            <if test="tracecodetplHeight != null "> and tracecodetplHeight = #{tracecodetplHeight}</if>
            <if test="tracecodetplBitcolor != null "> and tracecodetplBitcolor = #{tracecodetplBitcolor}</if>
        </where>
    </select>
    
    <select id="selectTssTracecodetplByTracecodetplId" parameterType="String" resultMap="TssTracecodetplResult">
        <include refid="selectTssTracecodetplVo"/>
        where tracecodetplId = #{tracecodetplId}
    </select>
        
    <insert id="insertTssTracecodetpl" parameterType="TssTracecodetpl">
        insert into TssTracecodetpl
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="tracecodetplId != null">tracecodetplId,</if>
            <if test="tracecodetplTitle != null">tracecodetplTitle,</if>
            <if test="tracecodetplMaxscan != null">tracecodetplMaxscan,</if>
            <if test="tracecodetplWidth != null">tracecodetplWidth,</if>
            <if test="tracecodetplHeight != null">tracecodetplHeight,</if>
            <if test="tracecodetplBitcolor != null">tracecodetplBitcolor,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="tracecodetplId != null">#{tracecodetplId},</if>
            <if test="tracecodetplTitle != null">#{tracecodetplTitle},</if>
            <if test="tracecodetplMaxscan != null">#{tracecodetplMaxscan},</if>
            <if test="tracecodetplWidth != null">#{tracecodetplWidth},</if>
            <if test="tracecodetplHeight != null">#{tracecodetplHeight},</if>
            <if test="tracecodetplBitcolor != null">#{tracecodetplBitcolor},</if>
         </trim>
    </insert>

    <update id="updateTssTracecodetpl" parameterType="TssTracecodetpl">
        update TssTracecodetpl
        <trim prefix="SET" suffixOverrides=",">
            <if test="tracecodetplTitle != null">tracecodetplTitle = #{tracecodetplTitle},</if>
            <if test="tracecodetplMaxscan != null">tracecodetplMaxscan = #{tracecodetplMaxscan},</if>
            <if test="tracecodetplWidth != null">tracecodetplWidth = #{tracecodetplWidth},</if>
            <if test="tracecodetplHeight != null">tracecodetplHeight = #{tracecodetplHeight},</if>
            <if test="tracecodetplBitcolor != null">tracecodetplBitcolor = #{tracecodetplBitcolor},</if>
        </trim>
        where tracecodetplId = #{tracecodetplId}
    </update>

    <delete id="deleteTssTracecodetplByTracecodetplId" parameterType="String">
        delete from TssTracecodetpl where tracecodetplId = #{tracecodetplId}
    </delete>

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