51,408
社区成员
发帖
与我相关
我的任务
分享
比如我现在有二个map<string,string> para 长度各是100
里面放的查询字段
在数据库中有一个
select * from a where id=key and name=value
我现在是for 这个MAP一条一条去查,说要优化。
这个有什么办法优化方案吗?
再问一下,这样拼接的话,ORACLE有没有长度限制?

<select id = "selectBat">
select * from a
<where>
<foreach collection="map" item="val" index="key" separator="or">
(id = #{key} and name = #{val})
</foreach>
</where>
</select>