<?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.TgjjDwckzhbdxxMapper">
    
    <resultMap type="TgjjDwckzhbdxx" id="TgjjDwckzhbdxxResult">
        <result property="ID"    column="ID"    />
        <result property="DWZH"    column="DWZH"    />
        <result property="JZRQ"    column="JZRQ"    />
        <result property="FSE"    column="FSE"    />
        <result property="FSLXE"    column="FSLXE"    />
        <result property="FSRS"    column="FSRS"    />
        <result property="YWMXLX"    column="YWMXLX"    />
        <result property="HBJNY"    column="HBJNY"    />
        <result property="YWLSH"    column="YWLSH"    />
        <result property="CZBZ"    column="CZBZ"    />
        <result property="DWZHYE"    column="DWZHYE"    />
        <result property="ZXBH"    column="ZXBH"    />
        <result property="lastUpdateTime"    column="LAST_UPDATE_TIME"    />
        <result property="CLLX"    column="CLLX"    />
    </resultMap>

    <sql id="selectTgjjDwckzhbdxxVo">
        select ID, DWZH, JZRQ, FSE, FSLXE, FSRS, YWMXLX, HBJNY, YWLSH, CZBZ, DWZHYE, ZXBH, LAST_UPDATE_TIME, CLLX from tgjj_dwckzhbdxx
    </sql>

    <select id="selectTgjjDwckzhbdxxList" parameterType="TgjjDwckzhbdxx" resultMap="TgjjDwckzhbdxxResult">
        <include refid="selectTgjjDwckzhbdxxVo"/>
        <where>  
            <if test="DWZH != null  and DWZH != ''"> and DWZH = #{DWZH}</if>
            <if test="JZRQ != null "> and JZRQ = #{JZRQ}</if>
            <if test="FSE != null "> and FSE = #{FSE}</if>
            <if test="FSLXE != null "> and FSLXE = #{FSLXE}</if>
            <if test="FSRS != null "> and FSRS = #{FSRS}</if>
            <if test="YWMXLX != null  and YWMXLX != ''"> and YWMXLX = #{YWMXLX}</if>
            <if test="HBJNY != null  and HBJNY != ''"> and HBJNY = #{HBJNY}</if>
            <if test="YWLSH != null  and YWLSH != ''"> and YWLSH = #{YWLSH}</if>
            <if test="CZBZ != null  and CZBZ != ''"> and CZBZ = #{CZBZ}</if>
            <if test="DWZHYE != null "> and DWZHYE = #{DWZHYE}</if>
            <if test="ZXBH != null  and ZXBH != ''"> and ZXBH = #{ZXBH}</if>
            <if test="lastUpdateTime != null "> and LAST_UPDATE_TIME = #{lastUpdateTime}</if>
            <if test="CLLX != null "> and CLLX = #{CLLX}</if>
        </where>
        order by LAST_UPDATE_TIME DESC
    </select>
    
    <select id="selectTgjjDwckzhbdxxById" parameterType="Long" resultMap="TgjjDwckzhbdxxResult">
        <include refid="selectTgjjDwckzhbdxxVo"/>
        where ID = #{ID}
    </select>
        
    <insert id="insertTgjjDwckzhbdxx" parameterType="TgjjDwckzhbdxx" useGeneratedKeys="true" keyProperty="ID">
        insert into tgjj_dwckzhbdxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="DWZH != null">DWZH,</if>
            <if test="JZRQ != null">JZRQ,</if>
            <if test="FSE != null">FSE,</if>
            <if test="FSLXE != null">FSLXE,</if>
            <if test="FSRS != null">FSRS,</if>
            <if test="YWMXLX != null">YWMXLX,</if>
            <if test="HBJNY != null">HBJNY,</if>
            <if test="YWLSH != null">YWLSH,</if>
            <if test="CZBZ != null">CZBZ,</if>
            <if test="DWZHYE != null">DWZHYE,</if>
            <if test="ZXBH != null">ZXBH,</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME,</if>
            <if test="CLLX != null">CLLX,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="DWZH != null">#{DWZH},</if>
            <if test="JZRQ != null">#{JZRQ},</if>
            <if test="FSE != null">#{FSE},</if>
            <if test="FSLXE != null">#{FSLXE},</if>
            <if test="FSRS != null">#{FSRS},</if>
            <if test="YWMXLX != null">#{YWMXLX},</if>
            <if test="HBJNY != null">#{HBJNY},</if>
            <if test="YWLSH != null">#{YWLSH},</if>
            <if test="CZBZ != null">#{CZBZ},</if>
            <if test="DWZHYE != null">#{DWZHYE},</if>
            <if test="ZXBH != null">#{ZXBH},</if>
            <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
            <if test="CLLX != null">#{CLLX},</if>
         </trim>
    </insert>

    <update id="updateTgjjDwckzhbdxx" parameterType="TgjjDwckzhbdxx">
        update tgjj_dwckzhbdxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="DWZH != null">DWZH = #{DWZH},</if>
            <if test="JZRQ != null">JZRQ = #{JZRQ},</if>
            <if test="FSE != null">FSE = #{FSE},</if>
            <if test="FSLXE != null">FSLXE = #{FSLXE},</if>
            <if test="FSRS != null">FSRS = #{FSRS},</if>
            <if test="YWMXLX != null">YWMXLX = #{YWMXLX},</if>
            <if test="HBJNY != null">HBJNY = #{HBJNY},</if>
            <if test="YWLSH != null">YWLSH = #{YWLSH},</if>
            <if test="CZBZ != null">CZBZ = #{CZBZ},</if>
            <if test="DWZHYE != null">DWZHYE = #{DWZHYE},</if>
            <if test="ZXBH != null">ZXBH = #{ZXBH},</if>
            <if test="lastUpdateTime != null">LAST_UPDATE_TIME = #{lastUpdateTime},</if>
            <if test="CLLX != null">CLLX = #{CLLX},</if>
        </trim>
        where ID = #{ID}
    </update>

    <delete id="deleteTgjjDwckzhbdxxById" parameterType="Long">
        delete from tgjj_dwckzhbdxx where ID = #{ID}
    </delete>

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

</mapper>