期望结果:
select case
when t.seqId in ('001', '002') then
'123'
when t.seqId in ('004', '005') then
'abc'
else
'000'
end as my_data
from table_biz t
sql代码:
select case
when t.seqId in (@my_var01) then
'123'
when t.seqId in (@my_var02) then
'abc'
else
'000'
end as my_data
from table_biz t
java代码:
sql.params().set("my_var01", Arrays.asList("001", "002"));
sql.params().set("my_var02", Arrays.asList("004", "005"));
实际输出:
select case
when t.seqId in ('["001", "002"]') then
'123'
when t.seqId in ('["004", "005"]') then
'abc'
else
'000'
end as my_data
from table_biz t
请问大神,若不通过手工拼接‘001‘,‘002’这种方式怎么样能够解决我的问题?感谢~
或者不通过params的话,使用哪种方式可以解决