<?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="com.sooka.system.mapper.TGuijiNaturalresourcesBdcdjxxMapper">
    
    <resultMap type="TGuijiNaturalresourcesBdcdjxx" id="TGuijiNaturalresourcesBdcdjxxResult">
        <result property="id"    column="id"    />
        <result property="createTime"    column="create_time"    />
        <result property="cdTime"    column="cd_time"    />
        <result property="cdBatch"    column="cd_batch"    />
        <result property="cdOperation"    column="cd_operation"    />
        <result property="cdSource"    column="cd_source"    />
        <result property="djbh"    column="djbh"    />
        <result property="fdzl"    column="fdzl"    />
        <result property="gyfs"    column="gyfs"    />
        <result property="qllx"    column="qllx"    />
        <result property="cqxz"    column="cqxz"    />
        <result property="czfs"    column="czfs"    />
        <result property="zpgj"    column="zpgj"    />
        <result property="qsje"    column="qsje"    />
        <result property="zcjj"    column="zcjj"    />
        <result property="qsjs"    column="qsjs"    />
        <result property="wxzj"    column="wxzj"    />
        <result property="yys"    column="yys"    />
        <result property="wsrq"    column="wsrq"    />
        <result property="cqazhtrq"    column="cqazhtrq"    />
        <result property="djyy"    column="djyy"    />
        <result property="fj"    column="fj"    />
        <result property="hh"    column="hh"    />
        <result property="zcs"    column="zcs"    />
        <result property="szc"    column="szc"    />
        <result property="ghyt"    column="ghyt"    />
        <result property="fwjg"    column="fwjg"    />
        <result property="scjzmj"    column="scjzmj"    />
        <result property="sczyjzmj"    column="sczyjzmj"    />
        <result property="scftjzmj"    column="scftjzmj"    />
        <result property="jgsj"    column="jgsj"    />
        <result property="fwzl"    column="fwzl"    />
        <result property="tdqlxz"    column="tdqlxz"    />
        <result property="tdqllx"    column="tdqllx"    />
        <result property="tdyt"    column="tdyt"    />
        <result property="tdsyqxks"    column="tdsyqxks"    />
        <result property="tdsyqxjs"    column="tdsyqxjs"    />
        <result property="synx"    column="synx"    />
        <result property="dytdmj"    column="dytdmj"    />
        <result property="fttdmj"    column="fttdmj"    />
        <result property="gytdmj"    column="gytdmj"    />
        <result property="zddm"    column="zddm"    />
        <result property="bdcdyh"    column="bdcdyh"    />
        <result property="bdcid"    column="bdcid"    />
        <result property="tsdw"    column="tsdw"    />
        <result property="fwxz"    column="fwxz"    />
    </resultMap>

    <sql id="selectTGuijiNaturalresourcesBdcdjxxVo">
        select id, create_time, cd_time, cd_batch, cd_operation, cd_source, djbh, fdzl, gyfs, qllx, cqxz, czfs, zpgj, qsje, zcjj, qsjs, wxzj, yys, wsrq, cqazhtrq, djyy, fj, hh, zcs, szc, ghyt, fwjg, scjzmj, sczyjzmj, scftjzmj, jgsj, fwzl, tdqlxz, tdqllx, tdyt, tdsyqxks, tdsyqxjs, synx, dytdmj, fttdmj, gytdmj, zddm, bdcdyh, bdcid, tsdw, fwxz from t_guiji_naturalresources_bdcdjxx
    </sql>

    <select id="selectTGuijiNaturalresourcesBdcdjxxList" parameterType="TGuijiNaturalresourcesBdcdjxx" resultMap="TGuijiNaturalresourcesBdcdjxxResult">
        <include refid="selectTGuijiNaturalresourcesBdcdjxxVo"/>
        <where>
            <if test="djbh != null  and djbh != ''"> and djbh = #{djbh}</if>
            <if test="fdzl != null  and fdzl != ''"> and fdzl like concat('%', #{fdzl}, '%')</if>
            <if test="ghyt != null  and ghyt != ''"> and ghyt = #{ghyt}</if>
            <if test="fwjg != null  and fwjg != ''"> and fwjg = #{fwjg}</if>
            <if test="scjzmj != null  and scjzmj != ''"> and scjzmj = #{scjzmj}</if>
            <if test="sczyjzmj != null  and sczyjzmj != ''"> and sczyjzmj = #{sczyjzmj}</if>
            <if test="scftjzmj != null  and scftjzmj != ''"> and scftjzmj = #{scftjzmj}</if>
            <if test="jgsj != null  and jgsj != ''"> and jgsj = #{jgsj}</if>
            <if test="fwzl != null  and fwzl != ''"> and fwzl like concat('%', #{fwzl}, '%')</if>
            <if test="tdqlxz != null  and tdqlxz != ''"> and tdqlxz = #{tdqlxz}</if>
            <if test="tdqllx != null  and tdqllx != ''"> and tdqllx = #{tdqllx}</if>
            <if test="tdyt != null  and tdyt != ''"> and tdyt = #{tdyt}</if>
            <if test="tdsyqxks != null  and tdsyqxks != ''"> and tdsyqxks = #{tdsyqxks}</if>
            <if test="tdsyqxjs != null  and tdsyqxjs != ''"> and tdsyqxjs = #{tdsyqxjs}</if>
            <if test="synx != null  and synx != ''"> and synx = #{synx}</if>
            <if test="dytdmj != null  and dytdmj != ''"> and dytdmj = #{dytdmj}</if>
            <if test="fttdmj != null  and fttdmj != ''"> and fttdmj = #{fttdmj}</if>
            <if test="gytdmj != null  and gytdmj != ''"> and gytdmj = #{gytdmj}</if>
            <if test="zddm != null  and zddm != ''"> and zddm = #{zddm}</if>
            <if test="bdcdyh != null  and bdcdyh != ''"> and bdcdyh = #{bdcdyh}</if>
            <if test="bdcid != null  and bdcid != ''"> and bdcid = #{bdcid}</if>
            <if test="tsdw != null  and tsdw != ''"> and tsdw = #{tsdw}</if>
            <if test="fwxz != null  and fwxz != ''"> and fwxz = #{fwxz}</if>
        </where>
        order by create_time desc
    </select>

    <select id="selectTGuijiNaturalresourcesBdcdjxxQtList" parameterType="TGuijiNaturalresourcesBdcdjxx" resultMap="TGuijiNaturalresourcesBdcdjxxResult">
        <include refid="selectTGuijiNaturalresourcesBdcdjxxVo"/>
        <where>
            ghyt != '住宅' and ghyt != '办公' and ghyt != '商业服务'
            <if test="djbh != null  and djbh != ''"> and djbh = #{djbh}</if>
            <if test="fdzl != null  and fdzl != ''"> and fdzl like concat('%', #{fdzl}, '%')</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectTGuijiNaturalresourcesBdcdjxxById" parameterType="String" resultMap="TGuijiNaturalresourcesBdcdjxxResult">
        <include refid="selectTGuijiNaturalresourcesBdcdjxxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTGuijiNaturalresourcesBdcdjxx" parameterType="TGuijiNaturalresourcesBdcdjxx">
        insert into t_guiji_naturalresources_bdcdjxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="cdTime != null">cd_time,</if>
            <if test="cdBatch != null">cd_batch,</if>
            <if test="cdOperation != null">cd_operation,</if>
            <if test="cdSource != null">cd_source,</if>
            <if test="djbh != null">djbh,</if>
            <if test="fdzl != null">fdzl,</if>
            <if test="gyfs != null">gyfs,</if>
            <if test="qllx != null">qllx,</if>
            <if test="cqxz != null">cqxz,</if>
            <if test="czfs != null">czfs,</if>
            <if test="zpgj != null">zpgj,</if>
            <if test="qsje != null">qsje,</if>
            <if test="zcjj != null">zcjj,</if>
            <if test="qsjs != null">qsjs,</if>
            <if test="wxzj != null">wxzj,</if>
            <if test="yys != null">yys,</if>
            <if test="wsrq != null">wsrq,</if>
            <if test="cqazhtrq != null">cqazhtrq,</if>
            <if test="djyy != null">djyy,</if>
            <if test="fj != null">fj,</if>
            <if test="hh != null">hh,</if>
            <if test="zcs != null">zcs,</if>
            <if test="szc != null">szc,</if>
            <if test="ghyt != null">ghyt,</if>
            <if test="fwjg != null">fwjg,</if>
            <if test="scjzmj != null">scjzmj,</if>
            <if test="sczyjzmj != null">sczyjzmj,</if>
            <if test="scftjzmj != null">scftjzmj,</if>
            <if test="jgsj != null">jgsj,</if>
            <if test="fwzl != null">fwzl,</if>
            <if test="tdqlxz != null">tdqlxz,</if>
            <if test="tdqllx != null">tdqllx,</if>
            <if test="tdyt != null">tdyt,</if>
            <if test="tdsyqxks != null">tdsyqxks,</if>
            <if test="tdsyqxjs != null">tdsyqxjs,</if>
            <if test="synx != null">synx,</if>
            <if test="dytdmj != null">dytdmj,</if>
            <if test="fttdmj != null">fttdmj,</if>
            <if test="gytdmj != null">gytdmj,</if>
            <if test="zddm != null">zddm,</if>
            <if test="bdcdyh != null">bdcdyh,</if>
            <if test="bdcid != null">bdcid,</if>
            <if test="tsdw != null">tsdw,</if>
            <if test="fwxz != null">fwxz,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="cdTime != null">#{cdTime},</if>
            <if test="cdBatch != null">#{cdBatch},</if>
            <if test="cdOperation != null">#{cdOperation},</if>
            <if test="cdSource != null">#{cdSource},</if>
            <if test="djbh != null">#{djbh},</if>
            <if test="fdzl != null">#{fdzl},</if>
            <if test="gyfs != null">#{gyfs},</if>
            <if test="qllx != null">#{qllx},</if>
            <if test="cqxz != null">#{cqxz},</if>
            <if test="czfs != null">#{czfs},</if>
            <if test="zpgj != null">#{zpgj},</if>
            <if test="qsje != null">#{qsje},</if>
            <if test="zcjj != null">#{zcjj},</if>
            <if test="qsjs != null">#{qsjs},</if>
            <if test="wxzj != null">#{wxzj},</if>
            <if test="yys != null">#{yys},</if>
            <if test="wsrq != null">#{wsrq},</if>
            <if test="cqazhtrq != null">#{cqazhtrq},</if>
            <if test="djyy != null">#{djyy},</if>
            <if test="fj != null">#{fj},</if>
            <if test="hh != null">#{hh},</if>
            <if test="zcs != null">#{zcs},</if>
            <if test="szc != null">#{szc},</if>
            <if test="ghyt != null">#{ghyt},</if>
            <if test="fwjg != null">#{fwjg},</if>
            <if test="scjzmj != null">#{scjzmj},</if>
            <if test="sczyjzmj != null">#{sczyjzmj},</if>
            <if test="scftjzmj != null">#{scftjzmj},</if>
            <if test="jgsj != null">#{jgsj},</if>
            <if test="fwzl != null">#{fwzl},</if>
            <if test="tdqlxz != null">#{tdqlxz},</if>
            <if test="tdqllx != null">#{tdqllx},</if>
            <if test="tdyt != null">#{tdyt},</if>
            <if test="tdsyqxks != null">#{tdsyqxks},</if>
            <if test="tdsyqxjs != null">#{tdsyqxjs},</if>
            <if test="synx != null">#{synx},</if>
            <if test="dytdmj != null">#{dytdmj},</if>
            <if test="fttdmj != null">#{fttdmj},</if>
            <if test="gytdmj != null">#{gytdmj},</if>
            <if test="zddm != null">#{zddm},</if>
            <if test="bdcdyh != null">#{bdcdyh},</if>
            <if test="bdcid != null">#{bdcid},</if>
            <if test="tsdw != null">#{tsdw},</if>
            <if test="fwxz != null">#{fwxz},</if>
         </trim>
    </insert>

    <update id="updateTGuijiNaturalresourcesBdcdjxx" parameterType="TGuijiNaturalresourcesBdcdjxx">
        update t_guiji_naturalresources_bdcdjxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="cdTime != null">cd_time = #{cdTime},</if>
            <if test="cdBatch != null">cd_batch = #{cdBatch},</if>
            <if test="cdOperation != null">cd_operation = #{cdOperation},</if>
            <if test="cdSource != null">cd_source = #{cdSource},</if>
            <if test="djbh != null">djbh = #{djbh},</if>
            <if test="fdzl != null">fdzl = #{fdzl},</if>
            <if test="gyfs != null">gyfs = #{gyfs},</if>
            <if test="qllx != null">qllx = #{qllx},</if>
            <if test="cqxz != null">cqxz = #{cqxz},</if>
            <if test="czfs != null">czfs = #{czfs},</if>
            <if test="zpgj != null">zpgj = #{zpgj},</if>
            <if test="qsje != null">qsje = #{qsje},</if>
            <if test="zcjj != null">zcjj = #{zcjj},</if>
            <if test="qsjs != null">qsjs = #{qsjs},</if>
            <if test="wxzj != null">wxzj = #{wxzj},</if>
            <if test="yys != null">yys = #{yys},</if>
            <if test="wsrq != null">wsrq = #{wsrq},</if>
            <if test="cqazhtrq != null">cqazhtrq = #{cqazhtrq},</if>
            <if test="djyy != null">djyy = #{djyy},</if>
            <if test="fj != null">fj = #{fj},</if>
            <if test="hh != null">hh = #{hh},</if>
            <if test="zcs != null">zcs = #{zcs},</if>
            <if test="szc != null">szc = #{szc},</if>
            <if test="ghyt != null">ghyt = #{ghyt},</if>
            <if test="fwjg != null">fwjg = #{fwjg},</if>
            <if test="scjzmj != null">scjzmj = #{scjzmj},</if>
            <if test="sczyjzmj != null">sczyjzmj = #{sczyjzmj},</if>
            <if test="scftjzmj != null">scftjzmj = #{scftjzmj},</if>
            <if test="jgsj != null">jgsj = #{jgsj},</if>
            <if test="fwzl != null">fwzl = #{fwzl},</if>
            <if test="tdqlxz != null">tdqlxz = #{tdqlxz},</if>
            <if test="tdqllx != null">tdqllx = #{tdqllx},</if>
            <if test="tdyt != null">tdyt = #{tdyt},</if>
            <if test="tdsyqxks != null">tdsyqxks = #{tdsyqxks},</if>
            <if test="tdsyqxjs != null">tdsyqxjs = #{tdsyqxjs},</if>
            <if test="synx != null">synx = #{synx},</if>
            <if test="dytdmj != null">dytdmj = #{dytdmj},</if>
            <if test="fttdmj != null">fttdmj = #{fttdmj},</if>
            <if test="gytdmj != null">gytdmj = #{gytdmj},</if>
            <if test="zddm != null">zddm = #{zddm},</if>
            <if test="bdcdyh != null">bdcdyh = #{bdcdyh},</if>
            <if test="bdcid != null">bdcid = #{bdcid},</if>
            <if test="tsdw != null">tsdw = #{tsdw},</if>
            <if test="fwxz != null">fwxz = #{fwxz},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTGuijiNaturalresourcesBdcdjxxById" parameterType="String">
        delete from t_guiji_naturalresources_bdcdjxx where id = #{id}
    </delete>

    <delete id="deleteTGuijiNaturalresourcesBdcdjxxByIds" parameterType="String">
        delete from t_guiji_naturalresources_bdcdjxx where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>