renren-generator自动生成的代码运行报错

提问 2 1324
yy.c
yy.c 2020-07-22
版本:renren-generator 开发环境:JDK8,IDEA
@Override public PageUtils queryPage(Map<String, Object> params) { IPage<CxConfigEntity> page = this.page( new Query<CxConfigEntity>().getPage(params), new QueryWrapper<CxConfigEntity>() ); return new PageUtils(page); } Impl方法查询报错 nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : SELECT COUNT(1) FROM ( SELECT id,key,serviceid,code,desc,datastatus,issuccess,result,verbose,failurereason,remarks FROM mock_cx_config ) TOTAL ### The error may exist in io/renren/modules/mock/dao/CxConfigDao.java (best guess) ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : SELECT COUNT(1) FROM ( SELECT id,key,serviceid,code,desc,datastatus,issuccess,result,verbose,failurereason,remarks FROM mock_cx_config ) TOTAL org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : SELECT COUNT(1) FROM ( SELECT id,key,serviceid,code,desc,datastatus,issuccess,result,verbose,failurereason,remarks FROM mock_cx_config ) TOTAL ### The error may exist in io/renren/modules/mock/dao/CxConfigDao.java (best guess) ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: Method queryTotal execution error of sql : SELECT COUNT(1) FROM ( SELECT id,key,serviceid,code,desc,datastatus,issuccess,result,verbose,failurereason,remarks FROM mock_cx_config ) TOTAL
回帖
  • 重新编译一下试试
    0 回复
  • yy.c
    yy.c (楼主)
    2020-07-24
    @Mark 找到原因了。表字段跟mysql关键字一样了。识别为关键字了
    0 回复