<?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.TbPlussNewAreaMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussNewArea">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="parentId" jdbcType="BIGINT" property="parentid" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="shortName" jdbcType="VARCHAR" property="shortname" />
    <result column="longitude" jdbcType="REAL" property="longitude" />
    <result column="latitude" jdbcType="REAL" property="latitude" />
    <result column="level" jdbcType="TINYINT" property="level" />
    <result column="sort" jdbcType="TINYINT" property="sort" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="open" jdbcType="TINYINT" property="open" />
  </resultMap>
  <sql id="Base_Column_List">
    id, parentId, name, shortName, longitude, latitude, level, sort, status, open
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_new_area
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from tb_pluss_new_area
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussNewArea">
    insert into tb_pluss_new_area (id, parentId, name, 
      shortName, longitude, latitude, 
      level, sort, status, 
      open)
    values (#{id,jdbcType=BIGINT}, #{parentid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, 
      #{shortname,jdbcType=VARCHAR}, #{longitude,jdbcType=REAL}, #{latitude,jdbcType=REAL}, 
      #{level,jdbcType=TINYINT}, #{sort,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, 
      #{open,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussNewArea">
    insert into tb_pluss_new_area
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="parentid != null">
        parentId,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="shortname != null">
        shortName,
      </if>
      <if test="longitude != null">
        longitude,
      </if>
      <if test="latitude != null">
        latitude,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="sort != null">
        sort,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="open != null">
        open,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="parentid != null">
        #{parentid,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="shortname != null">
        #{shortname,jdbcType=VARCHAR},
      </if>
      <if test="longitude != null">
        #{longitude,jdbcType=REAL},
      </if>
      <if test="latitude != null">
        #{latitude,jdbcType=REAL},
      </if>
      <if test="level != null">
        #{level,jdbcType=TINYINT},
      </if>
      <if test="sort != null">
        #{sort,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="open != null">
        #{open,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussNewArea">
    update tb_pluss_new_area
    <set>
      <if test="parentid != null">
        parentId = #{parentid,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="shortname != null">
        shortName = #{shortname,jdbcType=VARCHAR},
      </if>
      <if test="longitude != null">
        longitude = #{longitude,jdbcType=REAL},
      </if>
      <if test="latitude != null">
        latitude = #{latitude,jdbcType=REAL},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=TINYINT},
      </if>
      <if test="sort != null">
        sort = #{sort,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=TINYINT},
      </if>
      <if test="open != null">
        open = #{open,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussNewArea">
    update tb_pluss_new_area
    set parentId = #{parentid,jdbcType=BIGINT},
      name = #{name,jdbcType=VARCHAR},
      shortName = #{shortname,jdbcType=VARCHAR},
      longitude = #{longitude,jdbcType=REAL},
      latitude = #{latitude,jdbcType=REAL},
      level = #{level,jdbcType=TINYINT},
      sort = #{sort,jdbcType=TINYINT},
      status = #{status,jdbcType=TINYINT},
      open = #{open,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>