mybatis报错:java.sql.SQLException: 无效的列类型: 1111

console报错:

Could not set parameters for mapping: ParameterMapping{property='per001', mode=IN, javaType=class java.lang.Object, jdbcType=null,

java.sql.SQLException: 无效的列类型: 1111

问题原因:

1:parameterType="hashmap"  参数map中的per001 为空导致报错,检查传参的map对象;

2:配置文件sql的参数不规范

<select id="select_repair_list" parameterType="hashmap" resultMap="car">
     SELECT car_num  from car where car_id = #{per001}
 </select>

sql要改成:

 SELECT car_num from car where car_id = #{per001,jdbcType=VARCHAR}

(注:如果id是数值  那么id = #{per001,jdbcType=NUMERIC})

#{per001,jdbcType=VARCHAR} 完善的写法可以使得per001参数未传进来,让console不报错,但per001参数未传进来这个问题,需要自己去检查发现。

猜你喜欢

转载自blog.csdn.net/tornado430/article/details/82117422