问题描述
提示:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='limit', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}.:
mapper.xml文件
<select id="findDocumentsList" parameterType="Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_list"></include>
from tb_document_detail
<where>
<if test="documentName!=null and documentName!=''">
and document_name like CONCAT('%','#{documentName}','%')
</if>
解决方案:
修改XML文件,‘#{documentName}’,多了一对单引号’’
<select id="findDocumentsList" parameterType="Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_list"></include>
from tb_document_detail
<where>
<if test="documentName!=null and documentName!=''">
and document_name like CONCAT('%',#{documentName},'%')
</if>