<!--传递参数为字符串approveStatus =“通过,不通过” item为遍历后的参数--><iftest="approveStatus != null and approveStatus != ''">
and i.approve_status in
<foreachitem="status"collection="approveStatus.split(',')"open="("separator=","close=")">
#{status}
</foreach></if>
<!--传递参数为集合approveStatusList,集合中包含对象user ,approveStatusList={user1,user2 } --><iftest="approveStatusList != null and approveStatusList.size > 0">
and operate_user in
<foreachcollection="approveStatusList"open="("close=")"separator=","item="user"index="index">
#{user.userName}
</foreach></if>
<!--传递参数为数组approveStatus =[通过,不通过] 此时collection必须为array item为传递的数组参数,且参数名要保持一致--><iftest="approveStatus != null and approveStatus != ''">
and i.approve_status in
<foreachitem="approveStatus"collection="array"open="("separator=","close=")">
#{approveStatus}
</foreach></if>
mybatis传入字符串,集合,数组并遍历<!--传递参数为字符串approveStatus =“通过,不通过” item为遍历后的参数--><if test="approveStatus != null and approveStatus!=''"> and i.approve_status IN <foreach item="sta...