1. 程式人生 > >mybatis請求物件包含List

mybatis請求物件包含List

<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>