ibatis分页查询传递查询参数sqlMap.xml无法接收参数
小弟前段时间接触ibatis,在执行分页同时传递查询条件的时候。却在sqlMap对应的方法中无法获取查询条件。麻烦各位大神帮小弟看看。
废话我也不多说了;直接贴代码
1
2
3
|
RowBounds rowBounds = new RowBounds(posStart,count); String order_status = "2" ; //定义的查询参数 this .getSqlSessionTemplate().selectList(getMybatisMapperNamespace() + ".findAllOrder" ,order_status,rowBounds); |
下面是sqlMap.xml写的sql语句
1
2
3
4
5
|
< 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也无法获取。和映射的实体类也是。