Mybatis根据List批量查询List结果

xiaoxiao2021-02-27  276

一、mapper接口

/** * 根据剧典id list查询剧典 */ public List<Drama> selectByIds(@Param("dramaIds")List<Long> dramaIds);

二、mapper.xml文件

<!-- 根据剧典id list查询剧典 --> <select id="selectByIds" resultMap="DramaImageResultMap"> select * from drama where drama_id in <foreach collection="dramaIds" item="dramaId" open="(" close=")" separator=","> #{dramaId} </foreach> </select>
转载请注明原文地址: https://www.6miu.com/read-10959.html

最新回复(0)