Springboot项目,使用postgresql数据库,mybatis做持久层框架,

 <select id="select" resultMap="BaseResultMap" parameterType="com.vo.TestVo">
select
<include refid="Base_Column_List" />
from test
where state='2'
<if test="comCode != null" >
and com_code=${comCode}
</if>
</select>

comcode的形式如:'1100'

执行查询时报错:

### The error may exist in file [D:\workspaceAll\eclipseWorkspace\test\target\classes\mapper\custom\test\QcTestDao.xml]
### The error may involve com.dao.TestDao.select-Inline
### The error occurred while setting parameters
### SQL: select id, comcode,name from test where state='2' and com_code=00000000
### Cause: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286] with root cause
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286

解决方法:

 <if test="comCode != null" >
and com_code=#{comCode,jdbcType=VARCHAR}
</if>

Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer的更多相关文章

  1. Cause: org.postgresql.util.PSQLException: ERROR: cached plan must not change result type的前因后果

    首先说明一下遇到的问题: PG数据库,对其中的某张表增加一列后,应用报错,信息如下: 应用使用相关框架如下:SpringBoot.MyBatis. ### Cause: org.postgresql. ...

  2. 【hibernate postgresql】注解@TypeDef/@Enumerated/数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" is of type gender but expression is of type character varying

    数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" ...

  3. Caused by: org.postgresql.util.PSQLException: 错误: 语法错误 在 "desc" 、语法错误 在 "from" 附近

    此错误一般是由于postgres的数据库表字段名定义与关键字重名所致: 如下,创建的数据库表包含名称为“desc”的字段与倒叙查询的desc关键字冲突会导致Caused by: org.postgre ...

  4. pg数据库org.postgresql.util.PSQLException: ERROR: "xxx" is not a sequence

    问题场景 对pg数据表执行插入语句的时候,报错如下: { "timestamp": 1587012576734, "status": 500, "er ...

  5. PostgreSql问题:ERROR: operator does not exist: timestamp without time zone > character varying

    问题描述: ERROR:  operator does not exist: timestamp without time zone > character varying 解决方法: //注意 ...

  6. Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:2,栏位数:1

    执行mybaits sql <delete id="delete4BatchesByLineCi" parameterType="java.util.List&qu ...

  7. Postgresql客户端不能远程连接数据库服务器 org.postgresql.util.PSQLException:

    Postgresql安装完成之后,默认情况下是不允许远程客户端直接连接的,并且默认的监听配置文件里边,监听的服务器地址是127.0.0.1即:localhost 报如下错误: org.postgres ...

  8. org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2。

    org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2. 今天在写完SQL进行查询的时候,后台一直报错显示上面的信息.看错误完全不知道原因,就重新检 ...

  9. org.postgresql.util.PSQLException:致命:抱歉,已经有太多客户了(org.postgresql.util.PSQLException: FATAL: sorry, too many clients already)

    我正在尝试连接到Postgresql数据库,我收到以下错误: 错误:org.postgresql.util. PSQLException:致命:抱歉,已经有太多客户 错误是什么意思,我该如何解决? 我 ...

随机推荐

  1. C语言判断文件夹或者文件是否存在的方法【转】

     C语言判断文件夹或者文件是否存在的方法   方法一:access函数判断文件夹或者文件是否存在 函数原型: int access(const char *filename, int mode); 所 ...

  2. 在Asp.Net中操作PDF – iTextSharp - 操作图片

    iTextSharp支持所有主流的图片格式,比如:jpg, tif, gif, bmp, png和wmf.在iTextSharp中使用Image.GetInstance()方法创建图片有很多种方式,或 ...

  3. blinn-phong高光反向穿透问题

    blinn-phong高光: H=normalize(V+L);
 specular=pow(saturate(dot(N,H)),shiness); 会遇到如下问题: 图中光源在surface背面, ...

  4. c 链表之 快慢指针 查找循环节点

    参考:http://blog.csdn.net/wenqian1991/article/details/17452715 上面分析了 根据这张图 推倒出 数学公式. 刚接触 不能一下弄明白.下面结合上 ...

  5. Atitit 数据库 标准库  sdk 函数库 编程语言 mysql oracle  attilax总结

    Atitit 数据库 标准库  sdk 函数库 编程语言 mysql oracle  attilax总结 1.1. 常见的编程语言以及数据库 sql内部函数库标准化库一般有以下api1 1.2. 各个 ...

  6. Asp.Net 简繁转换

    帮助类 /// <summary> /// 中文字符工具类 /// </summary> public static class ChineseStringUtility { ...

  7. Selenium Web 自动化 - 项目实战(二)

    Selenium Web 自动化 - 项目实战(二) 2016-08-08 什么是数据驱动?简答的理解就是测试数据决定了测试结果,这就是所谓数据驱动.数据驱动包含了数据,他就是测试数据,在自动化领域里 ...

  8. 《软件测试自动化之道》读书笔记 之 基于反射的UI测试

    <软件测试自动化之道>读书笔记 之 基于反射的UI测试 2014-09-24 测试自动化程序的任务待测程序测试程序  启动待测程序  设置窗体的属性  获取窗体的属性  设置控件的属性  ...

  9. TCP/IP四层模型讲解笔记

    本文转载自:http://www.vuln.cn/2041 OSI七层模型   表示层:用来解码不同的格式为机器语言,以及其他功能. 会话层:判断是否需要网络传输. 传输层:识别端口来指定服务器,如指 ...

  10. 去除partner页面消息 自动添加关注者的功能

    某些公司希望在partner页面说些partner的坏话,可是odoo居然自动添加了partner关注,这就尴尬了.... 如果恰搭建了邮件服务器,很有可能就自动发到了客户邮箱里,等着炸锅吧.... ...