<?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.yida.data.school.classSchedule.mapper.EduClassScheduleTimeClassMapper">
    <select id="getClassScheduleInfo"
            resultType="com.yida.data.common.core.entity.classschedule.EduClassScheduleTimeClass">
        select a.*,b.week_id,b.begin_time,b.end_time
        from edu_class_schedule_time_class a left join edu_class_schedule_time b on a.schedule_time_id=b.id
        where a.schedule_id=#{classScheduleId}
        <if test="classId != null">
            and a.class_id=#{classId}
        </if>
        order by a.class_id,b.week_id,b.sort
    </select>

    <update id="cleanTimeClass">
        update edu_class_schedule_time_class
        set course_name=null,subject_id=null,teacher_id=null,teacher_name=null
        where id=#{id}
    </update>
</mapper>
