查询条件为日期时报’无效的列类型'错误方法解决
来源:互联网 发布:北川景子 知乎 编辑:程序博客网 时间:2024/05/21 08:54
查询条件使用到日期的时候报出
实体类里字段都是正确对应的
SQL语句形式类似为:
select tv.* from account_sel_view tv where 1=1 <if test="regstartDate!=null and regstartDate!=''">and startDate >= to_date('#{regstartDate}','yyyy-mm-dd HH24:MI:SS') </if> <if test="regendDate!=null and regendDate!=''">and startDate <= to_date('#{regendDate}','yyyy-mm-dd HH24:MI:SS') </if> <if test="allNumLow!=null and allNumLow!=''">and dealSum >= TO_NUMBER(#{allNumLow}) </if> <if test="allNumHigh!=null and allNumHigh!=''">and dealSum <= TO_NUMBER(#{allNumHigh}) </if>
以上问题是因为:
to_date的参数不可加上' '。
正确写法为:
<if test="regstartDate!=null and regstartDate!=''">and startDate >= to_date(#{regstartDate},'yyyy-mm-dd HH24:MI:SS')</if><if test="regendDate!=null and regendDate!=''">and startDate <= to_date(#{regendDate},'yyyy-mm-dd HH24:MI:SS') </if>
0 0
- 查询条件为日期时报’无效的列类型'错误方法解决
- iBatis查询时报“列名无效”无列名的错误原因及解决方法
- iBatis查询时报"列名无效"或"找不到栏位名称"无列名的错误原因及解决方法
- iBatis查询时报“列名无效”无列名的错误原因及解决方法
- iBatis多次调用同一查询语句查询时报“列名无效”无列名的错误原因及解决方法
- oracle数据库查询 无效的列类型
- 操作数据库时报“无效的列索引”错误
- oracle修改字段类型时报"要更改的列必须为空"处理方法
- oracle修改字段类型时报"要更改的列必须为空"处理方法
- oracle修改字段类型时报"要更改的列必须为空"处理方法
- 解决mysql查询,in条件参数为带逗号的字符串,查询结果错误
- 把日期作为查询条件的方法
- 关于mybatis异常“无效的列类型”问题的解决
- SSM项目无效的列类型问题的解决
- Mybatis出现:无效的列类型: 1111 错误
- Mybatis利用SQL insert标签时报错:无效的列类型
- (笔记)VB中修改字体大小、日期加减,oracle数据库中查询条件为日期类型
- mybatis 无效的列类型
- week10_2
- IOS KVC和KVO的用法及规则
- Android代码自动打开和关闭软键盘
- linux下insmod lsmod rmmod
- JVM调优总结
- 查询条件为日期时报’无效的列类型'错误方法解决
- SharedPreferences保存文件及文件读取
- ubuntu 下tftp服务器配置笔记
- Photoshop 技能167个(学完它,你可以去相馆做高级设计师了)
- Android ListView入门知识--各种Adapter配合使用
- Android Studio设置行宽、格式化断行
- leetcode--Generate Parentheses
- 设置AFNetworking的超时时间
- Aerospike-Architecture系列之数据分布