<?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.TgjjDkxxMapper">
    
    <resultMap type="TgjjDkxx" id="TgjjDkxxResult">
        <result property="ID"    column="ID"    />
        <result property="JKHTBH"    column="JKHTBH"    />
        <result property="GFHTBH"    column="GFHTBH"    />
        <result property="SWTYHMC"    column="SWTYHMC"    />
        <result property="SWTYHDM"    column="SWTYHDM"    />
        <result property="DKDBLX"    column="DKDBLX"    />
        <result property="YDFKRQ"    column="YDFKRQ"    />
        <result property="YDDQRQ"    column="YDDQRQ"    />
        <result property="DKHKFS"    column="DKHKFS"    />
        <result property="HKZH"    column="HKZH"    />
        <result property="ZHKHYHDM"    column="ZHKHYHDM"    />
        <result property="HTDKJE"    column="HTDKJE"    />
        <result property="DKLX"    column="DKLX"    />
        <result property="DKQS"    column="DKQS"    />
        <result property="FWZL"    column="FWZL"    />
        <result property="FWJZMJ"    column="FWJZMJ"    />
        <result property="FWTNMJ"    column="FWTNMJ"    />
        <result property="FWXZ"    column="FWXZ"    />
        <result property="FWZJ"    column="FWZJ"    />
        <result property="JKHTLL"    column="JKHTLL"    />
        <result property="LLFDBL"    column="LLFDBL"    />
        <result property="GFSFK"    column="GFSFK"    />
        <result property="JKRGJJZH"    column="JKRGJJZH"    />
        <result property="JKRXM"    column="JKRXM"    />
        <result property="JKRZJLX"    column="JKRZJLX"    />
        <result property="JKRZJH"    column="JKRZJH"    />
        <result property="SFRMC"    column="SFRMC"    />
        <result property="SFRZHHM"    column="SFRZHHM"    />
        <result property="SFRKHYHDM"    column="SFRKHYHDM"    />
        <result property="JKHTQDRQ"    column="JKHTQDRQ"    />
        <result property="YDHKR"    column="YDHKR"    />
        <result property="DKZH"    column="DKZH"    />
        <result property="ZXBH"    column="ZXBH"    />
        <result property="lastUpdateTime"    column="LAST_UPDATE_TIME"    />
        <result property="FWZSLX"    column="FWZSLX"    />
        <result property="FWZSHM"    column="FWZSHM"    />
        <result property="GFLX"    column="GFLX"    />
        <result property="DKD"    column="DKD"    />
        <result property="CLLX"    column="CLLX"    />
    </resultMap>

    <sql id="selectTgjjDkxxVo">
        select ID, JKHTBH, GFHTBH, SWTYHMC, SWTYHDM, DKDBLX, YDFKRQ, YDDQRQ, DKHKFS, HKZH, ZHKHYHDM, HTDKJE, DKLX, DKQS, FWZL, FWJZMJ, FWTNMJ, FWXZ, FWZJ, JKHTLL, LLFDBL, GFSFK, JKRGJJZH, JKRXM, JKRZJLX, JKRZJH, SFRMC, SFRZHHM, SFRKHYHDM, JKHTQDRQ, YDHKR, DKZH, ZXBH, LAST_UPDATE_TIME, FWZSLX, FWZSHM, GFLX, DKD, CLLX from tgjj_dkxx
    </sql>

    <select id="selectTgjjDkxxList" parameterType="TgjjDkxx" resultMap="TgjjDkxxResult">
        <include refid="selectTgjjDkxxVo"/>
        <where>  
            <if test="JKHTBH != null  and JKHTBH != ''"> and JKHTBH = #{JKHTBH}</if>
            <if test="GFHTBH != null  and GFHTBH != ''"> and GFHTBH = #{GFHTBH}</if>
            <if test="SWTYHMC != null  and SWTYHMC != ''"> and SWTYHMC = #{SWTYHMC}</if>
            <if test="SWTYHDM != null  and SWTYHDM != ''"> and SWTYHDM = #{SWTYHDM}</if>
            <if test="DKDBLX != null  and DKDBLX != ''"> and DKDBLX = #{DKDBLX}</if>
            <if test="YDFKRQ != null "> and YDFKRQ = #{YDFKRQ}</if>
            <if test="YDDQRQ != null "> and YDDQRQ = #{YDDQRQ}</if>
            <if test="DKHKFS != null  and DKHKFS != ''"> and DKHKFS = #{DKHKFS}</if>
            <if test="HKZH != null  and HKZH != ''"> and HKZH = #{HKZH}</if>
            <if test="ZHKHYHDM != null  and ZHKHYHDM != ''"> and ZHKHYHDM = #{ZHKHYHDM}</if>
            <if test="HTDKJE != null "> and HTDKJE = #{HTDKJE}</if>
            <if test="DKLX != null  and DKLX != ''"> and DKLX = #{DKLX}</if>
            <if test="DKQS != null "> and DKQS = #{DKQS}</if>
            <if test="FWZL != null  and FWZL != ''"> and FWZL = #{FWZL}</if>
            <if test="FWJZMJ != null "> and FWJZMJ = #{FWJZMJ}</if>
            <if test="FWTNMJ != null "> and FWTNMJ = #{FWTNMJ}</if>
            <if test="FWXZ != null  and FWXZ != ''"> and FWXZ = #{FWXZ}</if>
            <if test="FWZJ != null "> and FWZJ = #{FWZJ}</if>
            <if test="JKHTLL != null "> and JKHTLL = #{JKHTLL}</if>
            <if test="LLFDBL != null "> and LLFDBL = #{LLFDBL}</if>
            <if test="GFSFK != null "> and GFSFK = #{GFSFK}</if>
            <if test="JKRGJJZH != null  and JKRGJJZH != ''"> and JKRGJJZH = #{JKRGJJZH}</if>
            <if test="JKRXM != null  and JKRXM != ''"> and JKRXM = #{JKRXM}</if>
            <if test="JKRZJLX != null  and JKRZJLX != ''"> and JKRZJLX = #{JKRZJLX}</if>
            <if test="JKRZJH != null  and JKRZJH != ''"> and JKRZJH = #{JKRZJH}</if>
            <if test="SFRMC != null  and SFRMC != ''"> and SFRMC = #{SFRMC}</if>
            <if test="SFRZHHM != null  and SFRZHHM != ''"> and SFRZHHM = #{SFRZHHM}</if>
            <if test="SFRKHYHDM != null  and SFRKHYHDM != ''"> and SFRKHYHDM = #{SFRKHYHDM}</if>
            <if test="JKHTQDRQ != null "> and JKHTQDRQ = #{JKHTQDRQ}</if>
            <if test="YDHKR != null  and YDHKR != ''"> and YDHKR = #{YDHKR}</if>
            <if test="DKZH != null  and DKZH != ''"> and DKZH = #{DKZH}</if>
            <if test="ZXBH != null  and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
            <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
            <if test="FWZSLX != null  and FWZSLX != ''"> and FWZSLX = #{FWZSLX}</if>
            <if test="FWZSHM != null  and FWZSHM != ''"> and FWZSHM = #{FWZSHM}</if>
            <if test="GFLX != null  and GFLX != ''"> and GFLX = #{GFLX}</if>
            <if test="DKD != null  and DKD != ''"> and DKD = #{DKD}</if>
            <if test="CLLX != null "> and CLLX = #{CLLX}</if>
        </where>
        order by LAST_UPDATE_TIME DESC
    </select>
    
    <select id="selectTgjjDkxxById" parameterType="Long" resultMap="TgjjDkxxResult">
        <include refid="selectTgjjDkxxVo"/>
        where ID = #{ID}
    </select>
        
    <insert id="insertTgjjDkxx" parameterType="TgjjDkxx" useGeneratedKeys="true" keyProperty="ID">
        insert into tgjj_dkxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="JKHTBH != null">JKHTBH,</if>
            <if test="GFHTBH != null">GFHTBH,</if>
            <if test="SWTYHMC != null">SWTYHMC,</if>
            <if test="SWTYHDM != null">SWTYHDM,</if>
            <if test="DKDBLX != null">DKDBLX,</if>
            <if test="YDFKRQ != null">YDFKRQ,</if>
            <if test="YDDQRQ != null">YDDQRQ,</if>
            <if test="DKHKFS != null">DKHKFS,</if>
            <if test="HKZH != null">HKZH,</if>
            <if test="ZHKHYHDM != null">ZHKHYHDM,</if>
            <if test="HTDKJE != null">HTDKJE,</if>
            <if test="DKLX != null">DKLX,</if>
            <if test="DKQS != null">DKQS,</if>
            <if test="FWZL != null">FWZL,</if>
            <if test="FWJZMJ != null">FWJZMJ,</if>
            <if test="FWTNMJ != null">FWTNMJ,</if>
            <if test="FWXZ != null">FWXZ,</if>
            <if test="FWZJ != null">FWZJ,</if>
            <if test="JKHTLL != null">JKHTLL,</if>
            <if test="LLFDBL != null">LLFDBL,</if>
            <if test="GFSFK != null">GFSFK,</if>
            <if test="JKRGJJZH != null">JKRGJJZH,</if>
            <if test="JKRXM != null">JKRXM,</if>
            <if test="JKRZJLX != null">JKRZJLX,</if>
            <if test="JKRZJH != null">JKRZJH,</if>
            <if test="SFRMC != null">SFRMC,</if>
            <if test="SFRZHHM != null">SFRZHHM,</if>
            <if test="SFRKHYHDM != null">SFRKHYHDM,</if>
            <if test="JKHTQDRQ != null">JKHTQDRQ,</if>
            <if test="YDHKR != null">YDHKR,</if>
            <if test="DKZH != null">DKZH,</if>
            <if test="ZXBH != null">ZXBH,</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
            <if test="FWZSLX != null">FWZSLX,</if>
            <if test="FWZSHM != null">FWZSHM,</if>
            <if test="GFLX != null">GFLX,</if>
            <if test="DKD != null">DKD,</if>
            <if test="CLLX != null">CLLX,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="JKHTBH != null">#{JKHTBH},</if>
            <if test="GFHTBH != null">#{GFHTBH},</if>
            <if test="SWTYHMC != null">#{SWTYHMC},</if>
            <if test="SWTYHDM != null">#{SWTYHDM},</if>
            <if test="DKDBLX != null">#{DKDBLX},</if>
            <if test="YDFKRQ != null">#{YDFKRQ},</if>
            <if test="YDDQRQ != null">#{YDDQRQ},</if>
            <if test="DKHKFS != null">#{DKHKFS},</if>
            <if test="HKZH != null">#{HKZH},</if>
            <if test="ZHKHYHDM != null">#{ZHKHYHDM},</if>
            <if test="HTDKJE != null">#{HTDKJE},</if>
            <if test="DKLX != null">#{DKLX},</if>
            <if test="DKQS != null">#{DKQS},</if>
            <if test="FWZL != null">#{FWZL},</if>
            <if test="FWJZMJ != null">#{FWJZMJ},</if>
            <if test="FWTNMJ != null">#{FWTNMJ},</if>
            <if test="FWXZ != null">#{FWXZ},</if>
            <if test="FWZJ != null">#{FWZJ},</if>
            <if test="JKHTLL != null">#{JKHTLL},</if>
            <if test="LLFDBL != null">#{LLFDBL},</if>
            <if test="GFSFK != null">#{GFSFK},</if>
            <if test="JKRGJJZH != null">#{JKRGJJZH},</if>
            <if test="JKRXM != null">#{JKRXM},</if>
            <if test="JKRZJLX != null">#{JKRZJLX},</if>
            <if test="JKRZJH != null">#{JKRZJH},</if>
            <if test="SFRMC != null">#{SFRMC},</if>
            <if test="SFRZHHM != null">#{SFRZHHM},</if>
            <if test="SFRKHYHDM != null">#{SFRKHYHDM},</if>
            <if test="JKHTQDRQ != null">#{JKHTQDRQ},</if>
            <if test="YDHKR != null">#{YDHKR},</if>
            <if test="DKZH != null">#{DKZH},</if>
            <if test="ZXBH != null">#{ZXBH},</if>
            <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
            <if test="FWZSLX != null">#{FWZSLX},</if>
            <if test="FWZSHM != null">#{FWZSHM},</if>
            <if test="GFLX != null">#{GFLX},</if>
            <if test="DKD != null">#{DKD},</if>
            <if test="CLLX != null">#{CLLX},</if>
         </trim>
    </insert>

    <update id="updateTgjjDkxx" parameterType="TgjjDkxx">
        update tgjj_dkxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="JKHTBH != null">JKHTBH = #{JKHTBH},</if>
            <if test="GFHTBH != null">GFHTBH = #{GFHTBH},</if>
            <if test="SWTYHMC != null">SWTYHMC = #{SWTYHMC},</if>
            <if test="SWTYHDM != null">SWTYHDM = #{SWTYHDM},</if>
            <if test="DKDBLX != null">DKDBLX = #{DKDBLX},</if>
            <if test="YDFKRQ != null">YDFKRQ = #{YDFKRQ},</if>
            <if test="YDDQRQ != null">YDDQRQ = #{YDDQRQ},</if>
            <if test="DKHKFS != null">DKHKFS = #{DKHKFS},</if>
            <if test="HKZH != null">HKZH = #{HKZH},</if>
            <if test="ZHKHYHDM != null">ZHKHYHDM = #{ZHKHYHDM},</if>
            <if test="HTDKJE != null">HTDKJE = #{HTDKJE},</if>
            <if test="DKLX != null">DKLX = #{DKLX},</if>
            <if test="DKQS != null">DKQS = #{DKQS},</if>
            <if test="FWZL != null">FWZL = #{FWZL},</if>
            <if test="FWJZMJ != null">FWJZMJ = #{FWJZMJ},</if>
            <if test="FWTNMJ != null">FWTNMJ = #{FWTNMJ},</if>
            <if test="FWXZ != null">FWXZ = #{FWXZ},</if>
            <if test="FWZJ != null">FWZJ = #{FWZJ},</if>
            <if test="JKHTLL != null">JKHTLL = #{JKHTLL},</if>
            <if test="LLFDBL != null">LLFDBL = #{LLFDBL},</if>
            <if test="GFSFK != null">GFSFK = #{GFSFK},</if>
            <if test="JKRGJJZH != null">JKRGJJZH = #{JKRGJJZH},</if>
            <if test="JKRXM != null">JKRXM = #{JKRXM},</if>
            <if test="JKRZJLX != null">JKRZJLX = #{JKRZJLX},</if>
            <if test="JKRZJH != null">JKRZJH = #{JKRZJH},</if>
            <if test="SFRMC != null">SFRMC = #{SFRMC},</if>
            <if test="SFRZHHM != null">SFRZHHM = #{SFRZHHM},</if>
            <if test="SFRKHYHDM != null">SFRKHYHDM = #{SFRKHYHDM},</if>
            <if test="JKHTQDRQ != null">JKHTQDRQ = #{JKHTQDRQ},</if>
            <if test="YDHKR != null">YDHKR = #{YDHKR},</if>
            <if test="DKZH != null">DKZH = #{DKZH},</if>
            <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
            <if test="FWZSLX != null">FWZSLX = #{FWZSLX},</if>
            <if test="FWZSHM != null">FWZSHM = #{FWZSHM},</if>
            <if test="GFLX != null">GFLX = #{GFLX},</if>
            <if test="DKD != null">DKD = #{DKD},</if>
            <if test="CLLX != null">CLLX = #{CLLX},</if>
        </trim>
        where ID = #{ID}
    </update>

    <delete id="deleteTgjjDkxxById" parameterType="Long">
        delete from tgjj_dkxx where ID = #{ID}
    </delete>

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

</mapper>