Ibatis中容易让人混淆的property

很长时间没有使用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对象的名称

猜你喜欢

转载自tzwzero-163-com.iteye.com/blog/1550540