<?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.TbPlussAreaCityMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussAreaCity">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="parentAreaCode" jdbcType="VARCHAR" property="parentareacode" />
    <result column="areaCode" jdbcType="VARCHAR" property="areacode" />
  </resultMap>
  <sql id="Base_Column_List">
    id, type, areaName, parentAreaCode, areaCode
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_area_city
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_area_city
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAreaCity">
    insert into tb_pluss_area_city (id, type, areaName, 
      parentAreaCode, areaCode)
    values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{areaname,jdbcType=VARCHAR}, 
      #{parentareacode,jdbcType=VARCHAR}, #{areacode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAreaCity">
    insert into tb_pluss_area_city
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="parentareacode != null">
        parentAreaCode,
      </if>
      <if test="areacode != null">
        areaCode,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="parentareacode != null">
        #{parentareacode,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        #{areacode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAreaCity">
    update tb_pluss_area_city
    <set>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="parentareacode != null">
        parentAreaCode = #{parentareacode,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        areaCode = #{areacode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAreaCity">
    update tb_pluss_area_city
    set type = #{type,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      parentAreaCode = #{parentareacode,jdbcType=VARCHAR},
      areaCode = #{areacode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>