!180 BaseMapper添加 selectOneWithRelationsById 方法 ,关联 issue --> https://gitee.com/mybatis-flex/mybatis-flex/issues/I7NH6K

Merge pull request !180 from barql/272378774@qq.com
This commit is contained in:
Michael Yang 2023-07-25 03:14:34 +00:00 committed by Gitee
commit c9a1b5dc83
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -490,6 +490,16 @@ public interface BaseMapper<T> {
return MapperUtil.queryRelations(this, MapperUtil.getSelectOneResult(selectListByQuery(queryWrapper)));
}
/**
* 根据主表主键来查询 1 条数据
*
* @param id 主表主键
* @return 实体类数据
*/
default T selectOneWithRelationsById(Serializable id) {
return MapperUtil.queryRelations(this, selectOneById(id));
}
/**
* 根据查询条件来查询 1 条数据
*