<?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.yonge.cooleshow.biz.dal.dao.ImNetworkHereWhiteDao">
    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.ImNetworkHereWhite">
        <id column="id_" jdbcType="INTEGER" property="id"/>
        <result column="course_schedule_id_" jdbcType="INTEGER" property="courseScheduleId"/>
        <result column="name_" jdbcType="VARCHAR" property="name"/>
        <result column="limit_" jdbcType="INTEGER" property="limit"/>
        <result column="team_id_" jdbcType="INTEGER" property="teamId"/>
        <result column="admin_id_" jdbcType="INTEGER" property="adminId"/>
        <result column="mode_" jdbcType="VARCHAR" property="mode"/>
        <result column="template_" jdbcType="VARCHAR" property="template"/>
        <result column="region_" jdbcType="VARCHAR" property="region"/>
        <result column="room_token_" jdbcType="VARCHAR" property="roomToken"/>
        <result column="uuid_" jdbcType="VARCHAR" property="uuid"/>
        <result column="updated_at_" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="created_at_" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="random_numeric20_" jdbcType="TIMESTAMP" property="randomNumeric20"/>
        <result column="random_numeric22_" jdbcType="TIMESTAMP" property="randomNumeric22"/>
    </resultMap>

    <sql id="Base_Column_List">
        id_ , course_schedule_id_, name_, limit_, team_id_, admin_id_, mode_,
            template_, region_, room_token_, uuid_, updated_at_, created_at_,random_numeric20_,random_numeric22_
    </sql>
    <select id="findByCourseScheduleId" resultMap="BaseResultMap">
        SELECT * FROM im_network_here_white WHERE course_schedule_id_ = #{courseScheduleId} LIMIT 1
    </select>
    <select id="findByCourseScheduleIdLock" resultMap="BaseResultMap">
        SELECT * FROM im_network_here_white WHERE course_schedule_id_ = #{courseScheduleId} LIMIT 1 FOR UPDATE
    </select>
</mapper>
