mybatis List<String> in x
boybaby 提问于:2018-06-05
0 0

在xml中如何遍历list,输出在sql中的in中

List<String> ids //

xml

select * from tb_order_pay where p_id in 
(
 ...  //怎么写
);
  • 所有回答
bluesky 回答于:2018-06-05
0 0
select * from tb_order_pay where p_id in 
<foreach item="id" collection="ids" separator="," open="(" close=")">
        #{id}
</foreach>
我来回答    mybatis List<String> in x