更多sqlMap的数据配置,以及sqlmap元素的说明 可见官网:http://ibatis.apache.org/docs/dotnet/datamapper/
如下:
<isNotEmpty prepend="and" property="vstatus">
T.VSTATUS in<iterate conjunction="," open="(" close=")" property="vstatus">
#vstatus[]#
</iterate>
</isNotEmpty>
其中,iterate 元素官网的解释是(http://ibatis.apache.org/docs/dotnet/datamapper/ch03s09.html#id386679):
It is very important to include the square brackets[] at the end of the List property name when using the Iterate element. These brackets distinguish this object as an List to keep the parser from simply outputting the List as a string.
意思大概是:
List 属性名后面的 方括号是必要的,这样 可以防止 解析器 把list 对象当作 简单的 String类型处理。