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

    <select id="selectSSpglMdspStoreproductdetailsList" parameterType="pd" resultType="pd">
        select * from s_spgl_mdsp_storeproductdetails where 1=1
        <if test="storeName !=null and storeName !='' ">
            and storeName = #{storeName}
        </if>
        <if test="productCode !=null and productCode !='' ">
            and productCode = #{productCode}
        </if>
        <if test="productName !=null and productName !='' ">
            and productName = #{productName}
        </if>
        <if test="specification !=null and specification !='' ">
            and specification = #{specification}
        </if>
        <if test="manufacturer !=null and manufacturer !='' ">
            and manufacturer = #{manufacturer}
        </if>
        <if test="genericName !=null and genericName !='' ">
            and genericName = #{genericName}
        </if>
        <if test="brandName !=null and brandName !='' ">
            and brandName = #{brandName}
        </if>
        <if test="retailPrice !=null and retailPrice !='' ">
            and retailPrice = #{retailPrice}
        </if>
        <if test="prohibitTransfer !=null and prohibitTransfer !='' ">
            and prohibitTransfer = #{prohibitTransfer}
        </if>
        <if test="prohibitOrder !=null and prohibitOrder !='' ">
            and prohibitOrder = #{prohibitOrder}
        </if>
        <if test="prohibitSale !=null and prohibitSale !='' ">
            and prohibitSale = #{prohibitSale}
        </if>
        <if test="prohibitReturnFactory !=null and prohibitReturnFactory !='' ">
            and prohibitReturnFactory = #{prohibitReturnFactory}
        </if>
        <if test="prohibitReturnWarehouse !=null and prohibitReturnWarehouse !='' ">
            and prohibitReturnWarehouse = #{prohibitReturnWarehouse}
        </if>
        <if test="prohibitDelivery !=null and prohibitDelivery !='' ">
            and prohibitDelivery = #{prohibitDelivery}
        </if>
        <if test="prohibitPurchase !=null and prohibitPurchase !='' ">
            and prohibitPurchase = #{prohibitPurchase}
        </if>
        <if test="configurationType !=null and configurationType !='' ">
            and configurationType = #{configurationType}
        </if>
        <if test="operationAttribute !=null and operationAttribute !='' ">
            and operationAttribute = #{operationAttribute}
        </if>
        <if test="salesAttribute !=null and salesAttribute !='' ">
            and salesAttribute = #{salesAttribute}
        </if>
        <if test="minimumDisplayQuantity !=null and minimumDisplayQuantity !='' ">
            and minimumDisplayQuantity = #{minimumDisplayQuantity}
        </if>
    </select>


    <update id="updateSSpglMdspStoreproductdetails" parameterType="pd" >
        update s_spgl_mdsp_storeproductdetails
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="storeName !=null and storeName !='' ">
            storeName = #{storeName},
        </if>
        <if test="productCode !=null and productCode !='' ">
            productCode = #{productCode},
        </if>
        <if test="productName !=null and productName !='' ">
            productName = #{productName},
        </if>
        <if test="specification !=null and specification !='' ">
            specification = #{specification},
        </if>
        <if test="manufacturer !=null and manufacturer !='' ">
            manufacturer = #{manufacturer},
        </if>
        <if test="genericName !=null and genericName !='' ">
            genericName = #{genericName},
        </if>
        <if test="brandName !=null and brandName !='' ">
            brandName = #{brandName},
        </if>
        <if test="retailPrice !=null and retailPrice !='' ">
            retailPrice = #{retailPrice},
        </if>
        <if test="prohibitTransfer !=null and prohibitTransfer !='' ">
            prohibitTransfer = #{prohibitTransfer},
        </if>
        <if test="prohibitOrder !=null and prohibitOrder !='' ">
            prohibitOrder = #{prohibitOrder},
        </if>
        <if test="prohibitSale !=null and prohibitSale !='' ">
            prohibitSale = #{prohibitSale},
        </if>
        <if test="prohibitReturnFactory !=null and prohibitReturnFactory !='' ">
            prohibitReturnFactory = #{prohibitReturnFactory},
        </if>
        <if test="prohibitReturnWarehouse !=null and prohibitReturnWarehouse !='' ">
            prohibitReturnWarehouse = #{prohibitReturnWarehouse},
        </if>
        <if test="prohibitDelivery !=null and prohibitDelivery !='' ">
            prohibitDelivery = #{prohibitDelivery},
        </if>
        <if test="prohibitPurchase !=null and prohibitPurchase !='' ">
            prohibitPurchase = #{prohibitPurchase},
        </if>
        <if test="configurationType !=null and configurationType !='' ">
            configurationType = #{configurationType},
        </if>
        <if test="operationAttribute !=null and operationAttribute !='' ">
            operationAttribute = #{operationAttribute},
        </if>
        <if test="salesAttribute !=null and salesAttribute !='' ">
            salesAttribute = #{salesAttribute},
        </if>
        <if test="minimumDisplayQuantity !=null and minimumDisplayQuantity !='' ">
            minimumDisplayQuantity = #{minimumDisplayQuantity},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="storeName !=null and storeName !='' ">
            storeName,
        </if>
        <if test="productCode !=null and productCode !='' ">
            productCode,
        </if>
        <if test="productName !=null and productName !='' ">
            productName,
        </if>
        <if test="specification !=null and specification !='' ">
            specification,
        </if>
        <if test="manufacturer !=null and manufacturer !='' ">
            manufacturer,
        </if>
        <if test="genericName !=null and genericName !='' ">
            genericName,
        </if>
        <if test="brandName !=null and brandName !='' ">
            brandName,
        </if>
        <if test="retailPrice !=null and retailPrice !='' ">
            retailPrice,
        </if>
        <if test="prohibitTransfer !=null and prohibitTransfer !='' ">
            prohibitTransfer,
        </if>
        <if test="prohibitOrder !=null and prohibitOrder !='' ">
            prohibitOrder,
        </if>
        <if test="prohibitSale !=null and prohibitSale !='' ">
            prohibitSale,
        </if>
        <if test="prohibitReturnFactory !=null and prohibitReturnFactory !='' ">
            prohibitReturnFactory,
        </if>
        <if test="prohibitReturnWarehouse !=null and prohibitReturnWarehouse !='' ">
            prohibitReturnWarehouse,
        </if>
        <if test="prohibitDelivery !=null and prohibitDelivery !='' ">
            prohibitDelivery,
        </if>
        <if test="prohibitPurchase !=null and prohibitPurchase !='' ">
            prohibitPurchase,
        </if>
        <if test="configurationType !=null and configurationType !='' ">
            configurationType,
        </if>
        <if test="operationAttribute !=null and operationAttribute !='' ">
            operationAttribute,
        </if>
        <if test="salesAttribute !=null and salesAttribute !='' ">
            salesAttribute,
        </if>
        <if test="minimumDisplayQuantity !=null and minimumDisplayQuantity !='' ">
            minimumDisplayQuantity,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="storeName !=null and storeName !='' ">
             #{storeName},
        </if>
        <if test="productCode !=null and productCode !='' ">
             #{productCode},
        </if>
        <if test="productName !=null and productName !='' ">
             #{productName},
        </if>
        <if test="specification !=null and specification !='' ">
             #{specification},
        </if>
        <if test="manufacturer !=null and manufacturer !='' ">
             #{manufacturer},
        </if>
        <if test="genericName !=null and genericName !='' ">
             #{genericName},
        </if>
        <if test="brandName !=null and brandName !='' ">
             #{brandName},
        </if>
        <if test="retailPrice !=null and retailPrice !='' ">
             #{retailPrice},
        </if>
        <if test="prohibitTransfer !=null and prohibitTransfer !='' ">
             #{prohibitTransfer},
        </if>
        <if test="prohibitOrder !=null and prohibitOrder !='' ">
             #{prohibitOrder},
        </if>
        <if test="prohibitSale !=null and prohibitSale !='' ">
             #{prohibitSale},
        </if>
        <if test="prohibitReturnFactory !=null and prohibitReturnFactory !='' ">
             #{prohibitReturnFactory},
        </if>
        <if test="prohibitReturnWarehouse !=null and prohibitReturnWarehouse !='' ">
             #{prohibitReturnWarehouse},
        </if>
        <if test="prohibitDelivery !=null and prohibitDelivery !='' ">
             #{prohibitDelivery},
        </if>
        <if test="prohibitPurchase !=null and prohibitPurchase !='' ">
             #{prohibitPurchase},
        </if>
        <if test="configurationType !=null and configurationType !='' ">
             #{configurationType},
        </if>
        <if test="operationAttribute !=null and operationAttribute !='' ">
             #{operationAttribute},
        </if>
        <if test="salesAttribute !=null and salesAttribute !='' ">
             #{salesAttribute},
        </if>
        <if test="minimumDisplayQuantity !=null and minimumDisplayQuantity !='' ">
             #{minimumDisplayQuantity},
        </if>
        </trim>

    </insert>

</mapper>
