<?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.xzx.gc.user.mapper.AddressLevelMapper">
|
|
<select id="queryAllProvince" resultType="map">
|
select level_1_id as code,level_1_name as value
|
from xzx_sys_address_level_info where 1=1 group by level_1_id
|
</select>
|
|
<select id="queryAllCity" resultType="map">
|
select level_2_id as code,
|
level_2_name as value
|
from xzx_sys_address_level_info where 1=1 and level_1_id=#{pId} and level_2_name is not null group by level_2_id
|
</select>
|
|
<select id="queryAllArea" resultType="map">
|
select level_3_id as code,level_3_name as value
|
from xzx_sys_address_level_info where 1=1 and level_2_id=#{cId} and level_3_name is not null
|
</select>
|
|
<select id="queryApiArea" resultType="java.util.Map">
|
select level_3_id as id,level_3_name as name
|
from xzx_sys_address_level_info
|
where 1=1 and level_3_id is not null
|
<if test=" townModel != null and townModel.size() != 0">
|
AND level_3_id in
|
<foreach collection="townModel" index="index" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
</select>
|
|
<select id="queryAreaCityList" resultType="java.lang.String">
|
select level_2_id
|
from xzx_sys_address_level_info
|
where 1 = 1 and level_2_name = #{city}
|
limit 1
|
</select>
|
|
<select id="queryAreaTownList" resultType="java.lang.String">
|
select level_3_id
|
from xzx_sys_address_level_info
|
where 1 = 1 and level_3_name = #{city}
|
limit 1
|
</select>
|
|
<select id="queryCityNameById" resultType="java.lang.String">
|
select level_2_name
|
from xzx_sys_address_level_info
|
where level_2_id = #{cityId}
|
group by level_2_name
|
</select>
|
|
<select id="queryCityByCityId" resultType="java.lang.String">
|
select level_2_name as cityName
|
from xzx_sys_address_level_info
|
where 1 = 1 and level_2_id = #{id}
|
limit 1
|
</select>
|
|
|
|
</mapper>
|