<?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.TgjjGrdkzhxxMapper">
    
    <resultMap type="TgjjGrdkzhxx" id="TgjjGrdkzhxxResult">
        <result property="ID"    column="ID"    />
        <result property="DKZH"    column="DKZH"    />
        <result property="JKHTBH"    column="JKHTBH"    />
        <result property="DKFXDJ"    column="DKFXDJ"    />
        <result property="DKFFE"    column="DKFFE"    />
        <result property="DKFFRQ"    column="DKFFRQ"    />
        <result property="DKYE"    column="DKYE"    />
        <result property="DKLL"    column="DKLL"    />
        <result property="DQJHHKJE"    column="DQJHHKJE"    />
        <result property="DQJHGHBJ"    column="DQJHGHBJ"    />
        <result property="DQJHGHLX"    column="DQJHGHLX"    />
        <result property="DQYHJE"    column="DQYHJE"    />
        <result property="DQYHBJ"    column="DQYHBJ"    />
        <result property="DQYHLX"    column="DQYHLX"    />
        <result property="DQYHFX"    column="DQYHFX"    />
        <result property="DKJQRQ"    column="DKJQRQ"    />
        <result property="HSBJZE"    column="HSBJZE"    />
        <result property="HSLXZE"    column="HSLXZE"    />
        <result property="FXZE"    column="FXZE"    />
        <result property="TQGHBJZE"    column="TQGHBJZE"    />
        <result property="YQBJZE"    column="YQBJZE"    />
        <result property="YQLXZE"    column="YQLXZE"    />
        <result property="LJYQQS"    column="LJYQQS"    />
        <result property="DKZT"    column="DKZT"    />
        <result property="ZXBH"    column="ZXBH"    />
        <result property="lastUpdateTime"    column="LAST_UPDATE_TIME"    />
        <result property="SCHKFSRQ"    column="SCHKFSRQ"    />
        <result property="CLLX"    column="CLLX"    />
    </resultMap>

    <sql id="selectTgjjGrdkzhxxVo">
        select ID, DKZH, JKHTBH, DKFXDJ, DKFFE, DKFFRQ, DKYE, DKLL, DQJHHKJE, DQJHGHBJ, DQJHGHLX, DQYHJE, DQYHBJ, DQYHLX, DQYHFX, DKJQRQ, HSBJZE, HSLXZE, FXZE, TQGHBJZE, YQBJZE, YQLXZE, LJYQQS, DKZT, ZXBH, LAST_UPDATE_TIME, SCHKFSRQ, CLLX from tgjj_grdkzhxx
    </sql>

    <select id="selectTgjjGrdkzhxxList" parameterType="TgjjGrdkzhxx" resultMap="TgjjGrdkzhxxResult">
        <include refid="selectTgjjGrdkzhxxVo"/>
        <where>  
            <if test="DKZH != null  and DKZH != ''"> and DKZH = #{DKZH}</if>
            <if test="JKHTBH != null  and JKHTBH != ''"> and JKHTBH = #{JKHTBH}</if>
            <if test="DKFXDJ != null  and DKFXDJ != ''"> and DKFXDJ = #{DKFXDJ}</if>
            <if test="DKFFE != null "> and DKFFE = #{DKFFE}</if>
            <if test="DKFFRQ != null "> and DKFFRQ = #{DKFFRQ}</if>
            <if test="DKYE != null "> and DKYE = #{DKYE}</if>
            <if test="DKLL != null "> and DKLL = #{DKLL}</if>
            <if test="DQJHHKJE != null "> and DQJHHKJE = #{DQJHHKJE}</if>
            <if test="DQJHGHBJ != null "> and DQJHGHBJ = #{DQJHGHBJ}</if>
            <if test="DQJHGHLX != null "> and DQJHGHLX = #{DQJHGHLX}</if>
            <if test="DQYHJE != null "> and DQYHJE = #{DQYHJE}</if>
            <if test="DQYHBJ != null "> and DQYHBJ = #{DQYHBJ}</if>
            <if test="DQYHLX != null "> and DQYHLX = #{DQYHLX}</if>
            <if test="DQYHFX != null "> and DQYHFX = #{DQYHFX}</if>
            <if test="DKJQRQ != null "> and DKJQRQ = #{DKJQRQ}</if>
            <if test="HSBJZE != null "> and HSBJZE = #{HSBJZE}</if>
            <if test="HSLXZE != null "> and HSLXZE = #{HSLXZE}</if>
            <if test="FXZE != null "> and FXZE = #{FXZE}</if>
            <if test="TQGHBJZE != null "> and TQGHBJZE = #{TQGHBJZE}</if>
            <if test="YQBJZE != null "> and YQBJZE = #{YQBJZE}</if>
            <if test="YQLXZE != null "> and YQLXZE = #{YQLXZE}</if>
            <if test="LJYQQS != null "> and LJYQQS = #{LJYQQS}</if>
            <if test="DKZT != null  and DKZT != ''"> and DKZT = #{DKZT}</if>
            <if test="ZXBH != null  and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
            <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
            <if test="SCHKFSRQ != null "> and SCHKFSRQ = #{SCHKFSRQ}</if>
            <if test="CLLX != null "> and CLLX = #{CLLX}</if>
        </where>
        order by LAST_UPDATE_TIME DESC
    </select>
    
    <select id="selectTgjjGrdkzhxxById" parameterType="Long" resultMap="TgjjGrdkzhxxResult">
        <include refid="selectTgjjGrdkzhxxVo"/>
        where ID = #{ID}
    </select>
        
    <insert id="insertTgjjGrdkzhxx" parameterType="TgjjGrdkzhxx" useGeneratedKeys="true" keyProperty="ID">
        insert into tgjj_grdkzhxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="DKZH != null">DKZH,</if>
            <if test="JKHTBH != null">JKHTBH,</if>
            <if test="DKFXDJ != null">DKFXDJ,</if>
            <if test="DKFFE != null">DKFFE,</if>
            <if test="DKFFRQ != null">DKFFRQ,</if>
            <if test="DKYE != null">DKYE,</if>
            <if test="DKLL != null">DKLL,</if>
            <if test="DQJHHKJE != null">DQJHHKJE,</if>
            <if test="DQJHGHBJ != null">DQJHGHBJ,</if>
            <if test="DQJHGHLX != null">DQJHGHLX,</if>
            <if test="DQYHJE != null">DQYHJE,</if>
            <if test="DQYHBJ != null">DQYHBJ,</if>
            <if test="DQYHLX != null">DQYHLX,</if>
            <if test="DQYHFX != null">DQYHFX,</if>
            <if test="DKJQRQ != null">DKJQRQ,</if>
            <if test="HSBJZE != null">HSBJZE,</if>
            <if test="HSLXZE != null">HSLXZE,</if>
            <if test="FXZE != null">FXZE,</if>
            <if test="TQGHBJZE != null">TQGHBJZE,</if>
            <if test="YQBJZE != null">YQBJZE,</if>
            <if test="YQLXZE != null">YQLXZE,</if>
            <if test="LJYQQS != null">LJYQQS,</if>
            <if test="DKZT != null">DKZT,</if>
            <if test="ZXBH != null">ZXBH,</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
            <if test="SCHKFSRQ != null">SCHKFSRQ,</if>
            <if test="CLLX != null">CLLX,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="DKZH != null">#{DKZH},</if>
            <if test="JKHTBH != null">#{JKHTBH},</if>
            <if test="DKFXDJ != null">#{DKFXDJ},</if>
            <if test="DKFFE != null">#{DKFFE},</if>
            <if test="DKFFRQ != null">#{DKFFRQ},</if>
            <if test="DKYE != null">#{DKYE},</if>
            <if test="DKLL != null">#{DKLL},</if>
            <if test="DQJHHKJE != null">#{DQJHHKJE},</if>
            <if test="DQJHGHBJ != null">#{DQJHGHBJ},</if>
            <if test="DQJHGHLX != null">#{DQJHGHLX},</if>
            <if test="DQYHJE != null">#{DQYHJE},</if>
            <if test="DQYHBJ != null">#{DQYHBJ},</if>
            <if test="DQYHLX != null">#{DQYHLX},</if>
            <if test="DQYHFX != null">#{DQYHFX},</if>
            <if test="DKJQRQ != null">#{DKJQRQ},</if>
            <if test="HSBJZE != null">#{HSBJZE},</if>
            <if test="HSLXZE != null">#{HSLXZE},</if>
            <if test="FXZE != null">#{FXZE},</if>
            <if test="TQGHBJZE != null">#{TQGHBJZE},</if>
            <if test="YQBJZE != null">#{YQBJZE},</if>
            <if test="YQLXZE != null">#{YQLXZE},</if>
            <if test="LJYQQS != null">#{LJYQQS},</if>
            <if test="DKZT != null">#{DKZT},</if>
            <if test="ZXBH != null">#{ZXBH},</if>
            <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
            <if test="SCHKFSRQ != null">#{SCHKFSRQ},</if>
            <if test="CLLX != null">#{CLLX},</if>
         </trim>
    </insert>

    <update id="updateTgjjGrdkzhxx" parameterType="TgjjGrdkzhxx">
        update tgjj_grdkzhxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="DKZH != null">DKZH = #{DKZH},</if>
            <if test="JKHTBH != null">JKHTBH = #{JKHTBH},</if>
            <if test="DKFXDJ != null">DKFXDJ = #{DKFXDJ},</if>
            <if test="DKFFE != null">DKFFE = #{DKFFE},</if>
            <if test="DKFFRQ != null">DKFFRQ = #{DKFFRQ},</if>
            <if test="DKYE != null">DKYE = #{DKYE},</if>
            <if test="DKLL != null">DKLL = #{DKLL},</if>
            <if test="DQJHHKJE != null">DQJHHKJE = #{DQJHHKJE},</if>
            <if test="DQJHGHBJ != null">DQJHGHBJ = #{DQJHGHBJ},</if>
            <if test="DQJHGHLX != null">DQJHGHLX = #{DQJHGHLX},</if>
            <if test="DQYHJE != null">DQYHJE = #{DQYHJE},</if>
            <if test="DQYHBJ != null">DQYHBJ = #{DQYHBJ},</if>
            <if test="DQYHLX != null">DQYHLX = #{DQYHLX},</if>
            <if test="DQYHFX != null">DQYHFX = #{DQYHFX},</if>
            <if test="DKJQRQ != null">DKJQRQ = #{DKJQRQ},</if>
            <if test="HSBJZE != null">HSBJZE = #{HSBJZE},</if>
            <if test="HSLXZE != null">HSLXZE = #{HSLXZE},</if>
            <if test="FXZE != null">FXZE = #{FXZE},</if>
            <if test="TQGHBJZE != null">TQGHBJZE = #{TQGHBJZE},</if>
            <if test="YQBJZE != null">YQBJZE = #{YQBJZE},</if>
            <if test="YQLXZE != null">YQLXZE = #{YQLXZE},</if>
            <if test="LJYQQS != null">LJYQQS = #{LJYQQS},</if>
            <if test="DKZT != null">DKZT = #{DKZT},</if>
            <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
            <if test="SCHKFSRQ != null">SCHKFSRQ = #{SCHKFSRQ},</if>
            <if test="CLLX != null">CLLX = #{CLLX},</if>
        </trim>
        where ID = #{ID}
    </update>

    <delete id="deleteTgjjGrdkzhxxById" parameterType="Long">
        delete from tgjj_grdkzhxx where ID = #{ID}
    </delete>

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

</mapper>