日期:2014-05-17  浏览次数:20663 次

ibatis分页查询传递查询参数sqlMap.xml无法接收参数
各位哥们好:
 小弟前段时间接触ibatis,在执行分页同时传递查询条件的时候。却在sqlMap对应的方法中无法获取查询条件。麻烦各位大神帮小弟看看。
  废话我也不多说了;直接贴代码
  

RowBounds rowBounds = new RowBounds(posStart,count);
String order_status = "2";//定义的查询参数
this.getSqlSessionTemplate().selectList(getMybatisMapperNamespace() + ".findAllOrder",order_status,rowBounds);

下面是sqlMap.xml写的sql语句

<select id="findAllOrder" resultType="Order" parameterType="String">
select from lc_order_info info where      
   info.order_status=#{order_status}
  order by info.create_date desc
</select>

问题是#{order_status}一直获取不到。我改成传递对象为Map也无法获取。和映射的实体类也是。
Java iBATIS 分页

------解决方案--------------------
直接#order_status#就完事了。
------解决方案--------------------
'$order_status$'
------解决方案--------------------
select from  ?  这些写可以吗?
 你把报的错误贴出来啊。

还有建议你用mybatis吧
------解决方案--------------------
LZ你确定selectList()方法里的三个参数每个参数你传的都是正确的?