快捷导航

mybatis在使用pagehelper开发结果时报错

//mapper.xml


        select * from wx1 t1
        
            and    t1.id    =#{id}
            and    t1.type =#{type}
            and    t1.value =#{value}
        
        order by id

//在Controller中
wx1EntityDao.queryWx1(wx1Entity);有结果使用PageHelper.startPage(currentPage, pageSize);PageInfo pageInfo = new PageInfo(wx1EntityMapper.queryWx1(wx1Entity));时报错### SQL: SELECT * FROM (  SELECT TMP_PAGE.*, ROWNUM ROW_ID FROM ( select * from wx1 t1          WHERE  t1.type =?             and t1.value =?          order by id ) TMP_PAGE) WHERE ROW_ID  ?### Cause: java.sql.SQLSyntaxErrorException: Every derived table must have its own alias; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Every derived table must have its own alias] with root causejava.sql.SQLSyntaxErrorException: Every derived table must have its own alias

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

目测试是你没有配置mybaits的别名配置文件,类似下面这段代码
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP