我真的是服了,研究了一天,mybatis主从分离,原来dao里面,方法参数用了 @param ,mybatis 拦截器 拦截不了了,
拦截器:
@Intercepts(
value = {
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}),
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class,
RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}),
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class,
RowBounds.class, ResultHandler.class})
}
)
dao:
1-可以进拦截器 Object get(String code)
2-不可以进拦截器 Object get(@param(“code”)String code)
在dao层的方法用了@param的话就进入不了拦截器了
我改成上述就好了,
感谢 https://q.cnblogs.com/q/121822/ 的博主