<?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.TgjjGrckzhbdxxMapper">
    
    <resultMap type="TgjjGrckzhbdxx" id="TgjjGrckzhbdxxResult">
        <result property="ID"    column="ID"    />
        <result property="GRZH"    column="GRZH"    />
        <result property="JZRQ"    column="JZRQ"    />
        <result property="GJHTQYWLX"    column="GJHTQYWLX"    />
        <result property="FSE"    column="FSE"    />
        <result property="DNGJFSE"    column="DNGJFSE"    />
        <result property="SNJZFSE"    column="SNJZFSE"    />
        <result property="FSLXE"    column="FSLXE"    />
        <result property="TQYY"    column="TQYY"    />
        <result property="TQFS"    column="TQFS"    />
        <result property="YWLSH"    column="YWLSH"    />
        <result property="CZBZ"    column="CZBZ"    />
        <result property="GRZHYE"    column="GRZHYE"    />
        <result property="ZXBH"    column="ZXBH"    />
        <result property="lastUpdateTime"    column="LAST_UPDATE_TIME"    />
        <result property="CLLX"    column="CLLX"    />
    </resultMap>

    <sql id="selectTgjjGrckzhbdxxVo">
        select ID, GRZH, JZRQ, GJHTQYWLX, FSE, DNGJFSE, SNJZFSE, FSLXE, TQYY, TQFS, YWLSH, CZBZ, GRZHYE, ZXBH, LAST_UPDATE_TIME, CLLX from tgjj_grckzhbdxx
    </sql>

    <select id="selectTgjjGrckzhbdxxList" parameterType="TgjjGrckzhbdxx" resultMap="TgjjGrckzhbdxxResult">
        <include refid="selectTgjjGrckzhbdxxVo"/>
        <where>  
            <if test="GRZH != null  and GRZH != ''"> and GRZH = #{GRZH}</if>
            <if test="JZRQ != null "> and JZRQ = #{JZRQ}</if>
            <if test="GJHTQYWLX != null  and GJHTQYWLX != ''"> and GJHTQYWLX = #{GJHTQYWLX}</if>
            <if test="FSE != null "> and FSE = #{FSE}</if>
            <if test="DNGJFSE != null "> and DNGJFSE = #{DNGJFSE}</if>
            <if test="SNJZFSE != null "> and SNJZFSE = #{SNJZFSE}</if>
            <if test="FSLXE != null "> and FSLXE = #{FSLXE}</if>
            <if test="TQYY != null  and TQYY != ''"> and TQYY = #{TQYY}</if>
            <if test="TQFS != null  and TQFS != ''"> and TQFS = #{TQFS}</if>
            <if test="YWLSH != null  and YWLSH != ''"> and YWLSH = #{YWLSH}</if>
            <if test="CZBZ != null  and CZBZ != ''"> and CZBZ = #{CZBZ}</if>
            <if test="GRZHYE != null "> and GRZHYE = #{GRZHYE}</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="selectTgjjGrckzhbdxxById" parameterType="Long" resultMap="TgjjGrckzhbdxxResult">
        <include refid="selectTgjjGrckzhbdxxVo"/>
        where ID = #{ID}
    </select>
        
    <insert id="insertTgjjGrckzhbdxx" parameterType="TgjjGrckzhbdxx" useGeneratedKeys="true" keyProperty="ID">
        insert into tgjj_grckzhbdxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="GRZH != null">GRZH,</if>
            <if test="JZRQ != null">JZRQ,</if>
            <if test="GJHTQYWLX != null">GJHTQYWLX,</if>
            <if test="FSE != null">FSE,</if>
            <if test="DNGJFSE != null">DNGJFSE,</if>
            <if test="SNJZFSE != null">SNJZFSE,</if>
            <if test="FSLXE != null">FSLXE,</if>
            <if test="TQYY != null">TQYY,</if>
            <if test="TQFS != null">TQFS,</if>
            <if test="YWLSH != null">YWLSH,</if>
            <if test="CZBZ != null">CZBZ,</if>
            <if test="GRZHYE != null">GRZHYE,</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="GRZH != null">#{GRZH},</if>
            <if test="JZRQ != null">#{JZRQ},</if>
            <if test="GJHTQYWLX != null">#{GJHTQYWLX},</if>
            <if test="FSE != null">#{FSE},</if>
            <if test="DNGJFSE != null">#{DNGJFSE},</if>
            <if test="SNJZFSE != null">#{SNJZFSE},</if>
            <if test="FSLXE != null">#{FSLXE},</if>
            <if test="TQYY != null">#{TQYY},</if>
            <if test="TQFS != null">#{TQFS},</if>
            <if test="YWLSH != null">#{YWLSH},</if>
            <if test="CZBZ != null">#{CZBZ},</if>
            <if test="GRZHYE != null">#{GRZHYE},</if>
            <if test="ZXBH != null">#{ZXBH},</if>
            <if test="lastUpdateTime != null">#{lastUpdateTime},</if>
            <if test="CLLX != null">#{CLLX},</if>
         </trim>
    </insert>

    <update id="updateTgjjGrckzhbdxx" parameterType="TgjjGrckzhbdxx">
        update tgjj_grckzhbdxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="GRZH != null">GRZH = #{GRZH},</if>
            <if test="JZRQ != null">JZRQ = #{JZRQ},</if>
            <if test="GJHTQYWLX != null">GJHTQYWLX = #{GJHTQYWLX},</if>
            <if test="FSE != null">FSE = #{FSE},</if>
            <if test="DNGJFSE != null">DNGJFSE = #{DNGJFSE},</if>
            <if test="SNJZFSE != null">SNJZFSE = #{SNJZFSE},</if>
            <if test="FSLXE != null">FSLXE = #{FSLXE},</if>
            <if test="TQYY != null">TQYY = #{TQYY},</if>
            <if test="TQFS != null">TQFS = #{TQFS},</if>
            <if test="YWLSH != null">YWLSH = #{YWLSH},</if>
            <if test="CZBZ != null">CZBZ = #{CZBZ},</if>
            <if test="GRZHYE != null">GRZHYE = #{GRZHYE},</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="deleteTgjjGrckzhbdxxById" parameterType="Long">
        delete from tgjj_grckzhbdxx where ID = #{ID}
    </delete>

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

</mapper>