开发者社区> 问答> 正文

java mybatie问题,再传map参数里面是list的时候,总是报传进去的参数为空:配置报错 

mybatise  xml配置

<select id="querybusisumucorplist"  resultType="BseBusiSum1" parameterType="Map">

            SELECT ORGNO    

            FROM   bsatraninfo

            WHERE  ORGNO in

            <foreach collection="orglist" item="id" index="index" open="(" separator="," close=")">

                #{id}

            </foreach>

    </select>

调用

       orglist.add("22222");

        params.put("orglist", orglist);

        logger.info(params);

        bsebusisumucorplist = bseService.querybusisumucorplist(params);

报错### Error querying count.  Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型

### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型

展开
收起
kun坤 2020-06-04 10:24:36 784 0
1 条回答
写回答
取消 提交回答
  • 你把Map换成map试试?######

    parameterType="map“
    其实你可以直接传list,也很方便 ###### 在mybatis里的configuration里面加上这段试试呢

    <settings>
            <setting name="jdbcTypeForNull" value="NULL" />
        </settings>
    ######http://my.oschina.net/u/2312022/blog/647341###### 或许你可以试试去掉“  parameterType="Map"” , 如果没理解错,是调用传递对象里面的get方法
    2020-06-04 11:21:32
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载