<?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.buy507.mall.mapper.UmsAreaMapper">
  <resultMap id="BaseResultMap" type="com.buy507.mall.model.UmsArea">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="area_code" jdbcType="VARCHAR" property="areaCode" />
    <result column="area_name" jdbcType="VARCHAR" property="areaName" />
    <result column="level" jdbcType="INTEGER" property="level" />
    <result column="city_code" jdbcType="VARCHAR" property="cityCode" />
    <result column="center" jdbcType="VARCHAR" property="center" />
    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
  </resultMap>
  
  <select id="selectAll" resultMap="BaseResultMap">
    select *
      from ums_area
  </select>
  
  <select id="selectOneById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select *
      from ums_area
     where id = #{id}
  </select>
  
</mapper>