当前使用版本(必填,否则不予处理)

3.5.3

该问题是如何引起的?(确定最新版也有问题再提!!!)

理论所有版本都有问题

重现步骤(如果有就写完整)

@Autowired
SqlSessionTemplate sqlSessionTemplate;

sqlSessionTemplate.selectOne("com.baidu.prod.beans.mapper.VideoMapper.selectById", field)

报错信息

There is no getter for property named 'id' in 'class java.lang.reflect.Field'

推断的可能是BaseMapper的selectById 未添加,@Param("id")导致,sqlSession.selectOne执行正常,但是外部的开销比较大,失去了一级缓存的可能

Comment From: miemieYaho

你的入参field是个啥?

Comment From: smallsong

你的入参field是个啥?

也就是正常的需要查询的字段值

Comment From: miemieYaho

MyBatis-Plus SqlSessionTemplate无法调用selectById的问题 无法复现