<?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.hc.business.mapper.LiveMapper">

    <resultMap type="com.hc.business.model.Live" id="LiveMap">
        <result property="liveId" column="live_id" jdbcType="INTEGER"/>
        <result property="liveName" column="live_name" jdbcType="VARCHAR"/>
        <result property="liveUrl" column="live_url" jdbcType="VARCHAR"/>
        <result property="liveType" column="live_type" jdbcType="INTEGER"/>
        <result property="liveLogo" column="live_logo" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        live_id,
           live_name,
           live_url,
           live_type,
           live_logo
    </sql>

    <select id="queryListByUserIDAndLiveID" resultType="com.hc.business.dto.LiveDto">
        select DISTINCT c.*,a.class_id from live_class a join user_status b on a.class_id=b.class_id
            join live c on a.live_id=c.live_id
            where a.live_id=#{liveId} and user_id=#{userId}
    </select>
</mapper>
