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

    <select id="selectSJkglGyhyHyglContractinfoList" parameterType="pd" resultType="pd">
        select * from s_jkgl_gyhy_hygl_contractinfo where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="creationDate !=null and creationDate !='' ">
            and creationDate = #{creationDate}
        </if>
        <if test="theme !=null and theme !='' ">
            and theme = #{theme}
        </if>
        <if test="contractCategory !=null and contractCategory !='' ">
            and contractCategory = #{contractCategory}
        </if>
        <if test="contractValidPeriod !=null and contractValidPeriod !='' ">
            and contractValidPeriod = #{contractValidPeriod}
        </if>
        <if test="signingValidPeriod !=null and signingValidPeriod !='' ">
            and signingValidPeriod = #{signingValidPeriod}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="contractNature !=null and contractNature !='' ">
            and contractNature = #{contractNature}
        </if>
        <if test="isDrugMaintenanceConfigured !=null and isDrugMaintenanceConfigured !='' ">
            and isDrugMaintenanceConfigured = #{isDrugMaintenanceConfigured}
        </if>
        <if test="participationCount !=null and participationCount !='' ">
            and participationCount = #{participationCount}
        </if>
        <if test="verificationCount !=null and verificationCount !='' ">
            and verificationCount = #{verificationCount}
        </if>
    </select>


    <update id="updateSJkglGyhyHyglContractinfo" parameterType="pd" >
        update s_jkgl_gyhy_hygl_contractinfo
        <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="contractCategory !=null and contractCategory !='' ">
            contractCategory = #{contractCategory},
        </if>
        <if test="contractValidPeriod !=null and contractValidPeriod !='' ">
            contractValidPeriod = #{contractValidPeriod},
        </if>
        <if test="signingValidPeriod !=null and signingValidPeriod !='' ">
            signingValidPeriod = #{signingValidPeriod},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="contractNature !=null and contractNature !='' ">
            contractNature = #{contractNature},
        </if>
        <if test="isDrugMaintenanceConfigured !=null and isDrugMaintenanceConfigured !='' ">
            isDrugMaintenanceConfigured = #{isDrugMaintenanceConfigured},
        </if>
        <if test="participationCount !=null and participationCount !='' ">
            participationCount = #{participationCount},
        </if>
        <if test="verificationCount !=null and verificationCount !='' ">
            verificationCount = #{verificationCount},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="creationDate !=null and creationDate !='' ">
            creationDate,
        </if>
        <if test="theme !=null and theme !='' ">
            theme,
        </if>
        <if test="contractCategory !=null and contractCategory !='' ">
            contractCategory,
        </if>
        <if test="contractValidPeriod !=null and contractValidPeriod !='' ">
            contractValidPeriod,
        </if>
        <if test="signingValidPeriod !=null and signingValidPeriod !='' ">
            signingValidPeriod,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="contractNature !=null and contractNature !='' ">
            contractNature,
        </if>
        <if test="isDrugMaintenanceConfigured !=null and isDrugMaintenanceConfigured !='' ">
            isDrugMaintenanceConfigured,
        </if>
        <if test="participationCount !=null and participationCount !='' ">
            participationCount,
        </if>
        <if test="verificationCount !=null and verificationCount !='' ">
            verificationCount,
        </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="contractCategory !=null and contractCategory !='' ">
             #{contractCategory},
        </if>
        <if test="contractValidPeriod !=null and contractValidPeriod !='' ">
             #{contractValidPeriod},
        </if>
        <if test="signingValidPeriod !=null and signingValidPeriod !='' ">
             #{signingValidPeriod},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="contractNature !=null and contractNature !='' ">
             #{contractNature},
        </if>
        <if test="isDrugMaintenanceConfigured !=null and isDrugMaintenanceConfigured !='' ">
             #{isDrugMaintenanceConfigured},
        </if>
        <if test="participationCount !=null and participationCount !='' ">
             #{participationCount},
        </if>
        <if test="verificationCount !=null and verificationCount !='' ">
             #{verificationCount},
        </if>
        </trim>

    </insert>

</mapper>
