<?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="ServerMapper">

	<select id="selectServerList" 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>
	</select>

	<insert id="insertServer" parameterType="pd">
		insert into s_fwgl_servicetypeinfo
		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
			<if test="serviceTypeNumber != null ">serviceTypeNumber,</if>
			<if test="serviceTypeName != null ">serviceTypeName,</if>
			<if test="serviceTypeDescription != null ">serviceTypeDescription,</if>
			<if test="fulfillmentParty != null ">fulfillmentParty,</if>
		</trim>
		<trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
			<if test="serviceTypeNumber != null ">#{serviceTypeNumber},</if>
			<if test="serviceTypeName != null ">#{serviceTypeName},</if>
			<if test="serviceTypeDescription != null ">#{serviceTypeDescription},</if>
			<if test="fulfillmentParty != null">#{fulfillmentParty},</if>
		</trim>
	</insert>

	<delete id="deleteServer" parameterType="pd">
		<if test="ids != null">
			delete from s_fwgl_servicetypeinfo where
			<if test="ids != null">
				serviceId=#{ids}
			</if>
		</if>

	</delete>

	<insert id="updateServer" parameterType="pd">
		update s_fwgl_servicetypeinfo
		<trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
			<if test="serviceTypeNumber != null ">serviceTypeNumber=#{serviceTypeNumber},</if>
			<if test="serviceTypeName != null ">serviceTypeName=#{serviceTypeName},</if>
			<if test="serviceTypeDescription != null ">serviceTypeDescription=#{serviceTypeDescription},</if>
			<if test="fulfillmentParty != null ">fulfillmentParty=#{fulfillmentParty},</if>
		</trim>
		where serviceId=#{serviceId}
	</insert>


</mapper>
