<?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.chaozhanggui.dao.system.dao.TbPlussUserAddressMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserAddress">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="areaCode" jdbcType="VARCHAR" property="areacode" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="isDefault" jdbcType="INTEGER" property="isdefault" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="defFlag" jdbcType="VARCHAR" property="defflag" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name, phone, address, areaCode, areaName, isDefault, createTime, userId, type, 
    defFlag
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_address
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_address
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAddress">
    insert into tb_pluss_user_address (id, name, phone, 
      address, areaCode, areaName, 
      isDefault, createTime, userId, 
      type, defFlag)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{address,jdbcType=VARCHAR}, #{areacode,jdbcType=VARCHAR}, #{areaname,jdbcType=VARCHAR}, 
      #{isdefault,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{userid,jdbcType=INTEGER}, 
      #{type,jdbcType=INTEGER}, #{defflag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAddress">
    insert into tb_pluss_user_address
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="areacode != null">
        areaCode,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="isdefault != null">
        isDefault,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="defflag != null">
        defFlag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="isdefault != null">
        #{isdefault,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="defflag != null">
        #{defflag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAddress">
    update tb_pluss_user_address
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        areaCode = #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="isdefault != null">
        isDefault = #{isdefault,jdbcType=INTEGER},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="defflag != null">
        defFlag = #{defflag,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAddress">
    update tb_pluss_user_address
    set name = #{name,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      areaCode = #{areacode,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      isDefault = #{isdefault,jdbcType=INTEGER},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      userId = #{userid,jdbcType=INTEGER},
      type = #{type,jdbcType=INTEGER},
      defFlag = #{defflag,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>