<?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="cn.com.tenlion.systembase.dao.locationarea.ILocationAreaDao">

    <resultMap id="areaDTO" type="ink.wgink.module.dictionary.pojo.dtos.AreaDTO">
        <id property="areaId" column="area_id"/>
        <result property="areaParentId" column="area_parent_id"/>
        <result property="areaName" column="area_name"/>
        <result property="areaCode" column="area_code"/>
        <result property="areaCityCode" column="area_city_code"/>
        <result property="areaMergerName" column="area_merger_name"/>
        <result property="areaShortName" column="area_short_name"/>
        <result property="areaZipCode" column="area_zip_code"/>
        <result property="areaLevel" column="area_level"/>
        <result property="areaLng" column="area_lng"/>
        <result property="areaLat" column="area_lat"/>
        <result property="areaPinyin" column="area_pinyin"/>
        <result property="areaFirst" column="area_first"/>
    </resultMap>

    <select id="getLocationAll" parameterType="map" resultMap="areaDTO">
        SELECT
            t1.area_id,
            t1.area_parent_id,
            t1.area_name,
            t1.area_code,
            t1.area_city_code,
            t1.area_merger_name,
            t1.area_short_name,
            t1.area_zip_code,
            t1.area_level,
            t1.area_lng,
            t1.area_lat,
            t1.area_pinyin,
            t1.area_first
        FROM
            data_area t1
        WHERE
            t1.is_delete = 0
          AND t1.area_id = (
            SELECT
                t2.area_parent_id
            FROM
                data_area t2
            WHERE
                t2.is_delete = 0
              AND t2.area_code = '150901000000'
        )
    </select>

    <select id="getLocationArea" parameterType="map" resultMap="areaDTO">

    </select>

</mapper>