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

    <select id="selectSFwglServicetypeinfoList" parameterType="pd" resultType="pd">
        select * from s_fwgl_servicetypeinfo where 1=1
        <if test="serviceId !=null and serviceId !='' ">
            and serviceId = #{serviceId}
        </if>
        <if test="serviceTypeNumber !=null and serviceTypeNumber !='' ">
            and serviceTypeNumber = #{serviceTypeNumber}
        </if>
        <if test="serviceTypeName !=null and serviceTypeName !='' ">
            and serviceTypeName = #{serviceTypeName}
        </if>
        <if test="serviceTypeDescription !=null and serviceTypeDescription !='' ">
            and serviceTypeDescription = #{serviceTypeDescription}
        </if>
        <if test="fulfillmentParty !=null and fulfillmentParty !='' ">
            and fulfillmentParty = #{fulfillmentParty}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and create_time = #{createTime}
        </if>
    </select>


    <update id="updateSFwglServicetypeinfo" parameterType="pd" >
        update s_fwgl_servicetypeinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="serviceTypeNumber !=null and serviceTypeNumber !='' ">
            serviceTypeNumber = #{serviceTypeNumber},
        </if>
        <if test="serviceTypeName !=null and serviceTypeName !='' ">
            serviceTypeName = #{serviceTypeName},
        </if>
        <if test="serviceTypeDescription !=null and serviceTypeDescription !='' ">
            serviceTypeDescription = #{serviceTypeDescription},
        </if>
        <if test="fulfillmentParty !=null and fulfillmentParty !='' ">
            fulfillmentParty = #{fulfillmentParty},
        </if>
        <if test="createTime !=null and createTime !='' ">
            create_time = #{createTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="serviceTypeNumber !=null and serviceTypeNumber !='' ">
            serviceTypeNumber,
        </if>
        <if test="serviceTypeName !=null and serviceTypeName !='' ">
            serviceTypeName,
        </if>
        <if test="serviceTypeDescription !=null and serviceTypeDescription !='' ">
            serviceTypeDescription,
        </if>
        <if test="fulfillmentParty !=null and fulfillmentParty !='' ">
            fulfillmentParty,
        </if>
        <if test="createTime !=null and createTime !='' ">
            create_time,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="serviceTypeNumber !=null and serviceTypeNumber !='' ">
             #{serviceTypeNumber},
        </if>
        <if test="serviceTypeName !=null and serviceTypeName !='' ">
             #{serviceTypeName},
        </if>
        <if test="serviceTypeDescription !=null and serviceTypeDescription !='' ">
             #{serviceTypeDescription},
        </if>
        <if test="fulfillmentParty !=null and fulfillmentParty !='' ">
             #{fulfillmentParty},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        </trim>

    </insert>

</mapper>
