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

    <select id="selectSGjgztHealthplaninfoList" parameterType="pd" resultType="pd">
        select * from s_gjgzt_healthplaninfo where 1=1
        <if test="healthPlanId !=null and healthPlanId !='' ">
            and healthPlanId = #{healthPlanId}
        </if>
        <if test="healthPlanName !=null and healthPlanName !='' ">
            and healthPlanName = #{healthPlanName}
        </if>
        <if test="chainUserId !=null and chainUserId !='' ">
            and chainUserId = #{chainUserId}
        </if>
        <if test="userName !=null and userName !='' ">
            and userName = #{userName}
        </if>
        <if test="filler !=null and filler !='' ">
            and filler = #{filler}
        </if>
        <if test="fillerPhoneNumber !=null and fillerPhoneNumber !='' ">
            and fillerPhoneNumber = #{fillerPhoneNumber}
        </if>
        <if test="fillSource !=null and fillSource !='' ">
            and fillSource = #{fillSource}
        </if>
        <if test="chainName !=null and chainName !='' ">
            and chainName = #{chainName}
        </if>
        <if test="reportGenerationTime !=null and reportGenerationTime !='' ">
            and reportGenerationTime = #{reportGenerationTime}
        </if>
        <if test="id != null and id!=''">
            and id=#{id}
        </if>
    </select>


    <update id="updateSGjgztHealthplaninfo" parameterType="pd" >
        update s_gjgzt_healthplaninfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="healthPlanId !=null and healthPlanId !='' ">
            healthPlanId = #{healthPlanId},
        </if>
        <if test="healthPlanName !=null and healthPlanName !='' ">
            healthPlanName = #{healthPlanName},
        </if>
        <if test="chainUserId !=null and chainUserId !='' ">
            chainUserId = #{chainUserId},
        </if>
        <if test="userName !=null and userName !='' ">
            userName = #{userName},
        </if>
        <if test="filler !=null and filler !='' ">
            filler = #{filler},
        </if>
        <if test="fillerPhoneNumber !=null and fillerPhoneNumber !='' ">
            fillerPhoneNumber = #{fillerPhoneNumber},
        </if>
        <if test="fillSource !=null and fillSource !='' ">
            fillSource = #{fillSource},
        </if>
        <if test="chainName !=null and chainName !='' ">
            chainName = #{chainName},
        </if>
        <if test="reportGenerationTime !=null and reportGenerationTime !='' ">
            reportGenerationTime = #{reportGenerationTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="healthPlanId !=null and healthPlanId !='' ">
            healthPlanId,
        </if>
        <if test="healthPlanName !=null and healthPlanName !='' ">
            healthPlanName,
        </if>
        <if test="chainUserId !=null and chainUserId !='' ">
            chainUserId,
        </if>
        <if test="userName !=null and userName !='' ">
            userName,
        </if>
        <if test="filler !=null and filler !='' ">
            filler,
        </if>
        <if test="fillerPhoneNumber !=null and fillerPhoneNumber !='' ">
            fillerPhoneNumber,
        </if>
        <if test="fillSource !=null and fillSource !='' ">
            fillSource,
        </if>
        <if test="chainName !=null and chainName !='' ">
            chainName,
        </if>
        <if test="reportGenerationTime !=null and reportGenerationTime !='' ">
            reportGenerationTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="healthPlanId !=null and healthPlanId !='' ">
             #{healthPlanId},
        </if>
        <if test="healthPlanName !=null and healthPlanName !='' ">
             #{healthPlanName},
        </if>
        <if test="chainUserId !=null and chainUserId !='' ">
             #{chainUserId},
        </if>
        <if test="userName !=null and userName !='' ">
             #{userName},
        </if>
        <if test="filler !=null and filler !='' ">
             #{filler},
        </if>
        <if test="fillerPhoneNumber !=null and fillerPhoneNumber !='' ">
             #{fillerPhoneNumber},
        </if>
        <if test="fillSource !=null and fillSource !='' ">
             #{fillSource},
        </if>
        <if test="chainName !=null and chainName !='' ">
             #{chainName},
        </if>
        <if test="reportGenerationTime !=null and reportGenerationTime !='' ">
             #{reportGenerationTime},
        </if>
        </trim>

    </insert>

</mapper>
