SELECT DISTINCTROW `a` . `UserId` , `a0` . `UserId` AS `FapId` , `a0` . `ComplianceType` , `a` . `ScheduledId` AS `ScheduleId` FROM `AuditSchedule_Application` AS `a` INNER JOIN `Audit_Schedule` AS `a0` ON `a` . `AuditId` = `a0` . `Id` WHERE ( ( ( ( `a` . `IsActive` AND NOT ( `a` . `IsDeleted` ) ) AND ( `a` . `IsStatus` > ? ) ) AND `a0` . `IsActive` ) AND NOT ( `a0` . `IsDeleted` ) ) AND ( ( ( ( `a0` . `Createdby` = ? ) OR ( `a` . `UserId` = ? ) ) OR ( `a` . `EA_Id` = ? ) ) OR ( `a` . `IA_Id` = ? ) ) 