nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘path1’, 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 #1 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 (1 > number of parameters, which is 0).
第一:要输入多个值时,要在Dao中加入@Param(" ")加以区分,比如:
<update id="PathChange" parameterType="java.lang.String" >
update t_device_group set path = replace(path,#{path1},#{path2}) where path like concat(#{path1},'%')
</update>
void PathChange(@Param("path1") String path1,@Param("path2")String path2);
第二,xml中#{path1}不需要加引号!!!