DAO内容:
List<ItEquipmentHeadersCustom> selectByListLocationId(@Param("locationIdList")List<Integer> locationIdList);
XML文件内容:
<select id="selectByListLocationId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM IT.IT_EQUIPMENT_HEADERS ieh
where LOCATION_ID in
<foreach item="item" index="index" open="(" separator="," close=")" collection="locationIdList">
#{item}
</foreach>
</select>
本文介绍了一种使用MyBatis通过提供一系列位置ID来批量查询设备信息的方法。具体展示了DAO接口定义及对应的XML配置文件内容,实现从IT_EQUIPMENT_HEADERS表中根据LOCATION_ID进行批量数据检索。
2123

被折叠的 条评论
为什么被折叠?



