很长时间没有使用ibatis,刚上手易激动写了一个in语句,结果调试了半天没搞定
究其原因原来是
<select id="ItemDao.queryItemByIds" resultMap="itemResult">
select * from t_item where
id in
<isNotNull property="id">
<iterate property="id" conjunction="," open="(" close=")">
#idlist[]#
</iterate>
</isNotNull>
order by create_date DESC limit #pageSize# offset #startRow#
</select>
在这个里边property其实并非上面配置的对象的property,而是你传进来的para对象的名称
本文通过一个具体的例子详细解析了在使用IBATIS框架时如何正确地编写IN语句,并强调了property属性在传入参数时的实际含义。
1186

被折叠的 条评论
为什么被折叠?



