• That means you don't filter the value of ID1

    and only filter on ID2,3,4,5,6

    Something like

    where (@IgnoreID1='Y' or @ID1 in (......))

    and (@IgnoreID2='Y' or @ID2 in (......))

    ...