Search in sources :

Example 1 with TableQuery

use of com.albedo.java.modules.gen.domain.vo.TableQuery in project albedo by somowhere.

the class TableServiceImpl method findTableListFormDb.

@Override
public List<TableDto> findTableListFormDb(TableDto tableDto) {
    ArgumentAssert.notNull(tableDto, "无效参数");
    List<TableDo> tableDoEntities = list();
    TableQuery tableQuery = new TableQuery();
    if (StringUtil.isNotEmpty(tableDto.getName())) {
        tableQuery.setName(tableDto.getName());
    } else {
        List<String> tempNames = Lists.newArrayList("gen_");
        tableQuery.setNotLikeNames(tempNames);
        if (ObjectUtil.isNotEmpty(tableDoEntities)) {
            tableQuery.setNotNames(CollUtil.extractToList(tableDoEntities, TableDo.F_NAME));
        }
    }
    List<TableDo> list = repository.findTableList(tableQuery, tableDto.getDsName());
    return list.stream().map(item -> copyBeanToDto(item)).collect(Collectors.toList());
}
Also used : TableDo(com.albedo.java.modules.gen.domain.TableDo) ObjectUtil(com.albedo.java.common.core.util.ObjectUtil) DictDo(com.albedo.java.modules.sys.domain.DictDo) ArgumentAssert(com.albedo.java.common.core.util.ArgumentAssert) CollUtil(com.albedo.java.common.core.util.CollUtil) TableService(com.albedo.java.modules.gen.service.TableService) DatasourceConfService(com.albedo.java.modules.gen.service.DatasourceConfService) TableColumnDto(com.albedo.java.modules.gen.domain.dto.TableColumnDto) GenUtil(com.albedo.java.modules.gen.util.GenUtil) TableColumnService(com.albedo.java.modules.gen.service.TableColumnService) Lists(com.google.common.collect.Lists) TableFormDataVo(com.albedo.java.modules.gen.domain.vo.TableFormDataVo) Service(org.springframework.stereotype.Service) GenConfig(com.albedo.java.modules.gen.domain.xml.GenConfig) TableColumnDo(com.albedo.java.modules.gen.domain.TableColumnDo) TableDo(com.albedo.java.modules.gen.domain.TableDo) TableRepository(com.albedo.java.modules.gen.repository.TableRepository) TableDto(com.albedo.java.modules.gen.domain.dto.TableDto) Wrappers(com.baomidou.mybatisplus.core.toolkit.Wrappers) DatasourceConfDo(com.albedo.java.modules.gen.domain.DatasourceConfDo) Resource(javax.annotation.Resource) Set(java.util.Set) TableCacheKeyBuilder(com.albedo.java.modules.gen.cache.TableCacheKeyBuilder) CacheKeyBuilder(com.albedo.java.common.core.cache.model.CacheKeyBuilder) StringUtil(com.albedo.java.common.core.util.StringUtil) Collectors(java.util.stream.Collectors) TableFromDto(com.albedo.java.modules.gen.domain.dto.TableFromDto) List(java.util.List) AbstractDataCacheServiceImpl(com.albedo.java.plugins.database.mybatis.service.impl.AbstractDataCacheServiceImpl) TableQuery(com.albedo.java.modules.gen.domain.vo.TableQuery) Collections(java.util.Collections) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) TableQuery(com.albedo.java.modules.gen.domain.vo.TableQuery)

Aggregations

CacheKeyBuilder (com.albedo.java.common.core.cache.model.CacheKeyBuilder)1 ArgumentAssert (com.albedo.java.common.core.util.ArgumentAssert)1 CollUtil (com.albedo.java.common.core.util.CollUtil)1 ObjectUtil (com.albedo.java.common.core.util.ObjectUtil)1 StringUtil (com.albedo.java.common.core.util.StringUtil)1 TableCacheKeyBuilder (com.albedo.java.modules.gen.cache.TableCacheKeyBuilder)1 DatasourceConfDo (com.albedo.java.modules.gen.domain.DatasourceConfDo)1 TableColumnDo (com.albedo.java.modules.gen.domain.TableColumnDo)1 TableDo (com.albedo.java.modules.gen.domain.TableDo)1 TableColumnDto (com.albedo.java.modules.gen.domain.dto.TableColumnDto)1 TableDto (com.albedo.java.modules.gen.domain.dto.TableDto)1 TableFromDto (com.albedo.java.modules.gen.domain.dto.TableFromDto)1 TableFormDataVo (com.albedo.java.modules.gen.domain.vo.TableFormDataVo)1 TableQuery (com.albedo.java.modules.gen.domain.vo.TableQuery)1 GenConfig (com.albedo.java.modules.gen.domain.xml.GenConfig)1 TableRepository (com.albedo.java.modules.gen.repository.TableRepository)1 DatasourceConfService (com.albedo.java.modules.gen.service.DatasourceConfService)1 TableColumnService (com.albedo.java.modules.gen.service.TableColumnService)1 TableService (com.albedo.java.modules.gen.service.TableService)1 GenUtil (com.albedo.java.modules.gen.util.GenUtil)1