Oracle 批量查詢 傳入List

dao層代碼:

List<String> sselectCountryAndNamecn(@Param("list") List<Map<String,String>>)

 

xml文件對應的代碼:

<select id = "sselectCountryAndNamecn" resultType="java.lang.String">

select name_cn from **** where
<foreach collection="list" index="index" item="item" open="(" close=")" separator="or">
    ( country = #{item.country} and name_cn = #{item.nameCn})
</foreach>

</select>

完事。。。

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