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

    <select id="selectSJkglYpwxServiceprojectinfoList" parameterType="pd" resultType="pd">
        select * from s_jkgl_ypwx_serviceprojectinfo where 1=1
        <if test="creationDate !=null and creationDate !='' ">
            and creationDate = #{creationDate}
        </if>
        <if test="theme !=null and theme !='' ">
            and theme = #{theme}
        </if>
        <if test="includedMedicines !=null and includedMedicines !='' ">
            and includedMedicines = #{includedMedicines}
        </if>
        <if test="maintenanceMode !=null and maintenanceMode !='' ">
            and maintenanceMode = #{maintenanceMode}
        </if>
        <if test="servicePeriods !=null and servicePeriods !='' ">
            and servicePeriods = #{servicePeriods}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="servedPeople !=null and servedPeople !='' ">
            and servedPeople = #{servedPeople}
        </if>
        <if test="isSmsTemplateConfigured !=null and isSmsTemplateConfigured !='' ">
            and isSmsTemplateConfigured = #{isSmsTemplateConfigured}
        </if>
        <if test="dataSource !=null and dataSource !='' ">
            and dataSource = #{dataSource}
        </if>
    </select>


    <update id="updateSJkglYpwxServiceprojectinfo" parameterType="pd" >
        update s_jkgl_ypwx_serviceprojectinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="creationDate !=null and creationDate !='' ">
            creationDate = #{creationDate},
        </if>
        <if test="theme !=null and theme !='' ">
            theme = #{theme},
        </if>
        <if test="includedMedicines !=null and includedMedicines !='' ">
            includedMedicines = #{includedMedicines},
        </if>
        <if test="maintenanceMode !=null and maintenanceMode !='' ">
            maintenanceMode = #{maintenanceMode},
        </if>
        <if test="servicePeriods !=null and servicePeriods !='' ">
            servicePeriods = #{servicePeriods},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="servedPeople !=null and servedPeople !='' ">
            servedPeople = #{servedPeople},
        </if>
        <if test="isSmsTemplateConfigured !=null and isSmsTemplateConfigured !='' ">
            isSmsTemplateConfigured = #{isSmsTemplateConfigured},
        </if>
        <if test="dataSource !=null and dataSource !='' ">
            dataSource = #{dataSource},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="creationDate !=null and creationDate !='' ">
            creationDate,
        </if>
        <if test="theme !=null and theme !='' ">
            theme,
        </if>
        <if test="includedMedicines !=null and includedMedicines !='' ">
            includedMedicines,
        </if>
        <if test="maintenanceMode !=null and maintenanceMode !='' ">
            maintenanceMode,
        </if>
        <if test="servicePeriods !=null and servicePeriods !='' ">
            servicePeriods,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="servedPeople !=null and servedPeople !='' ">
            servedPeople,
        </if>
        <if test="isSmsTemplateConfigured !=null and isSmsTemplateConfigured !='' ">
            isSmsTemplateConfigured,
        </if>
        <if test="dataSource !=null and dataSource !='' ">
            dataSource,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="creationDate !=null and creationDate !='' ">
             #{creationDate},
        </if>
        <if test="theme !=null and theme !='' ">
             #{theme},
        </if>
        <if test="includedMedicines !=null and includedMedicines !='' ">
             #{includedMedicines},
        </if>
        <if test="maintenanceMode !=null and maintenanceMode !='' ">
             #{maintenanceMode},
        </if>
        <if test="servicePeriods !=null and servicePeriods !='' ">
             #{servicePeriods},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="servedPeople !=null and servedPeople !='' ">
             #{servedPeople},
        </if>
        <if test="isSmsTemplateConfigured !=null and isSmsTemplateConfigured !='' ">
             #{isSmsTemplateConfigured},
        </if>
        <if test="dataSource !=null and dataSource !='' ">
             #{dataSource},
        </if>
        </trim>

    </insert>

</mapper>
