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

    <select id="selectSFwglServerinfoList" parameterType="pd" resultType="pd">
        select * from s_fwgl_serverinfo where 1=1
        <if test="productName !=null and productName !='' ">
            and productName = #{productName}
        </if>
        <if test="productId !=null and productId !='' ">
            and productId = #{productId}
        </if>
        <if test="mdmProductCode !=null and mdmProductCode !='' ">
            and mdmProductCode = #{mdmProductCode}
        </if>
        <if test="price !=null and price !='' ">
            and price = #{price}
        </if>
        <if test="productType !=null and productType !='' ">
            and productType = #{productType}
        </if>
        <if test="stock !=null and stock !='' ">
            and stock = #{stock}
        </if>
        <if test="productCategory !=null and productCategory !='' ">
            and productCategory = #{productCategory}
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            and auditStatus = #{auditStatus}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="creationTime !=null and creationTime !='' ">
            and creationTime = #{creationTime}
        </if>
    </select>


    <update id="updateSFwglServerinfo" parameterType="pd" >
        update s_fwgl_serverinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="productName !=null and productName !='' ">
            productName = #{productName},
        </if>
        <if test="productId !=null and productId !='' ">
            productId = #{productId},
        </if>
        <if test="mdmProductCode !=null and mdmProductCode !='' ">
            mdmProductCode = #{mdmProductCode},
        </if>
        <if test="price !=null and price !='' ">
            price = #{price},
        </if>
        <if test="productType !=null and productType !='' ">
            productType = #{productType},
        </if>
        <if test="stock !=null and stock !='' ">
            stock = #{stock},
        </if>
        <if test="productCategory !=null and productCategory !='' ">
            productCategory = #{productCategory},
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            auditStatus = #{auditStatus},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="creationTime !=null and creationTime !='' ">
            creationTime = #{creationTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="productName !=null and productName !='' ">
            productName,
        </if>
        <if test="productId !=null and productId !='' ">
            productId,
        </if>
        <if test="mdmProductCode !=null and mdmProductCode !='' ">
            mdmProductCode,
        </if>
        <if test="price !=null and price !='' ">
            price,
        </if>
        <if test="productType !=null and productType !='' ">
            productType,
        </if>
        <if test="stock !=null and stock !='' ">
            stock,
        </if>
        <if test="productCategory !=null and productCategory !='' ">
            productCategory,
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            auditStatus,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="creationTime !=null and creationTime !='' ">
            creationTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="productName !=null and productName !='' ">
             #{productName},
        </if>
        <if test="productId !=null and productId !='' ">
             #{productId},
        </if>
        <if test="mdmProductCode !=null and mdmProductCode !='' ">
             #{mdmProductCode},
        </if>
        <if test="price !=null and price !='' ">
             #{price},
        </if>
        <if test="productType !=null and productType !='' ">
             #{productType},
        </if>
        <if test="stock !=null and stock !='' ">
             #{stock},
        </if>
        <if test="productCategory !=null and productCategory !='' ">
             #{productCategory},
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
             #{auditStatus},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="creationTime !=null and creationTime !='' ">
             #{creationTime},
        </if>
        </trim>

    </insert>

</mapper>
