No operator matches the given name and argument types

No operator matches the given name and argument types

前置环境:

  • postgresql数据库
  • Mybatis-plus ORM 框架

报错具体信息:

### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = character varying 建议:No operator matches the given name and argument types. You might need to add explicit type casts. 位置:215 ### The error may exist in com/slb/support/outbound/db/mapper/MenuMapper.java (best guess) ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: SELECT id,system_code,name,service_key,path,http_method,api_path,"level",pid,sort,type,kind,permission,icon,label,flag,del_flag,create_time,update_time,create_by,update_by FROM menu WHERE del_flag=0 AND (pid = ? AND type = ?) ### Cause: org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = character varying 建议:No operator matches the given name and argument types. You might need to add explicit type casts. 位置:215 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint = character varying 建议:No operator matches the given name and argument types. You might need to add explicit type casts. 位置:215

解决办法:

  • 传入参数类型是string, 实际参数类型是long,将参数转换为long类型即可。

在这里插入图片描述

问题原因:

  • 传入参数类型和实体类当中定义的参数类型不一致导致的报错,参数类型转化即可。

参考文档:

  • https://blog.csdn.net/qq_33833327/article/details/107693932
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值