I think this does what you're asking for.
You would benefit from changing your approach to the data rather than using this. In particular, the EmpId in (@EmpId)
isn't great. I added select cast(value as int) as empid into #empids from string_split(@empids,',')
into my query to split your comma separated list into a table. You could of course just do an inner join to the newly created temp table instead.
Select Empid
,Empname
,AttendanceDate
,IsAttendance
,IsHoliday
,IsSick
,IsDayOff
from EmpAttendance
where EmpId in (select EmpId from #EmpIds)
and case when charindex('NA',@AttendanceType)>0 and IsAttendance = 1 then 1
when charindex('HO',@AttendanceType)>0 and IsHoliday = 1 then 1
when charindex('SI',@AttendanceType)>0 and IsSick = 1 then 1
end = 1
All in all, this is what my code looks like for what you've provided:
Create Table EmpAttendance
(Empid int, EmpName varchar(max), AttendanceDate datetime, IsAttendance bit, IsHoliday bit, IsSick bit, IsDayOff bit)
INSERT INTO EmpAttendance
(Empid,EmpName,AttendanceDate,IsAttendance,IsHoliday,IsSick,
IsDayOff )
VALUES
(1,'AAAA', '2020-10-14',0,1,0,0)
,(2,'BBBB','2020-10-14',1,0,0,0)
,(3,'CCCC','2020-10-14',1,1,0,0)
,(4,'DDDD','2020-10-14',1,1,1,1)
,(5,'EEEE','2020-10-14',0,0,0,1)
,(6,'FFFF','2020-10-14',0,0,0,0)
declare @empIds varchar(max)
declare @Attendancetype varchar(max)
set @EmpIds = '1,2,3,4,5,6'
drop table if exists #empids;
select cast(value as int) as empid into #empids from string_split(@empids,',')
set @Attendancetype = 'NA,HO,SI'
Select Empid,Empname,AttendanceDate,IsAttendance,IsHoliday,IsSick,IsDayOff
from EmpAttendance where EmpId in (select EmpId from #EmpIds)
and case when charindex('NA',@AttendanceType)>0 and IsAttendance = 1 then 1
when charindex('HO',@AttendanceType)>0 and IsHoliday = 1 then 1
when charindex('SI',@AttendanceType)>0 and IsSick = 1 then 1
end = 1