<select id="nameByList" resultType="string">
select GROUP_CONCAT(t.name SEPARATOR'/')
from
<foreach item="item" index="index" collection="list" open="(" close=")" separator="union all">
select name
from fl_ad
where code = #{item}
</foreach>
t
</select>
效果
select GROUP_CONCAT(t.name SEPARATOR'/')
from
(
(
select name
from fl_ad
where code = 110000
union all
select name
from fl_ad
where code =110100
union all
select name
from fl_ad
where code = 110102
union all
select name
from fl_ad
where code = 440000
union all
select name
from fl_ad
where code = 440300
union all
select name
from fl_ad
where code = 440301
union all
select name
from fl_ad
where code = 440307
)
) t