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

    <select id="selectSDtpZskcxFollowUpGuidanceList" parameterType="pd" resultType="pd">
        select * from s_dtp_zskcx_follow_up_guidance where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="title !=null and title !='' ">
            and title = #{title}
        </if>
        <if test="category !=null and category !='' ">
            and category = #{category}
        </if>
        <if test="associatedDrugs !=null and associatedDrugs !='' ">
            and associatedDrugs = #{associatedDrugs}
        </if>
        <if test="associatedDiseases !=null and associatedDiseases !='' ">
            and associatedDiseases = #{associatedDiseases}
        </if>
        <if test="diseaseCourse !=null and diseaseCourse !='' ">
            and diseaseCourse = #{diseaseCourse}
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            and createdBy = #{createdBy}
        </if>
        <if test="createdTime !=null and createdTime !='' ">
            and createdTime = #{createdTime}
        </if>
        <if test="updatedBy !=null and updatedBy !='' ">
            and updatedBy = #{updatedBy}
        </if>
        <if test="updatedTime !=null and updatedTime !='' ">
            and updatedTime = #{updatedTime}
        </if>
    </select>


    <update id="updateSDtpZskcxFollowUpGuidance" parameterType="pd" >
        update s_dtp_zskcx_follow_up_guidance
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="title !=null and title !='' ">
            title = #{title},
        </if>
        <if test="category !=null and category !='' ">
            category = #{category},
        </if>
        <if test="associatedDrugs !=null and associatedDrugs !='' ">
            associatedDrugs = #{associatedDrugs},
        </if>
        <if test="associatedDiseases !=null and associatedDiseases !='' ">
            associatedDiseases = #{associatedDiseases},
        </if>
        <if test="diseaseCourse !=null and diseaseCourse !='' ">
            diseaseCourse = #{diseaseCourse},
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            createdBy = #{createdBy},
        </if>
        <if test="createdTime !=null and createdTime !='' ">
            createdTime = #{createdTime},
        </if>
        <if test="updatedBy !=null and updatedBy !='' ">
            updatedBy = #{updatedBy},
        </if>
        <if test="updatedTime !=null and updatedTime !='' ">
            updatedTime = #{updatedTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="title !=null and title !='' ">
            title,
        </if>
        <if test="category !=null and category !='' ">
            category,
        </if>
        <if test="associatedDrugs !=null and associatedDrugs !='' ">
            associatedDrugs,
        </if>
        <if test="associatedDiseases !=null and associatedDiseases !='' ">
            associatedDiseases,
        </if>
        <if test="diseaseCourse !=null and diseaseCourse !='' ">
            diseaseCourse,
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            createdBy,
        </if>
        <if test="createdTime !=null and createdTime !='' ">
            createdTime,
        </if>
        <if test="updatedBy !=null and updatedBy !='' ">
            updatedBy,
        </if>
        <if test="updatedTime !=null and updatedTime !='' ">
            updatedTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="title !=null and title !='' ">
             #{title},
        </if>
        <if test="category !=null and category !='' ">
             #{category},
        </if>
        <if test="associatedDrugs !=null and associatedDrugs !='' ">
             #{associatedDrugs},
        </if>
        <if test="associatedDiseases !=null and associatedDiseases !='' ">
             #{associatedDiseases},
        </if>
        <if test="diseaseCourse !=null and diseaseCourse !='' ">
             #{diseaseCourse},
        </if>
        <if test="createdBy !=null and createdBy !='' ">
             #{createdBy},
        </if>
        <if test="createdTime !=null and createdTime !='' ">
             #{createdTime},
        </if>
        <if test="updatedBy !=null and updatedBy !='' ">
             #{updatedBy},
        </if>
        <if test="updatedTime !=null and updatedTime !='' ">
             #{updatedTime},
        </if>
        </trim>

    </insert>

</mapper>
