学无先后,达者为师

网站首页 编程语言 正文

springframework.jdbc.BadSqlGrammarException:

作者:步行cgn 更新时间: 2023-12-09 编程语言

今天遇到这个错误,发现在controller中将 pageSize多加了一个分号,导致错误。

错误:map.put("pageSize","pageSize");多加了一个分号,而导致出现错误。

@RequestMapping("/workbench/clue/queryCountOfClueByCondition.do")
    public @ResponseBody Object queryCountOfClueByCondition(int pageNo, int pageSize,Clue clue,HttpSession session){
        User user =(User) session.getAttribute(Contants.SESSION_USER);
        //封装参数
        clue.setId(UUIDUtils.getUUID());
        clue.setCreateBy(user.getId());
        clue.setCreateTime(DateUtils.formatDateTime(new Date()));

        Map<String, Object> map = new HashMap<>();
        map.put("beginNo",(pageNo-1)*pageSize);
        map.put("pageSize",pageSize);
        map.put("clue",clue);
        //调用service
        List<Clue> clueList = clueService.queryClueByConditionForPage(map);
        int totalRows = clueService.queryCountOfClueByCondition(map);

        //根据查询结果,生成响应信息
        Map<String, Object> retMap = new HashMap<>();
        retMap.put("clueList",clueList);
        retMap.put("totalRows",totalRows);

        return retMap;

原文链接:https://blog.csdn.net/weixin_51288065/article/details/132050840

  • 上一篇:没有了
  • 下一篇:没有了
栏目分类
最近更新