<?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.sckw.transport.dao.KwtWaybillOrderAddressMapper">
    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrder">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="w_order_id" jdbcType="BIGINT" property="wOrderId"/>
        <result column="address_type" jdbcType="VARCHAR" property="AddressType"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="type" jdbcType="BIGINT" property="type"/>
        <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
        <result column="phone" jdbcType="VARCHAR" property="phone"/>
        <result column="city_code" jdbcType="INTEGER" property="cityCode"/>
        <result column="city_name" jdbcType="VARCHAR" property="cityName"/>
        <result column="detail_address" jdbcType="VARCHAR" property="detailAddress"/>
        <result column="lat" jdbcType="VARCHAR" property="lat"/>
        <result column="lng" jdbcType="VARCHAR" property="lng"/>
        <result column="fence" jdbcType="VARCHAR" property="fence"/>
        <result column="entry_type" jdbcType="INTEGER" property="entryType"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
    </resultMap>
    <sql id="Base_Column_List">
        id
        , w_order_id, address_type, `name`, `type`, `contacts`,`phone`,`city_code`
        , city_name, detail_address, lat, lng, fence, entry_type, remark, status
        , create_by, create_time, update_by, update_time, del_flag

    </sql>

    <insert id="insert1" parameterType="com.sckw.transport.model.KwtWaybillOrderAddress">
        insert into kwt_waybill_order_address
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                `id`,
            </if>
            <if test="wOrderId != null">
                `w_order_id`,
            </if>
            <if test="addressType != null">
                `address_type`,
            </if>
            <if test="name != null">
                `name`,
            </if>
            <if test="type != null">
                `type`,
            </if>
            <if test="contacts != null">
                `contacts`,
            </if>
            <if test="phone != null">
                `phone`,
            </if>
            <if test="cityCode != null">
                `city_code`,
            </if>
            <if test="cityName != null">
                `city_name`,
            </if>
            <if test="detailAddress != null">
                `detail_address`,
            </if>
            <if test="lat != null">
                `lat`,
            </if>
            <if test="lng != null">
                `lng`,
            </if>
            <if test="fence != null">
                `fence`,
            </if>
            <if test="entryType != null">
                `entry_type`,
            </if>
            <if test="remark != null">
                `remark`,
            </if>
            <if test="status != null">
                `status`,
            </if>
            <if test="createBy != null">
                `create_by`,
            </if>
            <if test="createTime != null">
                `create_time`,
            </if>
            <if test="updateBy != null">
                `update_by`,
            </if>
            <if test="updateTime != null">
                `update_time`,
            </if>
            <if test="delFlag != null">
                `del_flag`,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="wOrderId != null">
                #{wOrderId,jdbcType=BIGINT},
            </if>
            <if test="addressType != null">
                #{addressType,jdbcType=INTEGER},
            </if>
            <if test="name != null">
                #{name,jdbcType=VARCHAR},
            </if>
            <if test="type != null">
                #{type,jdbcType=BIGINT},
            </if>
            <if test="contacts != null">
                #{contacts,jdbcType=VARCHAR},
            </if>
            <if test="phone != null">
                #{phone,jdbcType=VARCHAR},
            </if>
            <if test="cityCode != null">
                #{cityCode,jdbcType=INTEGER},
            </if>
            <if test="cityName != null">
                #{cityName,jdbcType=VARCHAR},
            </if>
            <if test="detailAddress != null">
                #{detailAddress,jdbcType=VARCHAR},
            </if>
            <if test="lat != null">
                #{lat,jdbcType=VARCHAR},
            </if>
            <if test="lng != null">
                #{lng,jdbcType=VARCHAR},
            </if>
            <if test="fence != null">
                #{fence,jdbcType=VARCHAR},
            </if>
            <if test="entryType != null">
                #{entryType,jdbcType=INTEGER},
            </if>
            <if test="remark != null">
                #{remark,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                #{status,jdbcType=INTEGER},
            </if>
            <if test="createBy != null">
                #{createBy,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                #{updateBy,jdbcType=BIGINT},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
</mapper>