CREATE PROCEDURE `spAddOnlineLectureSettings` ( IN `P_AccounSettingId` INTEGER , IN `P_MeetingAccountId` INTEGER , IN `P_IsOnParticipantVideo` TINYINT , IN `P_IsOnParticipantAudio` TINYINT , IN `P_IsOnHostVideo` TINYINT , IN `P_IsOnHostAudio` TINYINT , IN `P_IsOnParticipantScreenShare` TINYINT , IN `P_IsOnHostscreenShare` TINYINT , IN `P_BatchId` INTEGER ) BEGIN IF `P_AccounSettingId` = ? THEN IF NOT EXISTS ( SELECT ? FROM `tonlinelecturemeetingsettings` WHERE `BatchId` = `P_BatchId` ) THEN INSERT INTO `vida_lms` . `tonlinelecturemeetingsettings` ( `MeetingAccountId` , `IsOnParticipantVideo` , `IsOnParticipantAudio` , `IsOnHostVideo` , `IsOnHostAudio` , `IsOnParticipantScreenShare` , `IsOnHostscreenShare` , `BatchId` ) VALUES ( `P_MeetingAccountId` , `P_IsOnParticipantVideo` , `P_IsOnParticipantAudio` , `P_IsOnHostVideo` , `P_IsOnHostAudio` , `P_IsOnParticipantScreenShare` , `P_IsOnHostscreenShare` , `P_BatchId` ) ; SELECT ? ; ELSE SELECT ? ; END IF ; ELSEIF `P_AccounSettingId` > ? THEN UPDATE `vida_lms` . `tonlinelecturemeetingsettings` SET `IsOnParticipantVideo` = `P_IsOnParticipantVideo` , `IsOnParticipantAudio` = 