Oracle 批量查询 传入List 返回List

直接上代码

  • Dao层
List<DataMastDO> selectBrachNo(@Param("mastDos")List<DataMastDO> mastDos);
  • Mapper接口
<select id="selectBrachNo" resultType="com.bootdo.system.domain.DataMastDO">
		select * from ORW_DATA_MAST
		where
		 <foreach collection="mastDos" index="index" item="val" separator="or" open="(" close=")">
			 (orw_modelid = #{val.orwModelid} and orw_seqno=#{val.orwSeqno})
		 </foreach>

	</select>

注意:Dao中的 @Param(“mastDos”) 不写会抛异常,找不到 mastDos这个属性 其他注释明天研究下

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章