xiaoyong931011
2021-07-21 1d03a9e224dc0ce11d47bede74da9db2189d663c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?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>