To start out, if your @IDList1 and @IDList2 are comma separated strings, this query will not work at all. If they are table variables then you need to have a SELECT from the table variables for the IN to work.
Also, since you're posting this as a question on a public forum I'm going to hope that the table names and column names were changed to protect the innocent. Column names of t1_1, t1_2, etc. are pretty horrible as far as a naming convention goes.
I think that I misunderstood the question at first. Here are two possible solutions:
SELECT
T1.t1_1
FROM
T1
LEFT JOIN #t2 T2 ON
T2.t2_3 = T1.t1_3
WHERE
EXISTS
(
SELECT
ParsedValue
FROM
tf_ToTable(@IDList1)
WHERE
ParsedValue = ISNULL(T2.t2_1, 54)
) AND
EXISTS
(
SELECT
ParsedValue
FROM
tf_ToTable(@IDList2)
WHERE
ParsedValue = ISNULL(T2.t2_2, 97)
)
Or, if it's in the specific case of looking for the value in a delimited string:
SELECT
T1.t1_1
FROM
T1
LEFT JOIN #t2 T2 ON
T2.t2_3 = T1.t1_3
WHERE
',' + @IDList1 + ',' LIKE '%,' + CAST(ISNULL(T2.t2_1, 54) AS VARCHAR) + ',%' AND
',' + @IDList2 + ',' LIKE '%,' + CAST(ISNULL(T2.t2_2, 97) AS VARCHAR) + ',%'
This last query assumes that you are using a comma as your delimiter and that there is no white space in the string. You can use the REPLACE function to get rid of spaces in the string if you need to do that.