|
@@ -15,6 +15,7 @@ import com.gis.common.util.BaseUtil;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.db.entity.dto.IdsDto;
|
|
|
import com.gis.db.entity.dto.TableDto;
|
|
|
+import com.gis.db.entity.dto.TablePageDto;
|
|
|
import com.gis.db.entity.po.TableEntity;
|
|
|
import com.gis.db.mapper.DdlMapper;
|
|
|
import com.gis.db.mapper.TableMapper;
|
|
@@ -63,13 +64,15 @@ public class TableServiceImpl extends ServiceImpl<TableMapper, TableEntity> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result getList(PageDto param) {
|
|
|
+ public Result getList(TablePageDto param) {
|
|
|
BaseUtil.startPage(param);
|
|
|
IPage<TableEntity> page = new Page<>(param.getPageNum() , param.getPageSize());
|
|
|
LambdaQueryWrapper<TableEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.orderByDesc(BaseEntity::getCreateTime);
|
|
|
+ wrapper.eq(TableEntity::getProjectId, param.getProjectId());
|
|
|
+ String searchKey = param.getSearchKey();
|
|
|
+ wrapper.like(StrUtil.isNotBlank(searchKey), TableEntity::getName, searchKey);
|
|
|
+ wrapper.orderByDesc(TableEntity::getCreateTime);
|
|
|
IPage<TableEntity> iPage = this.page(page, wrapper);
|
|
|
-
|
|
|
return Result.success(iPage);
|
|
|
}
|
|
|
|
|
@@ -81,10 +84,12 @@ public class TableServiceImpl extends ServiceImpl<TableMapper, TableEntity> impl
|
|
|
List<Integer> tableIds = param.getIds();
|
|
|
List<String> tableNames = this.getTableNameByTableId(tableIds);
|
|
|
|
|
|
- // 删除表数据
|
|
|
+ // 真删除表
|
|
|
this.delTables(tableNames);
|
|
|
+ // 逻辑删除表记录
|
|
|
+ this.removeByIds(tableIds);
|
|
|
|
|
|
- // 删除字段
|
|
|
+ // 逻辑删除字段
|
|
|
fieldService.removeBatchByTableId(tableIds);
|
|
|
|
|
|
return Result.success(tableNames);
|