异常org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter..
来源:互联网 发布:淘宝质量好的女装店 编辑:程序博客网 时间:2024/05/18 02:42
是由于javaType和jdbcType的类型不匹配造成的.
通俗点讲,是你的SQL有问题。
出现异常的原代码
<select id="getMyNoticesNotPage" resultMap="BaseResultMap" parameterType="com.qskj.tzkw_oa_application.document.domain.DocuInfoVo2" > SELECT recv.ID, recv.PID, recv.SEND_USRID, recv.SEND_USRNAM, recv.RECV_USRID, recv.RECV_USRNAM, recv.READ_FLAG, recv.READ_TIME, recv.RECV_DEPTID FROM qs_tzkw_flw_docu_recv recv left join qs_tzkw_rms_user_info user on user.id = recv.RECV_USRID where user.id = #{userId} <if test="isLead !=null and isLead !=''"> and recv.RECV_DEPTID in ( #{depts} ) //如果depts是集合,不可以用${depts} </if> </select>
修改后代码
<select id="getMyNoticesNotPage" resultMap="BaseResultMap" parameterType="com.qskj.tzkw_oa_application.document.domain.DocuInfoVo2" > SELECT recv.ID, recv.PID, recv.SEND_USRID, recv.SEND_USRNAM, recv.RECV_USRID, recv.RECV_USRNAM, recv.READ_FLAG, recv.READ_TIME, recv.RECV_DEPTID FROM qs_tzkw_flw_docu_recv recv left join qs_tzkw_rms_user_info user on user.id = recv.RECV_USRID where user.id = #{userId} <if test="isLead !=null and isLead !=''"> and recv.RECV_DEPTID in <foreach collection="depts" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach> </if> </select>
Mybatis查询实例,sql中的in在Mybatis中怎么写–以list为查询条件
//在service中把参数放到HashMap中List<String> list = new ArrayList<String>();list.add("x");list.add("y");list.add("z");String s = "A"Date d = new Date();HashMap<String,Object> param = new HashMap<String,Object>();param.put("list",list);param.put("s",s);param.put("d",d);XXXDao.queryXXX(param);//在Mybatis的Mapper中是这么写:<select id = "queryXXX",resultType = "XXX", paramterType = "java.lang.HashMap">select * from tab where zi_duan1 = #{s} and zi_duan2 = #{d}and zi_duan3 in <foreach item="item" index="index" collection="list" open="(" separator="," close=")"> #{item} </foreach></select>
阅读全文
0 0
- 异常org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter..
- org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the
- 异常:There was no TypeHandler found for parameter id of statement
- org.apache.ibatis.executor.ExecutorException: No constructor found in com.contentsales.meta.User
- SpringBoot问题之org.apache.ibatis.executor.ExecutorException: No constructor found in...的问题
- MyBatis异常处理org.apache.ibatis.executor.ExecutorException
- org.apache.ibatis.executor.ExecutorException: Cannot get Configuration as configuration factory was
- org.apache.ibatis.executor.ExecutorException: Cannot get Configuration as configuration factory was
- mybatis 异常信息 org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- ibatis处理器异常(executor.ExecutorException)解决方法
- Spring+Mybatis 查询所有数据时发生异常:org.apache.ibatis.reflection.ReflectionException: There is no getter for
- mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param
- mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param
- mybaits异常:org.apache.ibatis.binding.BindingException: Parameter 'date' not found.
- 关于一些mybatis异常的原因:org.apache.ibatis.binding.BindingException: Parameter 'status' not found.
- mybatis映射异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xxx' in
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- robot(ride)解决存在滚动栏导致元素不可见
- 105
- Echarts数据可视化series-map地图,开发全解+完美注释
- 帝国CMS首页及其它自定义页面调用信息实现分页功能
- Hibernate学习之---条件查询
- 异常org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter..
- Echarts数据可视化series-pie饼图,开发全解+完美注释
- 最值得研究的开源框架:来自百度的71款开源项目
- DBUtils的使用
- 基础数论算法(三) 逆元和gcd的几道题
- Echarts数据可视化series-radar雷达图,开发全解+完美注释
- leetcode 202. Happy Number
- log4j实战篇
- 大话数据结构 code 第七章 08最短路径_Floyd