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

    <select id="selectSHyglMembertagList" parameterType="pd" resultType="pd">
        select * from s_hygl_membertag where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="diseaseName !=null and diseaseName !='' ">
            and diseaseName = #{diseaseName}
        </if>
        <if test="memberCount !=null and memberCount !='' ">
            and memberCount = #{memberCount}
        </if>
        <if test="proportion !=null and proportion !='' ">
            and proportion = #{proportion}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and createTime = #{createTime}
        </if>
        <if test="creator !=null and creator !='' ">
            and creator = #{creator}
        </if>
        <if test="updateTime !=null and updateTime !='' ">
            and updateTime = #{updateTime}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="deleteFlag !=null and deleteFlag !='' ">
            and deleteFlag = #{deleteFlag}
        </if>
    </select>


    <update id="updateSHyglMembertag" parameterType="pd" >
        update s_hygl_membertag
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="diseaseName !=null and diseaseName !='' ">
            diseaseName = #{diseaseName},
        </if>
        <if test="memberCount !=null and memberCount !='' ">
            memberCount = #{memberCount},
        </if>
        <if test="proportion !=null and proportion !='' ">
            proportion = #{proportion},
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime = #{createTime},
        </if>
        <if test="creator !=null and creator !='' ">
            creator = #{creator},
        </if>
        <if test="updateTime !=null and updateTime !='' ">
            updateTime = #{updateTime},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="deleteFlag !=null and deleteFlag !='' ">
            deleteFlag = #{deleteFlag},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="diseaseName !=null and diseaseName !='' ">
            diseaseName,
        </if>
        <if test="memberCount !=null and memberCount !='' ">
            memberCount,
        </if>
        <if test="proportion !=null and proportion !='' ">
            proportion,
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime,
        </if>
        <if test="creator !=null and creator !='' ">
            creator,
        </if>
        <if test="updateTime !=null and updateTime !='' ">
            updateTime,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="deleteFlag !=null and deleteFlag !='' ">
            deleteFlag,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="diseaseName !=null and diseaseName !='' ">
             #{diseaseName},
        </if>
        <if test="memberCount !=null and memberCount !='' ">
             #{memberCount},
        </if>
        <if test="proportion !=null and proportion !='' ">
             #{proportion},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        <if test="creator !=null and creator !='' ">
             #{creator},
        </if>
        <if test="updateTime !=null and updateTime !='' ">
             #{updateTime},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="deleteFlag !=null and deleteFlag !='' ">
             #{deleteFlag},
        </if>
        </trim>

    </insert>

</mapper>
