MyBatis-plus报错:Error evaluating expression ‘ew.sqlSegment != null

报错信息

Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null '. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: not support this column !]

问题重现

 QueryWrapper ew = new QueryWrapper();
 ew.likeRight(StringUtils.isNotEmpty(projectCardNumber),projectCardNumber);
 List<FinishedProductInStockVO> list = baseMapper.selectFinishedProductInStockVO(ew,
         searchParam, startInTime, endInTime);

报错原因

ew.likeRight(boolean condition,object cloumn,object value)
参数传递有误
少传一个参数!!

更正

ew.likeRight(StringUtils.isNotEmpty(projectCardNumber), "t2.project_card_number", projectCardNumber);

问题报错:ew.sqlSegment != null 很容易误解为ew的传参问题,但确实也是它的问题,可以通过debug查看ew的expression 中的normal 属性是否被赋值来查看条件是否生效

全部评论

相关推荐

25届的可以参加26届秋招吗?身为25届的,现在辞职很尴尬,经验不足一年(正式工)又正在秋招,现在找工作有点尬住了
程序员小白条:哪有一年啊,才几个月吧,参加26秋招不存在的,社招了啊,你正式工都交过社保了
点赞 评论 收藏
分享
代码不跑我跑_bug...:北大杀完9✌杀,9✌杀完鼠鼠杀
你最希望上岸的公司是?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务