<?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.ztmap.project.zhny.lotusxnyxnqk.mapper.TLotusXnyxnqkMapper">
    
    <resultMap type="TLotusXnyxnqk" id="TLotusXnyxnqkResult">
        <result property="id"    column="id"    />
        <result property="gf"    column="gf"    />
        <result property="fd"    column="fd"    />
        <result property="dataTime"    column="data_time"    />
    </resultMap>

    <sql id="selectTLotusXnyxnqkVo">
        select id, gf, fd, data_time from t_lotus_xnyxnqk
    </sql>

    <select id="selectTLotusXnyxnqkList" parameterType="TLotusXnyxnqk" resultMap="TLotusXnyxnqkResult">
        <include refid="selectTLotusXnyxnqkVo"/>
        <where>  
            <if test="gf != null "> and gf = #{gf}</if>
            <if test="fd != null "> and fd = #{fd}</if>
            <if test="dataTime != null  and dataTime != ''"> and data_time = #{dataTime}</if>
        </where>
    </select>
    
    <select id="selectTLotusXnyxnqkById" parameterType="Long" resultMap="TLotusXnyxnqkResult">
        <include refid="selectTLotusXnyxnqkVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTLotusXnyxnqk" parameterType="TLotusXnyxnqk" useGeneratedKeys="true" keyProperty="id">
        insert into t_lotus_xnyxnqk
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="gf != null">gf,</if>
            <if test="fd != null">fd,</if>
            <if test="dataTime != null">data_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="gf != null">#{gf},</if>
            <if test="fd != null">#{fd},</if>
            <if test="dataTime != null">#{dataTime},</if>
         </trim>
    </insert>

    <update id="updateTLotusXnyxnqk" parameterType="TLotusXnyxnqk">
        update t_lotus_xnyxnqk
        <trim prefix="SET" suffixOverrides=",">
            <if test="gf != null">gf = #{gf},</if>
            <if test="fd != null">fd = #{fd},</if>
            <if test="dataTime != null">data_time = #{dataTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTLotusXnyxnqkById" parameterType="Long">
        delete from t_lotus_xnyxnqk where id = #{id}
    </delete>

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

</mapper>