xml映射文件传进的参数应该怎么进行运算

比如我要对查询的数据进行分页查询;初步思路写法是limit (#{pageno}-1)*#{pagesize},#{pagesize};其中pageno是第几页,pagesize是一页中展示的条数,用这种方法实现分页,但是我发现这种运算的写法会报,如下:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(2-1)*2,2' at line 45
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(2-1)*2,2' at line 45] with root cause
请问该如何解决这个问题,并且还能实现分页效果(传回来的参数pageno必须得是第几页这个,而非具体条数这种情况)。
在此感谢了!

SQL limit 后面语法上不能加上表达式,你可以把计算的逻辑放到代码中,然后把计算后的结果传到 limit 后的参数中

mybatis有分页插件,不需要你自己去写这些玩意