mybatis請求物件包含List
阿新 • • 發佈:2018-12-17
<if test="mcomIdList != null and mcomIdList.size() > 0"> AND tp.MCOM_ID IN <foreach item="item" index="index" collection="mcomIdList" open="(" separator="," close=")"> #{mcomIdList[${index}],jdbcType=BIGINT} </foreach> </if>
或
<if test="mcomIdList != null and mcomIdList.size() > 0">
AND tp.MCOM_ID IN <foreach collection="mcomIdList" open="(" close=")" separator="," index="index" item="item"> #{item} </foreach>
</if>