<?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.TgjjDwxxMapper">
    
    <resultMap type="TgjjDwxx" id="TgjjDwxxResult">
        <result property="ID"    column="ID"    />
        <result property="DWMC"    column="DWMC"    />
        <result property="DWZH"    column="DWZH"    />
        <result property="DWDZ"    column="DWDZ"    />
        <result property="DWFRDBXM"    column="DWFRDBXM"    />
        <result property="DWFRDBZJLX"    column="DWFRDBZJLX"    />
        <result property="DWFRDBZJHM"    column="DWFRDBZJHM"    />
        <result property="DWLSGX"    column="DWLSGX"    />
        <result property="DWJJLX"    column="DWJJLX"    />
        <result property="DWSSHY"    column="DWSSHY"    />
        <result property="DWYB"    column="DWYB"    />
        <result property="DWDZXX"    column="DWDZXX"    />
        <result property="DWFXR"    column="DWFXR"    />
        <result property="JBRXM"    column="JBRXM"    />
        <result property="JBRGDDHHM"    column="JBRGDDHHM"    />
        <result property="JBRSJHM"    column="JBRSJHM"    />
        <result property="JBRZJLX"    column="JBRZJLX"    />
        <result property="JBRZJHM"    column="JBRZJHM"    />
        <result property="ZZJGDM"    column="ZZJGDM"    />
        <result property="DWSLRQ"    column="DWSLRQ"    />
        <result property="DWKHRQ"    column="DWKHRQ"    />
        <result property="STYHMC"    column="STYHMC"    />
        <result property="STYHDM"    column="STYHDM"    />
        <result property="TYSHXYDM"    column="TYSHXYDM"    />
        <result property="ZXBH"    column="ZXBH"    />
        <result property="lastUpdateTime"    column="LAST_UPDATE_TIME"    />
        <result property="DWXZ"    column="DWXZ"    />
        <result property="CLLX"    column="CLLX"    />
    </resultMap>

    <sql id="selectTgjjDwxxVo">
        select ID, DWMC, DWZH, DWDZ, DWFRDBXM, DWFRDBZJLX, DWFRDBZJHM, DWLSGX, DWJJLX, DWSSHY, DWYB, DWDZXX, DWFXR, JBRXM, JBRGDDHHM, JBRSJHM, JBRZJLX, JBRZJHM, ZZJGDM, DWSLRQ, DWKHRQ, STYHMC, STYHDM, TYSHXYDM, ZXBH, LAST_UPDATE_TIME, DWXZ, CLLX from tgjj_dwxx
    </sql>

    <select id="selectTgjjDwxxList" parameterType="TgjjDwxx" resultMap="TgjjDwxxResult">
        <include refid="selectTgjjDwxxVo"/>
        <where>  
            <if test="DWMC != null  and DWMC != ''"> and DWMC = #{DWMC}</if>
            <if test="DWZH != null  and DWZH != ''"> and DWZH = #{DWZH}</if>
            <if test="DWDZ != null  and DWDZ != ''"> and DWDZ = #{DWDZ}</if>
            <if test="DWFRDBXM != null  and DWFRDBXM != ''"> and DWFRDBXM = #{DWFRDBXM}</if>
            <if test="DWFRDBZJLX != null  and DWFRDBZJLX != ''"> and DWFRDBZJLX = #{DWFRDBZJLX}</if>
            <if test="DWFRDBZJHM != null  and DWFRDBZJHM != ''"> and DWFRDBZJHM = #{DWFRDBZJHM}</if>
            <if test="DWLSGX != null  and DWLSGX != ''"> and DWLSGX = #{DWLSGX}</if>
            <if test="DWJJLX != null  and DWJJLX != ''"> and DWJJLX = #{DWJJLX}</if>
            <if test="DWSSHY != null  and DWSSHY != ''"> and DWSSHY = #{DWSSHY}</if>
            <if test="DWYB != null  and DWYB != ''"> and DWYB = #{DWYB}</if>
            <if test="DWDZXX != null  and DWDZXX != ''"> and DWDZXX = #{DWDZXX}</if>
            <if test="DWFXR != null  and DWFXR != ''"> and DWFXR = #{DWFXR}</if>
            <if test="JBRXM != null  and JBRXM != ''"> and JBRXM = #{JBRXM}</if>
            <if test="JBRGDDHHM != null  and JBRGDDHHM != ''"> and JBRGDDHHM = #{JBRGDDHHM}</if>
            <if test="JBRSJHM != null  and JBRSJHM != ''"> and JBRSJHM = #{JBRSJHM}</if>
            <if test="JBRZJLX != null  and JBRZJLX != ''"> and JBRZJLX = #{JBRZJLX}</if>
            <if test="JBRZJHM != null  and JBRZJHM != ''"> and JBRZJHM = #{JBRZJHM}</if>
            <if test="ZZJGDM != null  and ZZJGDM != ''"> and ZZJGDM = #{ZZJGDM}</if>
            <if test="DWSLRQ != null "> and DWSLRQ = #{DWSLRQ}</if>
            <if test="DWKHRQ != null "> and DWKHRQ = #{DWKHRQ}</if>
            <if test="STYHMC != null  and STYHMC != ''"> and STYHMC = #{STYHMC}</if>
            <if test="STYHDM != null  and STYHDM != ''"> and STYHDM = #{STYHDM}</if>
            <if test="TYSHXYDM != null  and TYSHXYDM != ''"> and TYSHXYDM = #{TYSHXYDM}</if>
            <if test="ZXBH != null  and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
            <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
            <if test="DWXZ != null  and DWXZ != ''"> and DWXZ = #{DWXZ}</if>
            <if test="CLLX != null "> and CLLX = #{CLLX}</if>
        </where>
        order by LAST_UPDATE_TIME DESC
    </select>
    
    <select id="selectTgjjDwxxById" parameterType="Long" resultMap="TgjjDwxxResult">
        <include refid="selectTgjjDwxxVo"/>
        where ID = #{ID}
    </select>
        
    <insert id="insertTgjjDwxx" parameterType="TgjjDwxx" useGeneratedKeys="true" keyProperty="ID">
        insert into tgjj_dwxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="DWMC != null">DWMC,</if>
            <if test="DWZH != null">DWZH,</if>
            <if test="DWDZ != null">DWDZ,</if>
            <if test="DWFRDBXM != null">DWFRDBXM,</if>
            <if test="DWFRDBZJLX != null">DWFRDBZJLX,</if>
            <if test="DWFRDBZJHM != null">DWFRDBZJHM,</if>
            <if test="DWLSGX != null">DWLSGX,</if>
            <if test="DWJJLX != null">DWJJLX,</if>
            <if test="DWSSHY != null">DWSSHY,</if>
            <if test="DWYB != null">DWYB,</if>
            <if test="DWDZXX != null">DWDZXX,</if>
            <if test="DWFXR != null">DWFXR,</if>
            <if test="JBRXM != null">JBRXM,</if>
            <if test="JBRGDDHHM != null">JBRGDDHHM,</if>
            <if test="JBRSJHM != null">JBRSJHM,</if>
            <if test="JBRZJLX != null">JBRZJLX,</if>
            <if test="JBRZJHM != null">JBRZJHM,</if>
            <if test="ZZJGDM != null">ZZJGDM,</if>
            <if test="DWSLRQ != null">DWSLRQ,</if>
            <if test="DWKHRQ != null">DWKHRQ,</if>
            <if test="STYHMC != null">STYHMC,</if>
            <if test="STYHDM != null">STYHDM,</if>
            <if test="TYSHXYDM != null">TYSHXYDM,</if>
            <if test="ZXBH != null">ZXBH,</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
            <if test="DWXZ != null">DWXZ,</if>
            <if test="CLLX != null">CLLX,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="DWMC != null">#{DWMC},</if>
            <if test="DWZH != null">#{DWZH},</if>
            <if test="DWDZ != null">#{DWDZ},</if>
            <if test="DWFRDBXM != null">#{DWFRDBXM},</if>
            <if test="DWFRDBZJLX != null">#{DWFRDBZJLX},</if>
            <if test="DWFRDBZJHM != null">#{DWFRDBZJHM},</if>
            <if test="DWLSGX != null">#{DWLSGX},</if>
            <if test="DWJJLX != null">#{DWJJLX},</if>
            <if test="DWSSHY != null">#{DWSSHY},</if>
            <if test="DWYB != null">#{DWYB},</if>
            <if test="DWDZXX != null">#{DWDZXX},</if>
            <if test="DWFXR != null">#{DWFXR},</if>
            <if test="JBRXM != null">#{JBRXM},</if>
            <if test="JBRGDDHHM != null">#{JBRGDDHHM},</if>
            <if test="JBRSJHM != null">#{JBRSJHM},</if>
            <if test="JBRZJLX != null">#{JBRZJLX},</if>
            <if test="JBRZJHM != null">#{JBRZJHM},</if>
            <if test="ZZJGDM != null">#{ZZJGDM},</if>
            <if test="DWSLRQ != null">#{DWSLRQ},</if>
            <if test="DWKHRQ != null">#{DWKHRQ},</if>
            <if test="STYHMC != null">#{STYHMC},</if>
            <if test="STYHDM != null">#{STYHDM},</if>
            <if test="TYSHXYDM != null">#{TYSHXYDM},</if>
            <if test="ZXBH != null">#{ZXBH},</if>
            <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
            <if test="DWXZ != null">#{DWXZ},</if>
            <if test="CLLX != null">#{CLLX},</if>
         </trim>
    </insert>

    <update id="updateTgjjDwxx" parameterType="TgjjDwxx">
        update tgjj_dwxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="DWMC != null">DWMC = #{DWMC},</if>
            <if test="DWZH != null">DWZH = #{DWZH},</if>
            <if test="DWDZ != null">DWDZ = #{DWDZ},</if>
            <if test="DWFRDBXM != null">DWFRDBXM = #{DWFRDBXM},</if>
            <if test="DWFRDBZJLX != null">DWFRDBZJLX = #{DWFRDBZJLX},</if>
            <if test="DWFRDBZJHM != null">DWFRDBZJHM = #{DWFRDBZJHM},</if>
            <if test="DWLSGX != null">DWLSGX = #{DWLSGX},</if>
            <if test="DWJJLX != null">DWJJLX = #{DWJJLX},</if>
            <if test="DWSSHY != null">DWSSHY = #{DWSSHY},</if>
            <if test="DWYB != null">DWYB = #{DWYB},</if>
            <if test="DWDZXX != null">DWDZXX = #{DWDZXX},</if>
            <if test="DWFXR != null">DWFXR = #{DWFXR},</if>
            <if test="JBRXM != null">JBRXM = #{JBRXM},</if>
            <if test="JBRGDDHHM != null">JBRGDDHHM = #{JBRGDDHHM},</if>
            <if test="JBRSJHM != null">JBRSJHM = #{JBRSJHM},</if>
            <if test="JBRZJLX != null">JBRZJLX = #{JBRZJLX},</if>
            <if test="JBRZJHM != null">JBRZJHM = #{JBRZJHM},</if>
            <if test="ZZJGDM != null">ZZJGDM = #{ZZJGDM},</if>
            <if test="DWSLRQ != null">DWSLRQ = #{DWSLRQ},</if>
            <if test="DWKHRQ != null">DWKHRQ = #{DWKHRQ},</if>
            <if test="STYHMC != null">STYHMC = #{STYHMC},</if>
            <if test="STYHDM != null">STYHDM = #{STYHDM},</if>
            <if test="TYSHXYDM != null">TYSHXYDM = #{TYSHXYDM},</if>
            <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
            <if test="DWXZ != null">DWXZ = #{DWXZ},</if>
            <if test="CLLX != null">CLLX = #{CLLX},</if>
        </trim>
        where ID = #{ID}
    </update>

    <delete id="deleteTgjjDwxxById" parameterType="Long">
        delete from tgjj_dwxx where ID = #{ID}
    </delete>

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

</mapper>