异常org.apache.ibatis.executor.ExecutorException: There was no TypeHandler found for parameter..

是由于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 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>
    >  
  </select>

Mybatis查询实例,sql中的in在Mybatis中怎么写–以list为查询条件

//在service中把参数放到HashMap中
List list = new ArrayList();
list.add("x");
list.add("y");
list.add("z");


String s = "A"


Date d = new Date();


HashMap param = new HashMap();


param.put("list",list);
param.put("s",s);
param.put("d",d);


XXXDao.queryXXX(param);


//在Mybatis的Mapper中是这么写:

你可能感兴趣的:(异常)