mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-24 09:38:21 +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 实体列表
|
* @return 实体列表
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<ENTITY> findAll(QueryWrapper<ENTITY> queryWrapper) {
|
public List<ENTITY> findAll(Wrapper<ENTITY> wrapper) {
|
||||||
List<ENTITY> entities = commonBaseMapper().selectList(queryWrapper);
|
List<ENTITY> entities = commonBaseMapper().selectList(wrapper);
|
||||||
|
|
||||||
// 缓存查询结果
|
// 缓存查询结果
|
||||||
if (ObjectUtils.isNotEmpty(commonBaseRedissonClient())) {
|
if (ObjectUtils.isNotEmpty(commonBaseRedissonClient())) {
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ public abstract class BaseTreeService<ENTITY extends BaseTreeEntity<ENTITY>, PAG
|
||||||
* @return 实体列表
|
* @return 实体列表
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<ENTITY> findAll(QueryWrapper<ENTITY> queryWrapper) {
|
public List<ENTITY> findAll() {
|
||||||
return this.findTreeAll(null, queryWrapper);
|
return this.findTreeAll(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,7 +45,7 @@ public abstract class BaseTreeService<ENTITY extends BaseTreeEntity<ENTITY>, PAG
|
||||||
queryWrapper = new QueryWrapper<>();
|
queryWrapper = new QueryWrapper<>();
|
||||||
}
|
}
|
||||||
if (parentId == null) {
|
if (parentId == null) {
|
||||||
queryWrapper.isNull(PARENT_ID);
|
queryWrapper.isNull(PARENT_ID).or().eq(PARENT_ID, "");
|
||||||
} else {
|
} else {
|
||||||
queryWrapper.eq(PARENT_ID, parentId);
|
queryWrapper.eq(PARENT_ID, parentId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue