puzhibing
2024-05-06 cf71570fb38ad1983cd40e65fb09e259e509d2a3
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
<?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.stylefeng.guns.modular.system.dao.OpenCityMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OpenCity">
        <id column="id" property="id"/>
        <result column="cityId" property="cityId"/>
        <result column="lon" property="lon"/>
        <result column="lat" property="lat"/>
        <result column="isQualifications" property="isQualifications"/>
 
        <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="OpenCity">
        select
        id as id,
        cityId as cityId,
        lon as lon,
        lat as lat,
        isQualifications as isQualifications,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        from t_open_city where flag = 1
    </select>
 
 
    <select id="queryByCode" resultType="OpenCity">
        select
        id as id,
        cityId as cityId,
        lon as lon,
        lat as lat,
        isQualifications as isQualifications,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        from t_open_city where flag = 1 and cityId in (
          select id from t_city where englishName in
            <foreach collection="city" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        )
    </select>
</mapper>