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

    <select id="selectSDtpYypzVerbalTricktList" parameterType="pd" resultType="pd">
        select * from s_dtp_yypz_verbal_trickt where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="scriptId !=null and scriptId !='' ">
            and scriptId = #{scriptId}
        </if>
        <if test="scriptTheme !=null and scriptTheme !='' ">
            and scriptTheme = #{scriptTheme}
        </if>
        <if test="scriptSummary !=null and scriptSummary !='' ">
            and scriptSummary = #{scriptSummary}
        </if>
        <if test="scriptContent !=null and scriptContent !='' ">
            and scriptContent = #{scriptContent}
        </if>
        <if test="keywords !=null and keywords !='' ">
            and keywords = #{keywords}
        </if>
        <if test="weight !=null and weight !='' ">
            and weight = #{weight}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="lastOperationTime !=null and lastOperationTime !='' ">
            and lastOperationTime = #{lastOperationTime}
        </if>
        <if test="lastOperator !=null and lastOperator !='' ">
            and lastOperator = #{lastOperator}
        </if>
        <if test="themeId !=null and themeId !='' ">
            and themeId = #{themeId}
        </if>
        <if test="theme !=null and theme !='' ">
            and theme = #{theme}
        </if>
        <if test="applicableDrugType !=null and applicableDrugType !='' ">
            and applicableDrugType = #{applicableDrugType}
        </if>
        <if test="applicableFollowUpType !=null and applicableFollowUpType !='' ">
            and applicableFollowUpType = #{applicableFollowUpType}
        </if>
        <if test="taskTheme !=null and taskTheme !='' ">
            and taskTheme = #{taskTheme}
        </if>
        <if test="lastEditTime !=null and lastEditTime !='' ">
            and lastEditTime = #{lastEditTime}
        </if>
        <if test="lastEditor !=null and lastEditor !='' ">
            and lastEditor = #{lastEditor}
        </if>
    </select>


    <update id="updateSDtpYypzVerbalTrickt" parameterType="pd" >
        update s_dtp_yypz_verbal_trickt
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="scriptId !=null and scriptId !='' ">
            scriptId = #{scriptId},
        </if>
        <if test="scriptTheme !=null and scriptTheme !='' ">
            scriptTheme = #{scriptTheme},
        </if>
        <if test="scriptSummary !=null and scriptSummary !='' ">
            scriptSummary = #{scriptSummary},
        </if>
        <if test="scriptContent !=null and scriptContent !='' ">
            scriptContent = #{scriptContent},
        </if>
        <if test="keywords !=null and keywords !='' ">
            keywords = #{keywords},
        </if>
        <if test="weight !=null and weight !='' ">
            weight = #{weight},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="lastOperationTime !=null and lastOperationTime !='' ">
            lastOperationTime = #{lastOperationTime},
        </if>
        <if test="lastOperator !=null and lastOperator !='' ">
            lastOperator = #{lastOperator},
        </if>
        <if test="themeId !=null and themeId !='' ">
            themeId = #{themeId},
        </if>
        <if test="theme !=null and theme !='' ">
            theme = #{theme},
        </if>
        <if test="applicableDrugType !=null and applicableDrugType !='' ">
            applicableDrugType = #{applicableDrugType},
        </if>
        <if test="applicableFollowUpType !=null and applicableFollowUpType !='' ">
            applicableFollowUpType = #{applicableFollowUpType},
        </if>
        <if test="taskTheme !=null and taskTheme !='' ">
            taskTheme = #{taskTheme},
        </if>
        <if test="lastEditTime !=null and lastEditTime !='' ">
            lastEditTime = #{lastEditTime},
        </if>
        <if test="lastEditor !=null and lastEditor !='' ">
            lastEditor = #{lastEditor},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="scriptId !=null and scriptId !='' ">
            scriptId,
        </if>
        <if test="scriptTheme !=null and scriptTheme !='' ">
            scriptTheme,
        </if>
        <if test="scriptSummary !=null and scriptSummary !='' ">
            scriptSummary,
        </if>
        <if test="scriptContent !=null and scriptContent !='' ">
            scriptContent,
        </if>
        <if test="keywords !=null and keywords !='' ">
            keywords,
        </if>
        <if test="weight !=null and weight !='' ">
            weight,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="lastOperationTime !=null and lastOperationTime !='' ">
            lastOperationTime,
        </if>
        <if test="lastOperator !=null and lastOperator !='' ">
            lastOperator,
        </if>
        <if test="themeId !=null and themeId !='' ">
            themeId,
        </if>
        <if test="theme !=null and theme !='' ">
            theme,
        </if>
        <if test="applicableDrugType !=null and applicableDrugType !='' ">
            applicableDrugType,
        </if>
        <if test="applicableFollowUpType !=null and applicableFollowUpType !='' ">
            applicableFollowUpType,
        </if>
        <if test="taskTheme !=null and taskTheme !='' ">
            taskTheme,
        </if>
        <if test="lastEditTime !=null and lastEditTime !='' ">
            lastEditTime,
        </if>
        <if test="lastEditor !=null and lastEditor !='' ">
            lastEditor,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="scriptId !=null and scriptId !='' ">
             #{scriptId},
        </if>
        <if test="scriptTheme !=null and scriptTheme !='' ">
             #{scriptTheme},
        </if>
        <if test="scriptSummary !=null and scriptSummary !='' ">
             #{scriptSummary},
        </if>
        <if test="scriptContent !=null and scriptContent !='' ">
             #{scriptContent},
        </if>
        <if test="keywords !=null and keywords !='' ">
             #{keywords},
        </if>
        <if test="weight !=null and weight !='' ">
             #{weight},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="lastOperationTime !=null and lastOperationTime !='' ">
             #{lastOperationTime},
        </if>
        <if test="lastOperator !=null and lastOperator !='' ">
             #{lastOperator},
        </if>
        <if test="themeId !=null and themeId !='' ">
             #{themeId},
        </if>
        <if test="theme !=null and theme !='' ">
             #{theme},
        </if>
        <if test="applicableDrugType !=null and applicableDrugType !='' ">
             #{applicableDrugType},
        </if>
        <if test="applicableFollowUpType !=null and applicableFollowUpType !='' ">
             #{applicableFollowUpType},
        </if>
        <if test="taskTheme !=null and taskTheme !='' ">
             #{taskTheme},
        </if>
        <if test="lastEditTime !=null and lastEditTime !='' ">
             #{lastEditTime},
        </if>
        <if test="lastEditor !=null and lastEditor !='' ">
             #{lastEditor},
        </if>
        </trim>

    </insert>

</mapper>
