Caused by: org.postgresql.util.PSQLException: 错误: 操作符不存在: date >= character varying
今天在开发springcloud微服务框架下功能时,PG数据库一条sql报错:Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: date >= character varying 建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换. 位置:345其实框架提示的很清楚了,改动也很简单,例子如下// 原来的<i
·
今天在开发springcloud微服务框架下功能时,PG数据库一条sql报错:
Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: date >= character varying 建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换. 位置:345
其实框架提示的很清楚了,改动也很简单,例子如下
// 原来的
<if test="endDate_start != '' and endDate_end != '' and endDate_start != null and endDate_end != null ">
and b.enddate between #{endDate_start} and #{endDate_end}
</if>
// 改动后的
<if test="endDate_start != '' and endDate_end != '' and endDate_start != null and endDate_end != null ">
and b.enddate between CAST( #{endDate_start} as date) and CAST( #{endDate_end} as date)
</if>
更多推荐
已为社区贡献1条内容
所有评论(0)