mybaits in

mybatis中的in:

<select id="getByInventoryIds" resultMap="beanMap">
        SELECT * FROM <include refid="t_onsale_resource" />
        <where>
            inventory_id in
            <foreach collection="inventoryIds" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </where>
    </select>

dao层:

    List<OnSaleResource> getByInventoryIds(@Param("inventoryIds") List<Long> inventoryIds);

 

posted @ 2016-02-25 14:22  园芳宝贝  阅读(335)  评论(0编辑  收藏  举报