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

    <select id="selectSJgglPriceadjustmentsheetList" parameterType="pd" resultType="pd">
        select * from s_jggl_priceadjustmentsheet where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="adjustmentSheetNo !=null and adjustmentSheetNo !='' ">
            and adjustmentSheetNo = #{adjustmentSheetNo}
        </if>
        <if test="adjustmentSheetName !=null and adjustmentSheetName !='' ">
            and adjustmentSheetName = #{adjustmentSheetName}
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            and adjustmentType = #{adjustmentType}
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            and adjustmentReason = #{adjustmentReason}
        </if>
        <if test="channel !=null and channel !='' ">
            and channel = #{channel}
        </if>
        <if test="priceType !=null and priceType !='' ">
            and priceType = #{priceType}
        </if>
        <if test="chainName !=null and chainName !='' ">
            and chainName = #{chainName}
        </if>
        <if test="storeName !=null and storeName !='' ">
            and storeName = #{storeName}
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            and storeCode = #{storeCode}
        </if>
        <if test="effectiveTime !=null and effectiveTime !='' ">
            and effectiveTime = #{effectiveTime}
        </if>
        <if test="notificationTime !=null and notificationTime !='' ">
            and notificationTime = #{notificationTime}
        </if>
        <if test="createdUser !=null and createdUser !='' ">
            and createdUser = #{createdUser}
        </if>
    </select>


    <update id="updateSJgglPriceadjustmentsheet" parameterType="pd" >
        update s_jggl_priceadjustmentsheet
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="adjustmentSheetNo !=null and adjustmentSheetNo !='' ">
            adjustmentSheetNo = #{adjustmentSheetNo},
        </if>
        <if test="adjustmentSheetName !=null and adjustmentSheetName !='' ">
            adjustmentSheetName = #{adjustmentSheetName},
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            adjustmentType = #{adjustmentType},
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            adjustmentReason = #{adjustmentReason},
        </if>
        <if test="channel !=null and channel !='' ">
            channel = #{channel},
        </if>
        <if test="priceType !=null and priceType !='' ">
            priceType = #{priceType},
        </if>
        <if test="chainName !=null and chainName !='' ">
            chainName = #{chainName},
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName = #{storeName},
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            storeCode = #{storeCode},
        </if>
        <if test="effectiveTime !=null and effectiveTime !='' ">
            effectiveTime = #{effectiveTime},
        </if>
        <if test="notificationTime !=null and notificationTime !='' ">
            notificationTime = #{notificationTime},
        </if>
        <if test="createdUser !=null and createdUser !='' ">
            createdUser = #{createdUser},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="adjustmentSheetNo !=null and adjustmentSheetNo !='' ">
            adjustmentSheetNo,
        </if>
        <if test="adjustmentSheetName !=null and adjustmentSheetName !='' ">
            adjustmentSheetName,
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
            adjustmentType,
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
            adjustmentReason,
        </if>
        <if test="channel !=null and channel !='' ">
            channel,
        </if>
        <if test="priceType !=null and priceType !='' ">
            priceType,
        </if>
        <if test="chainName !=null and chainName !='' ">
            chainName,
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName,
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            storeCode,
        </if>
        <if test="effectiveTime !=null and effectiveTime !='' ">
            effectiveTime,
        </if>
        <if test="notificationTime !=null and notificationTime !='' ">
            notificationTime,
        </if>
        <if test="createdUser !=null and createdUser !='' ">
            createdUser,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="adjustmentSheetNo !=null and adjustmentSheetNo !='' ">
             #{adjustmentSheetNo},
        </if>
        <if test="adjustmentSheetName !=null and adjustmentSheetName !='' ">
             #{adjustmentSheetName},
        </if>
        <if test="adjustmentType !=null and adjustmentType !='' ">
             #{adjustmentType},
        </if>
        <if test="adjustmentReason !=null and adjustmentReason !='' ">
             #{adjustmentReason},
        </if>
        <if test="channel !=null and channel !='' ">
             #{channel},
        </if>
        <if test="priceType !=null and priceType !='' ">
             #{priceType},
        </if>
        <if test="chainName !=null and chainName !='' ">
             #{chainName},
        </if>
        <if test="storeName !=null and storeName !='' ">
             #{storeName},
        </if>
        <if test="storeCode !=null and storeCode !='' ">
             #{storeCode},
        </if>
        <if test="effectiveTime !=null and effectiveTime !='' ">
             #{effectiveTime},
        </if>
        <if test="notificationTime !=null and notificationTime !='' ">
             #{notificationTime},
        </if>
        <if test="createdUser !=null and createdUser !='' ">
             #{createdUser},
        </if>
        </trim>

    </insert>

</mapper>
