Spring_boot中Mybatis存储过程中出现的错误及修改方法

刚交接到这个项目,也是初次使用Spring_boot框架。

前工作人员工作经历不是太深,所以,这是我修改他所留下来的问题做一次总结

【】错误一

2019-03-28 16:39:47.687 DEBUG 51096 --- [0.1-8808-exec-7] c.z.s.d.v.E.getChangerListByVersionid : ==> Preparing: SELECT * from( SELECT A .requireid, A .starttime, A .devendtime, A .publishtime, b.postname, b.postid, A .requirename, A .baname, A .tlname FROM require_info A, enum_post b WHERE A .postid::INTEGER = b.postid) ri WHERE ri.requireid ::INTEGER= ?

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='versionid', mode=IN, javaType=class java.lang.Integer, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

修改部分主要有两处:

(1)修改方案: