Open GoogleCodeExporter opened 9 years ago
mapper的配置
<sql id="OrderForm.findPage.where">
<where>
<!-- 其他干扰的业务部分去除 -->
<foreach collection="stateList" item="stateItem" open="AND ( " separator="OR" close=" )">
order_form.state = #{stateItem}
</foreach>
</where>
</sql>
Original comment by longlong...@gmail.com
on 17 May 2011 at 9:57
List list = sqlSession.selectList(statementName, filters, new
RowBounds(page.getFirstResult(),page.getPageSize()));
List list = sqlSession.selectList(statementName, filters);
前面的代码相同,在分页的时候如果使用上面第一个方法,��
�出现所描述问题,如果使用第二个方法不分页,则没有问题
Original comment by longlong...@gmail.com
on 17 May 2011 at 11:32
补充,期望结果:
在findPage的时候发出如下两条sql语句
SELECT
count(*)
FROM
order_form as order_form
WHERE
(
order_form.state = '已提交'
OR order_form.state = '已付款'
OR order_form.state = '已申请作废'
)
SELECT
*(为方便查看,隐去了字段)
FROM
order_form as order_form
WHERE
(
order_form.state = '已提交'
OR order_form.state = '已付款'
OR order_form.state = '已申请作废'
)
Original comment by longlong...@gmail.com
on 17 May 2011 at 1:06
现在也遇到这个问题,问题解决没得?
Original comment by HanQZh...@gmail.com
on 12 Aug 2011 at 9:47
现在用个变通的方法可以解决这个问题:
把#{item} 改为${item},不预编译这个参数,直接设置进去。
sql语句以前是:columnName=?;
现在变成了columnName=传的值。
Original comment by HanQZh...@gmail.com
on 13 Aug 2011 at 2:33
Original issue reported on code.google.com by
longlong...@gmail.com
on 17 May 2011 at 9:54