kongzy
2023-09-22 3124f3a5b7f45d043b228829b6b3a2e541b31574
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
<?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.nms.swspkmas_standalone.mapper.ExamineeMapper">
 
    <resultMap id="ExamineeMap" type="com.nms.swspkmas_standalone.entity.Examinee">
        <id column="id" property="id" />
        <association property="examRoom" column="{roomId = room_id}" select="selectExamRoomById">
        </association>
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, id_number,sex,phone,seatnumber,icon_path,icon_name,create_time,update_time
    </sql>
    
    <select id="examineeList" resultType="com.nms.swspkmas_standalone.entity.Examinee">
        select
            <include refid="Base_Column_List"/>
        from examinee
        <where>
            <if test="name!=null and name!=''">
                and name=#{name}
            </if>
        </where>
        order by create_time desc
    </select>
 
    <select id="examineeCount" resultType="long">
        select count(1) from examinee
        <where>
            <if test="name!=null and name!=''">
                and name=#{name}
            </if>
        </where>
    </select>
 
    <select id="selectExamRoomById" resultType="com.nms.swspkmas_standalone.entity.ExamRoom">
        select id, area,exam_site, exam_name,train_center from exam_room where id=#{roomId}
    </select>
 
</mapper>