傳入一個map的參數,map裏有一個tenantIds的List,在xml裏先判斷這個List的size是否大於o,然後通過foreach
構造一個in後面括號裏的元素,具體的xml如下:
<if test="tenantIds.size() > 0"> AND A.PROC_TARGET_ID IN <foreach collection="tenantIds" item="tenantId" open="(" separator="," close=")"> #{tenantId} </foreach> </if>