CREATE PROCEDURE `spGetTimeTable` ( IN `P_BatchId` INTEGER , IN `P_TeacherId` INTEGER , IN `P_StudentId` INTEGER , IN `P_TimeTableId` INTEGER ) BEGIN SELECT `tt` . `Id` AS `TimeTableId` , `tt` . `BatchId` AS `BatchId` , `ifnull` ( `tol` . `Id` , ? ) AS `LectureId` , `tol` . `Id` AS `LectureId` , `ifnull` ( `tol` . `MeetingId` , ? ) AS `MeetingId` , `ifnull` ( `tol` . `MeetingPassword` , ? ) AS `MeetingPassword` , `OLS` . `IsOnParticipantVideo` AS `IsOnParticipantVideo` , `OLS` . `IsOnParticipantAudio` AS `IsOnParticipantAudio` , `OLS` . `IsOnHostVideo` AS `IsOnHostVideo` , `OLS` . `IsOnHostAudio` AS `IsOnHostAudio` , `OLS` . `IsOnParticipantScreenShare` AS `IsOnParticipantScreenShare` , `OLS` . `IsOnHostscreenShare` AS `IsOnHostscreenShare` FROM `ttimetable` `tt` INNER JOIN `tbatch` `tb` ON `tb` . `id` = `tt` . `BatchId` LEFT JOIN `tassignbatch` `AB` ON `AB` . `BatchId` = `tb` . `Id` AND `P_TeacherId` = ? LEFT JOIN `tonlinelecture` `tol` ON `tol` . `TimeTableId` = `tt` . `Id` LEFT JOIN `tonlinelecturemeetingsettings` `OLS` ON `OLS` . 