<?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.netfdswl.mapper.TNetFdswlMapper">
    
    <resultMap type="TNetFdswl" id="TNetFdswlResult">
        <result property="id"    column="id"    />
        <result property="fdswl"    column="fdswl"    />
        <result property="hbzz"    column="hbzz"    />
        <result property="dataTime"    column="data_time"    />
    </resultMap>

    <sql id="selectTNetFdswlVo">
        select id, fdswl, hbzz, data_time from t_net_fdswl
    </sql>

    <select id="selectTNetFdswlList" parameterType="TNetFdswl" resultMap="TNetFdswlResult">
        <include refid="selectTNetFdswlVo"/>
        <where>  
            <if test="fdswl != null "> and fdswl = #{fdswl}</if>
            <if test="hbzz != null "> and hbzz = #{hbzz}</if>
            <if test="dataTime != null  and dataTime != ''"> and data_time = #{dataTime}</if>
        </where>
    </select>
    
    <select id="selectTNetFdswlById" parameterType="Long" resultMap="TNetFdswlResult">
        <include refid="selectTNetFdswlVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTNetFdswl" parameterType="TNetFdswl" useGeneratedKeys="true" keyProperty="id">
        insert into t_net_fdswl
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fdswl != null">fdswl,</if>
            <if test="hbzz != null">hbzz,</if>
            <if test="dataTime != null">data_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fdswl != null">#{fdswl},</if>
            <if test="hbzz != null">#{hbzz},</if>
            <if test="dataTime != null">#{dataTime},</if>
         </trim>
    </insert>

    <update id="updateTNetFdswl" parameterType="TNetFdswl">
        update t_net_fdswl
        <trim prefix="SET" suffixOverrides=",">
            <if test="fdswl != null">fdswl = #{fdswl},</if>
            <if test="hbzz != null">hbzz = #{hbzz},</if>
            <if test="dataTime != null">data_time = #{dataTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTNetFdswlById" parameterType="Long">
        delete from t_net_fdswl where id = #{id}
    </delete>

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

</mapper>