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

    <select id="selectSDtpRwglBusinesstaskList" parameterType="pd" resultType="pd">
        select * from s_dtp_rwgl_businesstask where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="businessBelonging !=null and businessBelonging !='' ">
            and businessBelonging = #{businessBelonging}
        </if>
        <if test="taskType !=null and taskType !='' ">
            and taskType = #{taskType}
        </if>
        <if test="patientName !=null and patientName !='' ">
            and patientName = #{patientName}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and createTime = #{createTime}
        </if>
        <if test="completeTime !=null and completeTime !='' ">
            and completeTime = #{completeTime}
        </if>
        <if test="follower !=null and follower !='' ">
            and follower = #{follower}
        </if>
        <if test="store !=null and store !='' ">
            and store = #{store}
        </if>
        <if test="chain !=null and chain !='' ">
            and chain = #{chain}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
    </select>


    <update id="updateSDtpRwglBusinesstask" parameterType="pd" >
        update s_dtp_rwgl_businesstask
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="businessBelonging !=null and businessBelonging !='' ">
            businessBelonging = #{businessBelonging},
        </if>
        <if test="taskType !=null and taskType !='' ">
            taskType = #{taskType},
        </if>
        <if test="patientName !=null and patientName !='' ">
            patientName = #{patientName},
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime = #{createTime},
        </if>
        <if test="completeTime !=null and completeTime !='' ">
            completeTime = #{completeTime},
        </if>
        <if test="follower !=null and follower !='' ">
            follower = #{follower},
        </if>
        <if test="store !=null and store !='' ">
            store = #{store},
        </if>
        <if test="chain !=null and chain !='' ">
            chain = #{chain},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="businessBelonging !=null and businessBelonging !='' ">
            businessBelonging,
        </if>
        <if test="taskType !=null and taskType !='' ">
            taskType,
        </if>
        <if test="patientName !=null and patientName !='' ">
            patientName,
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime,
        </if>
        <if test="completeTime !=null and completeTime !='' ">
            completeTime,
        </if>
        <if test="follower !=null and follower !='' ">
            follower,
        </if>
        <if test="store !=null and store !='' ">
            store,
        </if>
        <if test="chain !=null and chain !='' ">
            chain,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="businessBelonging !=null and businessBelonging !='' ">
             #{businessBelonging},
        </if>
        <if test="taskType !=null and taskType !='' ">
             #{taskType},
        </if>
        <if test="patientName !=null and patientName !='' ">
             #{patientName},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        <if test="completeTime !=null and completeTime !='' ">
             #{completeTime},
        </if>
        <if test="follower !=null and follower !='' ">
             #{follower},
        </if>
        <if test="store !=null and store !='' ">
             #{store},
        </if>
        <if test="chain !=null and chain !='' ">
             #{chain},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        </trim>

    </insert>

</mapper>
