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

    <select id="selectSFwglServicepackageinfoList" parameterType="pd" resultType="pd">
        select * from s_fwgl_servicepackageinfo where 1=1
        <if test="orderNumber !=null and orderNumber !='' ">
            and orderNumber = #{orderNumber}
        </if>
        <if test="chain !=null and chain !='' ">
            and chain = #{chain}
        </if>
        <if test="servicePackageId !=null and servicePackageId !='' ">
            and servicePackageId = #{servicePackageId}
        </if>
        <if test="servicePackageName !=null and servicePackageName !='' ">
            and servicePackageName = #{servicePackageName}
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            and orderTime = #{orderTime}
        </if>
        <if test="userId !=null and userId !='' ">
            and userId = #{userId}
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            and orderingPhone = #{orderingPhone}
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            and orderStatus = #{orderStatus}
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            and orderingStore = #{orderingStore}
        </if>
        <if test="scanningStaffNumber !=null and scanningStaffNumber !='' ">
            and scanningStaffNumber = #{scanningStaffNumber}
        </if>
        <if test="scanningStaffName !=null and scanningStaffName !='' ">
            and scanningStaffName = #{scanningStaffName}
        </if>
        <if test="scanningTime !=null and scanningTime !='' ">
            and scanningTime = #{scanningTime}
        </if>
    </select>


    <update id="updateSFwglServicepackageinfo" parameterType="pd" >
        update s_fwgl_servicepackageinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber = #{orderNumber},
        </if>
        <if test="chain !=null and chain !='' ">
            chain = #{chain},
        </if>
        <if test="servicePackageId !=null and servicePackageId !='' ">
            servicePackageId = #{servicePackageId},
        </if>
        <if test="servicePackageName !=null and servicePackageName !='' ">
            servicePackageName = #{servicePackageName},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime = #{orderTime},
        </if>
        <if test="userId !=null and userId !='' ">
            userId = #{userId},
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            orderingPhone = #{orderingPhone},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus = #{orderStatus},
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            orderingStore = #{orderingStore},
        </if>
        <if test="scanningStaffNumber !=null and scanningStaffNumber !='' ">
            scanningStaffNumber = #{scanningStaffNumber},
        </if>
        <if test="scanningStaffName !=null and scanningStaffName !='' ">
            scanningStaffName = #{scanningStaffName},
        </if>
        <if test="scanningTime !=null and scanningTime !='' ">
            scanningTime = #{scanningTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber,
        </if>
        <if test="chain !=null and chain !='' ">
            chain,
        </if>
        <if test="servicePackageId !=null and servicePackageId !='' ">
            servicePackageId,
        </if>
        <if test="servicePackageName !=null and servicePackageName !='' ">
            servicePackageName,
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime,
        </if>
        <if test="userId !=null and userId !='' ">
            userId,
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            orderingPhone,
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus,
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            orderingStore,
        </if>
        <if test="scanningStaffNumber !=null and scanningStaffNumber !='' ">
            scanningStaffNumber,
        </if>
        <if test="scanningStaffName !=null and scanningStaffName !='' ">
            scanningStaffName,
        </if>
        <if test="scanningTime !=null and scanningTime !='' ">
            scanningTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="orderNumber !=null and orderNumber !='' ">
             #{orderNumber},
        </if>
        <if test="chain !=null and chain !='' ">
             #{chain},
        </if>
        <if test="servicePackageId !=null and servicePackageId !='' ">
             #{servicePackageId},
        </if>
        <if test="servicePackageName !=null and servicePackageName !='' ">
             #{servicePackageName},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
             #{orderTime},
        </if>
        <if test="userId !=null and userId !='' ">
             #{userId},
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
             #{orderingPhone},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
             #{orderStatus},
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
             #{orderingStore},
        </if>
        <if test="scanningStaffNumber !=null and scanningStaffNumber !='' ">
             #{scanningStaffNumber},
        </if>
        <if test="scanningStaffName !=null and scanningStaffName !='' ">
             #{scanningStaffName},
        </if>
        <if test="scanningTime !=null and scanningTime !='' ">
             #{scanningTime},
        </if>
        </trim>

    </insert>

</mapper>
