<?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.TGuijiNaturalresourcesQlrjbxxMapper">
    
    <resultMap type="TGuijiNaturalresourcesQlrjbxx" id="TGuijiNaturalresourcesQlrjbxxResult">
        <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="tq"    column="tq"    />
        <result property="djbh"    column="djbh"    />
        <result property="qlrlx"    column="qlrlx"    />
        <result property="qlbh"    column="qlbh"    />
        <result property="qlrbh"    column="qlrbh"    />
        <result property="qllb"    column="qllb"    />
        <result property="qlrmc"    column="qlrmc"    />
        <result property="sxh"    column="sxh"    />
        <result property="zjlb"    column="zjlb"    />
        <result property="zjhm"    column="zjhm"    />
        <result property="fzjg"    column="fzjg"    />
        <result property="sshy"    column="sshy"    />
        <result property="gjdq"    column="gjdq"    />
        <result property="hjszss"    column="hjszss"    />
        <result property="xb"    column="xb"    />
        <result property="dh"    column="dh"    />
        <result property="dz"    column="dz"    />
        <result property="yb"    column="yb"    />
        <result property="gzdw"    column="gzdw"    />
        <result property="dzyj"    column="dzyj"    />
        <result property="qdfs"    column="qdfs"    />
        <result property="qlrxz"    column="qlrxz"    />
        <result property="qlmj"    column="qlmj"    />
        <result property="qlbl"    column="qlbl"    />
        <result property="gyfs"    column="gyfs"    />
        <result property="qszt"    column="qszt"    />
        <result property="qzh"    column="qzh"    />
        <result property="zsbh"    column="zsbh"    />
        <result property="frlx"    column="frlx"    />
        <result property="frdb"    column="frdb"    />
        <result property="csrq"    column="csrq"    />
        <result property="sfztp"    column="sfztp"    />
        <result property="bz"    column="bz"    />
        <result property="tsdw"    column="tsdw"    />
    </resultMap>

    <sql id="selectTGuijiNaturalresourcesQlrjbxxVo">
        select id, create_time, cd_time, cd_batch, cd_operation, cd_source, tq, djbh, qlrlx, qlbh, qlrbh, qllb, qlrmc, sxh, zjlb, zjhm, fzjg, sshy, gjdq, hjszss, xb, dh, dz, yb, gzdw, dzyj, qdfs, qlrxz, qlmj, qlbl, gyfs, qszt, qzh, zsbh, frlx, frdb, csrq, sfztp, bz, tsdw from t_guiji_naturalresources_qlrjbxx
    </sql>

    <select id="selectTGuijiNaturalresourcesQlrjbxxList" parameterType="TGuijiNaturalresourcesQlrjbxx" resultMap="TGuijiNaturalresourcesQlrjbxxResult">
        <include refid="selectTGuijiNaturalresourcesQlrjbxxVo"/>
        <where>  
            <if test="cdTime != null  and cdTime != ''"> and cd_time = #{cdTime}</if>
            <if test="cdBatch != null  and cdBatch != ''"> and cd_batch = #{cdBatch}</if>
            <if test="cdOperation != null  and cdOperation != ''"> and cd_operation = #{cdOperation}</if>
            <if test="cdSource != null  and cdSource != ''"> and cd_source = #{cdSource}</if>
            <if test="tq != null  and tq != ''"> and tq = #{tq}</if>
            <if test="djbh != null  and djbh != ''"> and djbh = #{djbh}</if>
            <if test="qlrlx != null  and qlrlx != ''"> and qlrlx = #{qlrlx}</if>
            <if test="qlbh != null  and qlbh != ''"> and qlbh = #{qlbh}</if>
            <if test="qlrbh != null  and qlrbh != ''"> and qlrbh = #{qlrbh}</if>
            <if test="qllb != null  and qllb != ''"> and qllb = #{qllb}</if>
            <if test="qlrmc != null  and qlrmc != ''"> and qlrmc like concat('%', #{qlrmc}, '%')</if>
            <if test="sxh != null  and sxh != ''"> and sxh = #{sxh}</if>
            <if test="zjlb != null  and zjlb != ''"> and zjlb = #{zjlb}</if>
            <if test="zjhm != null  and zjhm != ''"> and zjhm = #{zjhm}</if>
            <if test="fzjg != null  and fzjg != ''"> and fzjg = #{fzjg}</if>
            <if test="sshy != null  and sshy != ''"> and sshy = #{sshy}</if>
            <if test="gjdq != null  and gjdq != ''"> and gjdq = #{gjdq}</if>
            <if test="hjszss != null  and hjszss != ''"> and hjszss = #{hjszss}</if>
            <if test="xb != null  and xb != ''"> and xb = #{xb}</if>
            <if test="dh != null  and dh != ''"> and dh = #{dh}</if>
            <if test="dz != null  and dz != ''"> and dz = #{dz}</if>
            <if test="yb != null  and yb != ''"> and yb = #{yb}</if>
            <if test="gzdw != null  and gzdw != ''"> and gzdw = #{gzdw}</if>
            <if test="dzyj != null  and dzyj != ''"> and dzyj = #{dzyj}</if>
            <if test="qdfs != null  and qdfs != ''"> and qdfs = #{qdfs}</if>
            <if test="qlrxz != null"> and qlrxz = #{qlrxz}</if>
            <if test="qlmj != null  and qlmj != ''"> and qlmj = #{qlmj}</if>
            <if test="qlbl != null  and qlbl != ''"> and qlbl = #{qlbl}</if>
            <if test="gyfs != null  and gyfs != ''"> and gyfs = #{gyfs}</if>
            <if test="qszt != null  and qszt != ''"> and qszt = #{qszt}</if>
            <if test="qzh != null  and qzh != ''"> and qzh = #{qzh}</if>
            <if test="zsbh != null  and zsbh != ''"> and zsbh = #{zsbh}</if>
            <if test="frlx != null  and frlx != ''"> and frlx = #{frlx}</if>
            <if test="frdb != null  and frdb != ''"> and frdb = #{frdb}</if>
            <if test="csrq != null  and csrq != ''"> and csrq = #{csrq}</if>
            <if test="sfztp != null  and sfztp != ''"> and sfztp = #{sfztp}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="tsdw != null  and tsdw != ''"> and tsdw = #{tsdw}</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectTGuijiNaturalresourcesQlrjbxxById" parameterType="String" resultMap="TGuijiNaturalresourcesQlrjbxxResult">
        <include refid="selectTGuijiNaturalresourcesQlrjbxxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTGuijiNaturalresourcesQlrjbxx" parameterType="TGuijiNaturalresourcesQlrjbxx">
        insert into t_guiji_naturalresources_qlrjbxx
        <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="tq != null">tq,</if>
            <if test="djbh != null">djbh,</if>
            <if test="qlrlx != null">qlrlx,</if>
            <if test="qlbh != null">qlbh,</if>
            <if test="qlrbh != null">qlrbh,</if>
            <if test="qllb != null">qllb,</if>
            <if test="qlrmc != null">qlrmc,</if>
            <if test="sxh != null">sxh,</if>
            <if test="zjlb != null">zjlb,</if>
            <if test="zjhm != null">zjhm,</if>
            <if test="fzjg != null">fzjg,</if>
            <if test="sshy != null">sshy,</if>
            <if test="gjdq != null">gjdq,</if>
            <if test="hjszss != null">hjszss,</if>
            <if test="xb != null">xb,</if>
            <if test="dh != null">dh,</if>
            <if test="dz != null">dz,</if>
            <if test="yb != null">yb,</if>
            <if test="gzdw != null">gzdw,</if>
            <if test="dzyj != null">dzyj,</if>
            <if test="qdfs != null">qdfs,</if>
            <if test="qlrxz != null">qlrxz,</if>
            <if test="qlmj != null">qlmj,</if>
            <if test="qlbl != null">qlbl,</if>
            <if test="gyfs != null">gyfs,</if>
            <if test="qszt != null">qszt,</if>
            <if test="qzh != null">qzh,</if>
            <if test="zsbh != null">zsbh,</if>
            <if test="frlx != null">frlx,</if>
            <if test="frdb != null">frdb,</if>
            <if test="csrq != null">csrq,</if>
            <if test="sfztp != null">sfztp,</if>
            <if test="bz != null">bz,</if>
            <if test="tsdw != null">tsdw,</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="tq != null">#{tq},</if>
            <if test="djbh != null">#{djbh},</if>
            <if test="qlrlx != null">#{qlrlx},</if>
            <if test="qlbh != null">#{qlbh},</if>
            <if test="qlrbh != null">#{qlrbh},</if>
            <if test="qllb != null">#{qllb},</if>
            <if test="qlrmc != null">#{qlrmc},</if>
            <if test="sxh != null">#{sxh},</if>
            <if test="zjlb != null">#{zjlb},</if>
            <if test="zjhm != null">#{zjhm},</if>
            <if test="fzjg != null">#{fzjg},</if>
            <if test="sshy != null">#{sshy},</if>
            <if test="gjdq != null">#{gjdq},</if>
            <if test="hjszss != null">#{hjszss},</if>
            <if test="xb != null">#{xb},</if>
            <if test="dh != null">#{dh},</if>
            <if test="dz != null">#{dz},</if>
            <if test="yb != null">#{yb},</if>
            <if test="gzdw != null">#{gzdw},</if>
            <if test="dzyj != null">#{dzyj},</if>
            <if test="qdfs != null">#{qdfs},</if>
            <if test="qlrxz != null">#{qlrxz},</if>
            <if test="qlmj != null">#{qlmj},</if>
            <if test="qlbl != null">#{qlbl},</if>
            <if test="gyfs != null">#{gyfs},</if>
            <if test="qszt != null">#{qszt},</if>
            <if test="qzh != null">#{qzh},</if>
            <if test="zsbh != null">#{zsbh},</if>
            <if test="frlx != null">#{frlx},</if>
            <if test="frdb != null">#{frdb},</if>
            <if test="csrq != null">#{csrq},</if>
            <if test="sfztp != null">#{sfztp},</if>
            <if test="bz != null">#{bz},</if>
            <if test="tsdw != null">#{tsdw},</if>
         </trim>
    </insert>

    <update id="updateTGuijiNaturalresourcesQlrjbxx" parameterType="TGuijiNaturalresourcesQlrjbxx">
        update t_guiji_naturalresources_qlrjbxx
        <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="tq != null">tq = #{tq},</if>
            <if test="djbh != null">djbh = #{djbh},</if>
            <if test="qlrlx != null">qlrlx = #{qlrlx},</if>
            <if test="qlbh != null">qlbh = #{qlbh},</if>
            <if test="qlrbh != null">qlrbh = #{qlrbh},</if>
            <if test="qllb != null">qllb = #{qllb},</if>
            <if test="qlrmc != null">qlrmc = #{qlrmc},</if>
            <if test="sxh != null">sxh = #{sxh},</if>
            <if test="zjlb != null">zjlb = #{zjlb},</if>
            <if test="zjhm != null">zjhm = #{zjhm},</if>
            <if test="fzjg != null">fzjg = #{fzjg},</if>
            <if test="sshy != null">sshy = #{sshy},</if>
            <if test="gjdq != null">gjdq = #{gjdq},</if>
            <if test="hjszss != null">hjszss = #{hjszss},</if>
            <if test="xb != null">xb = #{xb},</if>
            <if test="dh != null">dh = #{dh},</if>
            <if test="dz != null">dz = #{dz},</if>
            <if test="yb != null">yb = #{yb},</if>
            <if test="gzdw != null">gzdw = #{gzdw},</if>
            <if test="dzyj != null">dzyj = #{dzyj},</if>
            <if test="qdfs != null">qdfs = #{qdfs},</if>
            <if test="qlrxz != null">qlrxz = #{qlrxz},</if>
            <if test="qlmj != null">qlmj = #{qlmj},</if>
            <if test="qlbl != null">qlbl = #{qlbl},</if>
            <if test="gyfs != null">gyfs = #{gyfs},</if>
            <if test="qszt != null">qszt = #{qszt},</if>
            <if test="qzh != null">qzh = #{qzh},</if>
            <if test="zsbh != null">zsbh = #{zsbh},</if>
            <if test="frlx != null">frlx = #{frlx},</if>
            <if test="frdb != null">frdb = #{frdb},</if>
            <if test="csrq != null">csrq = #{csrq},</if>
            <if test="sfztp != null">sfztp = #{sfztp},</if>
            <if test="bz != null">bz = #{bz},</if>
            <if test="tsdw != null">tsdw = #{tsdw},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTGuijiNaturalresourcesQlrjbxxById" parameterType="String">
        delete from t_guiji_naturalresources_qlrjbxx where id = #{id}
    </delete>

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

</mapper>