liujie
2023-08-31 a0afbd1e36f74cb521c4d51b08a54f6a1fe538f2
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
<?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.TExamSiteMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TExamSite">
        <id column="id" property="id" />
        <result column="exam_site_name" property="examSiteName" />
        <result column="country" property="country" />
        <result column="state" property="state" />
        <result column="city" property="city" />
        <result column="zip_code" property="zipCode" />
        <result column="address" property="address" />
        <result column="contact_name" property="contactName" />
        <result column="contact_email" property="contactEmail" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="remove" property="remove" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, exam_site_name, country, state, city, zip_code, address, contact_name, contact_email, create_time, update_time, remove
    </sql>
    <select id="selectExamSite" resultType="com.stylefeng.guns.modular.system.model.TExamSite">
                  select t1.*,t2.name as countryName,t3.name as stateName ,t4.name as cityName from t_exam_site t1  left join t_country t2 on(t2.id=t1.country and t2.type =1) left join t_country t3 on (t3.id=t1.state and t3.type =2)
            left join t_country t4 on (t4.id=t1.city and t4.type =3)  where t1.remove=0
    </select>
 
</mapper>