<?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.boman.web.core.mapper.IpColumnsMapper">

    <delete id="delete">
        delete from ip_columns where id = #{id}
    </delete>

    <select id="list" resultType="com.boman.domain.IpTimes">
        select * from ip_columns
    </select>

    <select id="getById" resultType="com.boman.domain.IpTimes">
        select * from ip_columns where id = #{id}
    </select>

    <insert id="save">
        insert into ip_columns
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ip != null">ip,</if>
            <if test="ipTimesId != null">ip_times_id,</if>
            <if test="columnNames != null">column_names,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            create_time, update_time
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ip != null">#{ip},</if>
            <if test="ipTimesId != null">#{ipTimesId},</if>
            <if test="columnNames != null">#{columnNames},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            sysdate(), sysdate()
        </trim>
    </insert>

    <update id="update">
        update ip_columns
        <trim prefix="SET" suffixOverrides=",">
            <if test="ip != null">ip = #{ip},</if>
            <if test="ipTimesId != null">ip_times_id = #{ipTimesId},</if>
            <if test="columnNames != null">column_names = #{columnNames},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
        </trim>
        where id = #{id}
    </update>
</mapper>