mybatis的xml中集合用法

来源:互联网 发布:淘宝房产司法拍卖网 编辑:程序博客网 时间:2024/06/17 23:27

mybatis 集合


select * from t_user where 1 = 1 

<if test="null != userNameList anduserNameList .size > 0">

  and user_name in

<foreach collection="userNameList " item="userName" open="(" separator=","  close=")">
 #{userName}
</foreach>
</if>