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

    <select id="selectSSpglMdjymlStoreproductinfoList" parameterType="pd" resultType="pd">
        select * from s_spgl_mdjyml_storeproductinfo 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="productCategory !=null and productCategory !='' ">
            and productCategory = #{productCategory}
        </if>
        <if test="saleStatus !=null and saleStatus !='' ">
            and saleStatus = #{saleStatus}
        </if>
    </select>


    <update id="updateSSpglMdjymlStoreproductinfo" parameterType="pd" >
        update s_spgl_mdjyml_storeproductinfo
        <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="productCategory !=null and productCategory !='' ">
            productCategory = #{productCategory},
        </if>
        <if test="saleStatus !=null and saleStatus !='' ">
            saleStatus = #{saleStatus},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

        insert into s_spgl_mdjyml_storeproductinfo
        <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="productCategory !=null and productCategory !='' ">
            productCategory,
        </if>
        <if test="saleStatus !=null and saleStatus !='' ">
            saleStatus,
        </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="productCategory !=null and productCategory !='' ">
             #{productCategory},
        </if>
        <if test="saleStatus !=null and saleStatus !='' ">
             #{saleStatus},
        </if>
        </trim>

    </insert>

</mapper>
