直接上代碼
- 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這個屬性 其他註釋明天研究下