mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-21 16:19:55 +00:00
refactor(common): Optimized the basic service interface and tree service interface
This commit is contained in:
parent
c13b474ea8
commit
bf7d31f5a3
2 changed files with 5 additions and 5 deletions
|
|
@ -356,8 +356,8 @@ public abstract class BaseService<ENTITY extends BaseEntity, PAGE_DTO extends Ba
|
|||
* @return 实体列表
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public List<ENTITY> findAll(QueryWrapper<ENTITY> queryWrapper) {
|
||||
List<ENTITY> entities = commonBaseMapper().selectList(queryWrapper);
|
||||
public List<ENTITY> findAll(Wrapper<ENTITY> wrapper) {
|
||||
List<ENTITY> entities = commonBaseMapper().selectList(wrapper);
|
||||
|
||||
// 缓存查询结果
|
||||
if (ObjectUtils.isNotEmpty(commonBaseRedissonClient())) {
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ public abstract class BaseTreeService<ENTITY extends BaseTreeEntity<ENTITY>, PAG
|
|||
* @return 实体列表
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public List<ENTITY> findAll(QueryWrapper<ENTITY> queryWrapper) {
|
||||
return this.findTreeAll(null, queryWrapper);
|
||||
public List<ENTITY> findAll() {
|
||||
return this.findTreeAll(null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +45,7 @@ public abstract class BaseTreeService<ENTITY extends BaseTreeEntity<ENTITY>, PAG
|
|||
queryWrapper = new QueryWrapper<>();
|
||||
}
|
||||
if (parentId == null) {
|
||||
queryWrapper.isNull(PARENT_ID);
|
||||
queryWrapper.isNull(PARENT_ID).or().eq(PARENT_ID, "");
|
||||
} else {
|
||||
queryWrapper.eq(PARENT_ID, parentId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue