spring boot 加 Mybatis批量查询

使用mybatis中的动态sql就可以实现

collection:参数类型(数组:array,集合:list)
item:参数名

<select id="selectAllId" parameterType="String" resultMap="ShmOldCommodityResult">
        <include refid="selectShmOldCommodityVo"/>
        where com_id in
        <foreach collection="array" item="comId" open="(" close=")" separator=",">
            #{comId}
        </foreach>
    </select>

你可能感兴趣的:(java,spring,boot,mybatis,mybatis,java,mysql)