LambdaQueryWrapper<SysMenu> queryWrapper = Wrappers.lambdaQuery(SysMenu.class);
SFunction<SysMenu, Integer> getMenuType2 = sysMenu -> sysMenu.getMenuType();
SFunction<SysMenu, Integer> getMenuType1 = SysMenu::getMenuType;
SFunction<SysMenu, Integer> getMenuType = new SFunction<>() {
@Serial
private static final long serialVersionUID = 4693707598369533353L;
@Override
public Integer apply(SysMenu sysMenu) {
return sysMenu.getMenuType();
}
};
queryWrapper.eq(getMenuType, 1);
daoInterface.selectCount(queryWrapper);
org.mybatis.spring.MyBatisSystemException
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
at jdk.proxy2/jdk.proxy2.$Proxy103.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:87)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at jdk.proxy2/jdk.proxy2.$Proxy123.selectCount(Unknown Source)
这边有个getMenuType、getMenuType1、getMenuType2三个方法引用,getMenuType1传入到queryWrapper中查询没问题,getMenuType和getMenuType2报错