<?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.campus.activity.mapper.CheckInMapper">

    <select id="selectActivityCheckIns" resultType="com.campus.activity.vo.CheckInVO">
        SELECT c.id,
               c.user_id as userId,
               c.activity_id as activityId,
               c.check_in_time as checkInTime,
               c.check_in_method as checkInMethod,
               u.name as userName,
               u.student_id as studentId
        FROM check_in c
        LEFT JOIN user u ON c.user_id = u.id
        WHERE c.activity_id = #{activityId}
        ORDER BY c.check_in_time ASC
    </select>

</mapper>