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

    <select id="selectSJkglGyhyPthyContracttemplateinfoList" parameterType="pd" resultType="pd">
        select * from s_jkgl_gyhy_pthy_contracttemplateinfo where 1=1
        <if test="templateId !=null and templateId !='' ">
            and templateId = #{templateId}
        </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="contractNature !=null and contractNature !='' ">
            and contractNature = #{contractNature}
        </if>
        <if test="startTime !=null and startTime !='' ">
            and startTime = #{startTime}
        </if>
        <if test="endTime !=null and endTime !='' ">
            and endTime = #{endTime}
        </if>
        <if test="signingStartTime !=null and signingStartTime !='' ">
            and signingStartTime = #{signingStartTime}
        </if>
        <if test="signingEndTime !=null and signingEndTime !='' ">
            and signingEndTime = #{signingEndTime}
        </if>
        <if test="status !=null and status !='' ">
            and status = #{status}
        </if>
        <if test="tfStatus !=null and tfStatus !='' ">
            and tfStatus = #{tfStatus}
        </if>
        <if test="tfChain !=null and tfChain !='' ">
            and tfChain = #{tfChain}
        </if>
        <if test="successfulDeployments !=null and successfulDeployments !='' ">
            and successfulDeployments = #{successfulDeployments}
        </if>
        <if test="enabledChains !=null and enabledChains !='' ">
            and enabledChains = #{enabledChains}
        </if>
    </select>


    <update id="updateSJkglGyhyPthyContracttemplateinfo" parameterType="pd" >
        update s_jkgl_gyhy_pthy_contracttemplateinfo
        <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="contractNature !=null and contractNature !='' ">
            contractNature = #{contractNature},
        </if>
        <if test="startTime !=null and startTime !='' ">
            startTime = #{startTime},
        </if>
        <if test="endTime !=null and endTime !='' ">
            endTime = #{endTime},
        </if>
        <if test="signingStartTime !=null and signingStartTime !='' ">
            signingStartTime = #{signingStartTime},
        </if>
        <if test="signingEndTime !=null and signingEndTime !='' ">
            signingEndTime = #{signingEndTime},
        </if>
        <if test="status !=null and status !='' ">
            status = #{status},
        </if>
        <if test="tfStatus !=null and tfStatus !='' ">
            tfStatus = #{tfStatus},
        </if>
        <if test="tfChain !=null and tfChain !='' ">
            tfChain = #{tfChain},
        </if>
        <if test="successfulDeployments !=null and successfulDeployments !='' ">
            successfulDeployments = #{successfulDeployments},
        </if>
        <if test="enabledChains !=null and enabledChains !='' ">
            enabledChains = #{enabledChains},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

        insert into s_jkgl_gyhy_pthy_contracttemplateinfo
        <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="contractNature !=null and contractNature !='' ">
            contractNature,
        </if>
        <if test="startTime !=null and startTime !='' ">
            startTime,
        </if>
        <if test="endTime !=null and endTime !='' ">
            endTime,
        </if>
        <if test="signingStartTime !=null and signingStartTime !='' ">
            signingStartTime,
        </if>
        <if test="signingEndTime !=null and signingEndTime !='' ">
            signingEndTime,
        </if>
        <if test="status !=null and status !='' ">
            status,
        </if>
        <if test="tfStatus !=null and tfStatus !='' ">
            tfStatus,
        </if>
        <if test="tfChain !=null and tfChain !='' ">
            tfChain,
        </if>
        <if test="successfulDeployments !=null and successfulDeployments !='' ">
            successfulDeployments,
        </if>
        <if test="enabledChains !=null and enabledChains !='' ">
            enabledChains,
        </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="contractNature !=null and contractNature !='' ">
             #{contractNature},
        </if>
        <if test="startTime !=null and startTime !='' ">
             #{startTime},
        </if>
        <if test="endTime !=null and endTime !='' ">
             #{endTime},
        </if>
        <if test="signingStartTime !=null and signingStartTime !='' ">
             #{signingStartTime},
        </if>
        <if test="signingEndTime !=null and signingEndTime !='' ">
             #{signingEndTime},
        </if>
        <if test="status !=null and status !='' ">
             #{status},
        </if>
        <if test="tfStatus !=null and tfStatus !='' ">
             #{tfStatus},
        </if>
        <if test="tfChain !=null and tfChain !='' ">
             #{tfChain},
        </if>
        <if test="successfulDeployments !=null and successfulDeployments !='' ">
             #{successfulDeployments},
        </if>
        <if test="enabledChains !=null and enabledChains !='' ">
             #{enabledChains},
        </if>
        </trim>

    </insert>

</mapper>
