C/C++教程

Oracle 批量查询 传入List

本文主要是介绍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>

完事。。。

这篇关于Oracle 批量查询 传入List的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!