在查看好友动态的需求里用到过
<select id="selectConcernDynamicByPage" parameterType="DynamicListOption" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> <if test="userIds !=null"> AND user_id in <foreach collection="userIds" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> </select>
DynamicListoption里写了
private List<Long> userIds;