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

    <select id="selectSYxglPromotioninfoList" parameterType="pd" resultType="pd">
        select * from s_yxgl_promotioninfo where 1=1
        <if test="activityId !=null and activityId !='' ">
            and activityId = #{activityId}
        </if>
        <if test="activityName !=null and activityName !='' ">
            and activityName = #{activityName}
        </if>
        <if test="activityTime !=null and activityTime !='' ">
            and activityTime = #{activityTime}
        </if>
        <if test="promotionType !=null and promotionType !='' ">
            and promotionType = #{promotionType}
        </if>
        <if test="promotionMethod !=null and promotionMethod !='' ">
            and promotionMethod = #{promotionMethod}
        </if>
        <if test="participants !=null and participants !='' ">
            and participants = #{participants}
        </if>
        <if test="applicableChannels !=null and applicableChannels !='' ">
            and applicableChannels = #{applicableChannels}
        </if>
        <if test="activityStatus !=null and activityStatus !='' ">
            and activityStatus = #{activityStatus}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and createTime = #{createTime}
        </if>
        <if test="creator !=null and creator !='' ">
            and creator = #{creator}
        </if>
    </select>


    <update id="updateSYxglPromotioninfo" parameterType="pd" >
        update s_yxgl_promotioninfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="activityName !=null and activityName !='' ">
            activityName = #{activityName},
        </if>
        <if test="activityTime !=null and activityTime !='' ">
            activityTime = #{activityTime},
        </if>
        <if test="promotionType !=null and promotionType !='' ">
            promotionType = #{promotionType},
        </if>
        <if test="promotionMethod !=null and promotionMethod !='' ">
            promotionMethod = #{promotionMethod},
        </if>
        <if test="participants !=null and participants !='' ">
            participants = #{participants},
        </if>
        <if test="applicableChannels !=null and applicableChannels !='' ">
            applicableChannels = #{applicableChannels},
        </if>
        <if test="activityStatus !=null and activityStatus !='' ">
            activityStatus = #{activityStatus},
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime = #{createTime},
        </if>
        <if test="creator !=null and creator !='' ">
            creator = #{creator},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="activityName !=null and activityName !='' ">
            activityName,
        </if>
        <if test="activityTime !=null and activityTime !='' ">
            activityTime,
        </if>
        <if test="promotionType !=null and promotionType !='' ">
            promotionType,
        </if>
        <if test="promotionMethod !=null and promotionMethod !='' ">
            promotionMethod,
        </if>
        <if test="participants !=null and participants !='' ">
            participants,
        </if>
        <if test="applicableChannels !=null and applicableChannels !='' ">
            applicableChannels,
        </if>
        <if test="activityStatus !=null and activityStatus !='' ">
            activityStatus,
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime,
        </if>
        <if test="creator !=null and creator !='' ">
            creator,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="activityName !=null and activityName !='' ">
             #{activityName},
        </if>
        <if test="activityTime !=null and activityTime !='' ">
             #{activityTime},
        </if>
        <if test="promotionType !=null and promotionType !='' ">
             #{promotionType},
        </if>
        <if test="promotionMethod !=null and promotionMethod !='' ">
             #{promotionMethod},
        </if>
        <if test="participants !=null and participants !='' ">
             #{participants},
        </if>
        <if test="applicableChannels !=null and applicableChannels !='' ">
             #{applicableChannels},
        </if>
        <if test="activityStatus !=null and activityStatus !='' ">
             #{activityStatus},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        <if test="creator !=null and creator !='' ">
             #{creator},
        </if>
        </trim>

    </insert>

</mapper>
