ibatis中sql in语句的配置

ibatis中如何配置in语句,需要迭代,不能直接用string的写法


<select id="sql_test" parameterclass="myPramBean" resultclass="myResult">
select *from tablewhere name in
<iterate property="ids" conjunction="," close=")" open="(" />
#ids[]#
</iterate>
and code=#code#
</select>
myPramBean
{
private String code;
private List ids;
...
}



eg:
<delete id="member.batchDelete" parameterClass="java.util.List">
   DELETE FROM member where id IN
   <iterate conjunction="," open="(" close=")" >
       #value[]#
   </iterate>
</delete>

你可能感兴趣的:(sql,ibatis)