I have a question about using foreach tag.
I am sending a list of VOs which has a variety of values for each VO.
All those values for where clause and I want to run select query with the list of VOs.
Will it be possible?
Here is my query in XML.
VO has total 310 different set of testId, testName, realId, realTypevalues.
Thank you in advance.
<select id="sampleSelectQuery" parameterType="java.util.List" resultType="mybatis.test.vo.TestVO">
<foreach collection="list" item="item" separator=";">
<![CDATA[
select
split_part(a.id, '_', 1) as "test1",
CAST (split_part(a.id, '_', 2) as INTEGER) as "test2",
split_part(a.id, '_', 3) as "test3",
split_part(a.id, '_', 4) as "test4",
a.table_name as "test5"
from
test_table as a
where
a.test_id = #{item.testId}
and
a.test_name = #{item.testName}
and
a.real_d = #{item.realId}
and
a.real_type = #{item.realType}
and
(a.tested is not null
OR
a.testValue != ':::::')
]]>
</foreach>
</select>