<?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="SHyglHyyxMouldmessageMapper" >
    <!-- 通用查询映射结果 -->

    <select id="selectSHyglHyyxMouldmessageList" parameterType="pd" resultType="pd">
        select * from s_hygl_hyyx_mouldmessage where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="smsName !=null and smsName !='' ">
            and smsName = #{smsName}
        </if>
        <if test="smsPlatform !=null and smsPlatform !='' ">
            and smsPlatform = #{smsPlatform}
        </if>
        <if test="thirdPartyTemplateId !=null and thirdPartyTemplateId !='' ">
            and thirdPartyTemplateId = #{thirdPartyTemplateId}
        </if>
        <if test="templateType !=null and templateType !='' ">
            and templateType = #{templateType}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and createTime = #{createTime}
        </if>
        <if test="smsContent !=null and smsContent !='' ">
            and smsContent = #{smsContent}
        </if>
        <if test="smsVariables !=null and smsVariables !='' ">
            and smsVariables = #{smsVariables}
        </if>
    </select>


    <update id="updateSHyglHyyxMouldmessage" parameterType="pd" >
        update s_hygl_hyyx_mouldmessage
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="smsName !=null and smsName !='' ">
            smsName = #{smsName},
        </if>
        <if test="smsPlatform !=null and smsPlatform !='' ">
            smsPlatform = #{smsPlatform},
        </if>
        <if test="thirdPartyTemplateId !=null and thirdPartyTemplateId !='' ">
            thirdPartyTemplateId = #{thirdPartyTemplateId},
        </if>
        <if test="templateType !=null and templateType !='' ">
            templateType = #{templateType},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime = #{createTime},
        </if>
        <if test="smsContent !=null and smsContent !='' ">
            smsContent = #{smsContent},
        </if>
        <if test="smsVariables !=null and smsVariables !='' ">
            smsVariables = #{smsVariables},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

    <delete id="SHyglHyyxMouldmessageRemove" parameterType="pd">
        <if test="ids != null">
            delete from s_hygl_hyyx_mouldmessage where
            <if test="ids != null">
                id in(${ids})
            </if>
        </if>
    </delete>

    <insert id="addSHyglHyyxMouldmessage" parameterType="pd" >

        insert into s_hygl_hyyx_mouldmessage
        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">

        <if test="smsName !=null and smsName !='' ">
            smsName,
        </if>
        <if test="smsPlatform !=null and smsPlatform !='' ">
            smsPlatform,
        </if>
        <if test="thirdPartyTemplateId !=null and thirdPartyTemplateId !='' ">
            thirdPartyTemplateId,
        </if>
        <if test="templateType !=null and templateType !='' ">
            templateType,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime,
        </if>
        <if test="smsContent !=null and smsContent !='' ">
            smsContent,
        </if>
        <if test="smsVariables !=null and smsVariables !='' ">
            smsVariables,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="smsName !=null and smsName !='' ">
             #{smsName},
        </if>
        <if test="smsPlatform !=null and smsPlatform !='' ">
             #{smsPlatform},
        </if>
        <if test="thirdPartyTemplateId !=null and thirdPartyTemplateId !='' ">
             #{thirdPartyTemplateId},
        </if>
        <if test="templateType !=null and templateType !='' ">
             #{templateType},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        <if test="smsContent !=null and smsContent !='' ">
             #{smsContent},
        </if>
        <if test="smsVariables !=null and smsVariables !='' ">
             #{smsVariables},
        </if>
        </trim>

    </insert>

</mapper>
