<?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.TbPlussMerchantAddressMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantAddress">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="VARCHAR" property="userid" />
    <result column="merchantCode" jdbcType="VARCHAR" property="merchantcode" />
    <result column="provinces" jdbcType="VARCHAR" property="provinces" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="linkPhone" jdbcType="VARCHAR" property="linkphone" />
    <result column="linkName" jdbcType="VARCHAR" property="linkname" />
    <result column="isDefault" jdbcType="VARCHAR" property="isdefault" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, merchantCode, provinces, address, linkPhone, linkName, isDefault, createDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_address
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_address
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantAddress">
    insert into tb_pluss_merchant_address (id, userId, merchantCode, 
      provinces, address, linkPhone, 
      linkName, isDefault, createDt
      )
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=VARCHAR}, #{merchantcode,jdbcType=VARCHAR}, 
      #{provinces,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{linkphone,jdbcType=VARCHAR}, 
      #{linkname,jdbcType=VARCHAR}, #{isdefault,jdbcType=VARCHAR}, #{createdt,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantAddress">
    insert into tb_pluss_merchant_address
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="merchantcode != null">
        merchantCode,
      </if>
      <if test="provinces != null">
        provinces,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="linkphone != null">
        linkPhone,
      </if>
      <if test="linkname != null">
        linkName,
      </if>
      <if test="isdefault != null">
        isDefault,
      </if>
      <if test="createdt != null">
        createDt,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="provinces != null">
        #{provinces,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="linkphone != null">
        #{linkphone,jdbcType=VARCHAR},
      </if>
      <if test="linkname != null">
        #{linkname,jdbcType=VARCHAR},
      </if>
      <if test="isdefault != null">
        #{isdefault,jdbcType=VARCHAR},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantAddress">
    update tb_pluss_merchant_address
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=VARCHAR},
      </if>
      <if test="merchantcode != null">
        merchantCode = #{merchantcode,jdbcType=VARCHAR},
      </if>
      <if test="provinces != null">
        provinces = #{provinces,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="linkphone != null">
        linkPhone = #{linkphone,jdbcType=VARCHAR},
      </if>
      <if test="linkname != null">
        linkName = #{linkname,jdbcType=VARCHAR},
      </if>
      <if test="isdefault != null">
        isDefault = #{isdefault,jdbcType=VARCHAR},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantAddress">
    update tb_pluss_merchant_address
    set userId = #{userid,jdbcType=VARCHAR},
      merchantCode = #{merchantcode,jdbcType=VARCHAR},
      provinces = #{provinces,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      linkPhone = #{linkphone,jdbcType=VARCHAR},
      linkName = #{linkname,jdbcType=VARCHAR},
      isDefault = #{isdefault,jdbcType=VARCHAR},
      createDt = #{createdt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>