Możesz napisać where
klauzula jako:
where (case when (:stateCode = '') then (1)
when (:stateCode != '') and (vw.state_cd in (:stateCode)) then 1
else 0)
end) = 1;
Alternatywnie usuń case
całkowicie:
where (:stateCode = '') or
((:stateCode != '') and vw.state_cd in (:stateCode));
Albo jeszcze lepiej:
where (:stateCode = '') or vw.state_cd in (:stateCode)