网上一般是让你去查看model中,是否set get,或者是让你查看,是否名字写错了,大家建议先试一次,如果是是没解决问题,可以使用以下方法:
Long getId(@Param(value = "table") String table);
在mapper接口中,方法上边写一个@Param注解,去和mapper.xml
文件对应起来。
我的错误:
There is no getter for property named 'table' in 'class java.lang.String'
mapper接口(修改过后的)
@Repository
public interface CodeRuleMapper {
Long getId(@Param(value = "table") String table);
}
原来的mapper接口:
```@Repository
public interface CodeRuleMapper {
Long getId(String table);
}
mapper.xml文件:
```java
<select id="getId" resultType="java.lang.Long" parameterType="java.lang.String">
select max(id) AS id
from ${table}
</select>