puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?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.dsh.course.mapper.OpenCityMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.course.entity.OpenCity">
        <id column="id" property="id"/>
        <result column="code" property="code"/>
        <result column="lon" property="lon"/>
        <result column="lat" property="lat"/>
        <result column="isQualifications" property="isQualifications"/>
        <result column="areaName" property="areaName"/>
        <result column="cityName" property="cityName"/>
        <result column="provinceName" property="provinceName"/>
        <result column="cityId" property="cityId"/>
        <result column="areaId" property="areaId"/>
 
        <result column="flag" property="flag"/>
        <result column="insertTime" property="insertTime"/>
        <result column="insertUser" property="insertUser"/>
        <result column="updateTime" property="updateTime"/>
        <result column="updateUser" property="updateUser"/>
    </resultMap>
 
 
 
    <select id="queryOpenCity" resultType="com.dsh.course.entity.OpenCity">
        select
        id as id,
        code as code,
        lon as lon,
        lat as lat,
        isQualifications as isQualifications,
        areaName as areaName,
        cityName as cityName,
        provinceName as provinceName,
        flag as flag,
        from t_open_city where flag = 1
    </select>
 
 
    <select id="queryByCode" resultType="com.dsh.course.entity.OpenCity">
        select
        id as id,
        code as code,
        lon as lon,
        lat as lat,
        isQualifications as isQualifications,
        areaName as areaName,
        cityName as cityName,
        provinceName as provinceName,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        from t_open_city where flag = 1 and code = #{code}
    </select>
    <select id="selectList1" resultType="com.dsh.course.entity.OpenCity">
        select
        any_value(id) as id,
            any_value( code) as code,
             any_value(lon) as lon,
            any_value(lat) as lat,
            any_value( isQualifications) as isQualifications,
            any_value( areaId) as areaId,
            any_value( areaName) as areaName,
             any_value(cityId) as cityId,
            any_value( cityName) as cityName,
            any_value( provinceId)  as provinceId,
            any_value( provinceName) as provinceName,
           any_value(  flag) as flag,
            any_value( insertTime) as insertTime,
            any_value( insertUser) as insertUser,
            any_value( updateTime) as updateTime,
            any_value( updateUser) as updateUser
         from t_open_city where flag != 3 group by areaId
    </select>
    <select id="selectListCity" resultType="com.dsh.course.entity.OpenCity">
        select t1.id,
        t1.code,
        t1.lon,
        t1.lat,
        t1.isQualifications,
        t1.areaId,
        <if test="language==1">
            t2.chineseName as areaName,
        </if>
        <if test="language==2">
            t2.englishName as areaName,
        </if>
        <if test="language==3">
            t2.indonesianName as areaName,
        </if>
        t1.cityId,
        <if test="language==1">
            t3.chineseName as cityName,
        </if>
        <if test="language==2">
            t3.englishName as cityName,
        </if>
        <if test="language==3">
            t3.indonesianName as cityName,
        </if>
        t1.provinceId,
        t1.provinceName,
        t1.flag,
        t1.insertTime,
        t1.insertUser,
        t1.updateTime,
        t1.updateUser
        from t_open_city t1
        left join t_city t2 on (t1.areaId = t2.id)
        left join t_city t3 on (t1.cityId = t3.id)
        where flag != 3 group by t1.areaId
    </select>
    <select id="selectListCity1" resultType="com.dsh.course.entity.OpenCity">
        select t1.id,
        t1.code,
        t1.lon,
        t1.lat,
        t1.isQualifications,
        t1.areaId,
        <if test="language==1">
            t2.chineseName as areaName,
        </if>
        <if test="language==2">
            t2.englishName as areaName,
        </if>
        <if test="language==3">
            t2.indonesianName as areaName,
        </if>
 
        t1.cityId,
 
        <if test="language==1">
            t3.chineseName as cityName,
        </if>
        <if test="language==2">
            t3.englishName as cityName,
        </if>
        <if test="language==3">
            t3.indonesianName as cityName,
        </if>
 
 
        t1.provinceId,
        t1.provinceName,
        t1.flag,
        t1.insertTime,
        t1.insertUser,
        t1.updateTime,
        t1.updateUser from t_open_city t1 left join t_city t2 on (t1.areaId = t2.id)  left join t_city t3 on (t1.cityId = t3.id) where flag != 3 and t1.areaId =#{code}
    </select>
</mapper>