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

    <select id="selectSJkglMbglQyglBenefitinfoList" parameterType="pd" resultType="pd">
        select * from s_jkgl_mbgl_qygl_benefitinfo where 1=1
        <if test="creationDate !=null and creationDate !='' ">
            and creationDate = #{creationDate}
        </if>
        <if test="benefitSubject !=null and benefitSubject !='' ">
            and benefitSubject = #{benefitSubject}
        </if>
        <if test="diseaseTag !=null and diseaseTag !='' ">
            and diseaseTag = #{diseaseTag}
        </if>
        <if test="includedBenefitCategory !=null and includedBenefitCategory !='' ">
            and includedBenefitCategory = #{includedBenefitCategory}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
    </select>


    <update id="updateSJkglMbglQyglBenefitinfo" parameterType="pd" >
        update s_jkgl_mbgl_qygl_benefitinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="creationDate !=null and creationDate !='' ">
            creationDate = #{creationDate},
        </if>
        <if test="benefitSubject !=null and benefitSubject !='' ">
            benefitSubject = #{benefitSubject},
        </if>
        <if test="diseaseTag !=null and diseaseTag !='' ">
            diseaseTag = #{diseaseTag},
        </if>
        <if test="includedBenefitCategory !=null and includedBenefitCategory !='' ">
            includedBenefitCategory = #{includedBenefitCategory},
        </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="SJkglMbglQyglBenefitinfoRemove" parameterType="pd">
        <if test="ids != null">
            delete from s_jkgl_mbgl_qygl_benefitinfo where
            <if test="ids != null">
                id in(${ids})
            </if>
        </if>
    </delete>

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

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

        <if test="creationDate !=null and creationDate !='' ">
            creationDate,
        </if>
        <if test="benefitSubject !=null and benefitSubject !='' ">
            benefitSubject,
        </if>
        <if test="diseaseTag !=null and diseaseTag !='' ">
            diseaseTag,
        </if>
        <if test="includedBenefitCategory !=null and includedBenefitCategory !='' ">
            includedBenefitCategory,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="creationDate !=null and creationDate !='' ">
             #{creationDate},
        </if>
        <if test="benefitSubject !=null and benefitSubject !='' ">
             #{benefitSubject},
        </if>
        <if test="diseaseTag !=null and diseaseTag !='' ">
             #{diseaseTag},
        </if>
        <if test="includedBenefitCategory !=null and includedBenefitCategory !='' ">
             #{includedBenefitCategory},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        </trim>

    </insert>

</mapper>
