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

    <select id="selectSDtpZskcxPharmacovigilanceList" parameterType="pd" resultType="pd">
        select * from s_dtp_zskcx_pharmacovigilance where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="lastUpdateTime !=null and lastUpdateTime !='' ">
            and lastUpdateTime = #{lastUpdateTime}
        </if>
        <if test="name !=null and name !='' ">
            and name = #{name}
        </if>
        <if test="introduction !=null and introduction !='' ">
            and introduction = #{introduction}
        </if>
        <if test="alertCreator !=null and alertCreator !='' ">
            and alertCreator = #{alertCreator}
        </if>
        <if test="createdAt !=null and createdAt !='' ">
            and createdAt = #{createdAt}
        </if>
    </select>


    <update id="updateSDtpZskcxPharmacovigilance" parameterType="pd" >
        update s_dtp_zskcx_pharmacovigilance
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="lastUpdateTime !=null and lastUpdateTime !='' ">
            lastUpdateTime = #{lastUpdateTime},
        </if>
        <if test="name !=null and name !='' ">
            name = #{name},
        </if>
        <if test="introduction !=null and introduction !='' ">
            introduction = #{introduction},
        </if>
        <if test="alertCreator !=null and alertCreator !='' ">
            alertCreator = #{alertCreator},
        </if>
        <if test="createdAt !=null and createdAt !='' ">
            createdAt = #{createdAt},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="lastUpdateTime !=null and lastUpdateTime !='' ">
            lastUpdateTime,
        </if>
        <if test="name !=null and name !='' ">
            name,
        </if>
        <if test="introduction !=null and introduction !='' ">
            introduction,
        </if>
        <if test="alertCreator !=null and alertCreator !='' ">
            alertCreator,
        </if>
        <if test="createdAt !=null and createdAt !='' ">
            createdAt,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="lastUpdateTime !=null and lastUpdateTime !='' ">
             #{lastUpdateTime},
        </if>
        <if test="name !=null and name !='' ">
             #{name},
        </if>
        <if test="introduction !=null and introduction !='' ">
             #{introduction},
        </if>
        <if test="alertCreator !=null and alertCreator !='' ">
             #{alertCreator},
        </if>
        <if test="createdAt !=null and createdAt !='' ">
             #{createdAt},
        </if>
        </trim>

    </insert>

</mapper>
