在做insert的时候报这种错误
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='demolition', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #8 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (8 > number of parameters, which is 7).
dao层代码
LandRecommend addLandRecommend(LandRecommend landRecommend);
mapper.xml
<sql id="allFields">
id,province,city,district,address,area_covered,volume,
attachment,demolition,price,remarks,cooperation_mode,file_address,
user_name,user_phone,create_time
</sql>
<insert id="addLandRecommend" parameterType="landRecommend">
insert into land_recommend
(<include refid="allFields"/>)
values(#(id),#{province},#{city},#{district},#{address},#{areaCovered},
#{volume},#{attachment},
#{demolition},#{price},#{remarks},#{cooperationMode},
#{fileAddress},#{userName},#{userPhone},now())
</insert>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…