1. 程式人生 > >MyBatis foreach用法

MyBatis foreach用法

public class TFollowTask {

private List<TOperator> list;//只是需要TOperator的id

getter and setter 方法;

}

mapper.xml:

<if test="followTaskOperatorNo == ''">
and follow_task_operator_no in
<foreach item="item" collection="list" open="(" separator=","
close=")">
 #{item.operatorNo}
</foreach>
</if>