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. 《Unix&Linux大学教程》学习笔记5 :正则表达式

    1:Unix下正则表达式规则

  2. iOS 自动移除KVO观察者

    对NSObject写一个分类: #import <Foundation/Foundation.h> @interface NSObject (FMObserverHelper) - (vo ...

  3. java 对一个字符串进行加减乘除的运算

    记录一个小程序,里面涉及到的JAVA知识点有:字符串扫描,list删除元素的方法,泛型的使用,JAVA中的/要注意的事项.有兴趣的可以看看 package com.demo; import java. ...

  4. SNF快速开发平台3.0之-界面个性化配置+10种皮肤+7种菜单-Asp.net+MVC4.0+WebAPI+EasyUI+Knockout

    一.个性配置-首页:可以进行拖动保存配置,下次登录时就会按配置的进行加载 二.个人配置页面 7种菜单用户可自定义配置,和预览效果 10种皮肤自定义配置,和预览效果 皮肤和菜单可以随意组合-部分截图: ...

  5. struts2:OGNL表达式,遍历List、Map集合;投影的使用

    OGNL是Object-Graph Navigation Language的缩写,它是一种功能强大的表达式语言(Expression Language,简称为EL),通过它简单一致的表达式语法,可以存 ...

  6. linux每日命令(12):nl命令

    nl命令在linux系统中用来计算文件中行号.nl 可以将输出的文件内容自动的加上行号!其默认的结果与 cat -n 有点不太一样, nl 可以将行号做比较多的显示设计,包括位数与是否自动补齐 0 等 ...

  7. 基于jQuery+HTML5加入购物车代码

    基于jQuery+HTML5加入购物车代码.这是一款基于jquery+html5实现的支持累加计价的网站购物车代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div ...

  8. 跟Python打包相关的一些文章

    6 things I learned about setuptools Python 101: easy_install or how to create eggs « The Mouse Vs. T ...

  9. 【iCore4 双核心板_FPGA】例程一:GPIO输出实验——点亮LED

    实验现象: 三色LED循环点亮. 核心源代码: module led_ctrl( input clk_25m, input rst_n, output fpga_ledr, output fpga_l ...

  10. yum只下载软件不安装的两种方法

    1 通过yum自带一个工具:yumdownloader rpm -qa |grep yum-utils yum -y install yum-utils* rpm -ql yum-utils 安装好后 ...