mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-09 14:24:32 +08:00
refactor diff api (#138)
* ref: migrate diff logic to list api * feat: update frontend resources * fix: checkstyle
This commit is contained in:
@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class TableColumnDocumentDao extends BaseDao<TableColumnDocumentPojo> {
|
||||
}
|
||||
|
||||
public List<TableColumnDocumentPojo> selectByDatabaseDocumentIdAndTableIdIn(Integer schemaDocumentId,
|
||||
List<Integer> tableIdIn) {
|
||||
Collection<Integer> tableIdIn) {
|
||||
if (tableIdIn == null || tableIdIn.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ import org.jooq.DSLContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -32,7 +33,7 @@ public class TableDocumentDao extends BaseDao<TableDocumentPojo> {
|
||||
}
|
||||
|
||||
public List<TableDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer databaseDocumentId,
|
||||
List<Integer> idList) {
|
||||
Collection<Integer> idList) {
|
||||
if (idList == null || idList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -60,4 +61,16 @@ public class TableDocumentDao extends BaseDao<TableDocumentPojo> {
|
||||
.and(TABLE_DOCUMENT.ID.eq(id)))
|
||||
.fetchOptionalInto(TableDocumentPojo.class);
|
||||
}
|
||||
|
||||
public List<Integer> selectTableIdsByDatabaseDocumentIdAndTableNameIn(Integer databaseDocumentId,
|
||||
Collection<String> tableNames) {
|
||||
if (tableNames == null || tableNames.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getDslContext()
|
||||
.select(TABLE_DOCUMENT.ID).from(TABLE_DOCUMENT)
|
||||
.where(TABLE_DOCUMENT.DATABASE_DOCUMENT_ID.eq(databaseDocumentId)
|
||||
.and(TABLE_DOCUMENT.NAME.in(tableNames)))
|
||||
.fetchInto(Integer.class);
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class TableForeignKeyDocumentDao extends BaseDao<TableForeignKeyDocumentP
|
||||
}
|
||||
|
||||
public List<TableForeignKeyDocumentPojo> selectByDatabaseDocumentIdAndTableIdIn(Integer databaseDocumentId,
|
||||
List<Integer> tableIdIn) {
|
||||
Collection<Integer> tableIdIn) {
|
||||
if (tableIdIn == null || tableIdIn.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class TableIndexDocumentDao extends BaseDao<TableIndexDocumentPojo> {
|
||||
}
|
||||
|
||||
public List<TableIndexDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer documentId,
|
||||
List<Integer> tableIdIn) {
|
||||
Collection<Integer> tableIdIn) {
|
||||
if (tableIdIn == null || tableIdIn.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class TableTriggerDocumentDao extends BaseDao<TableTriggerDocumentPojo> {
|
||||
}
|
||||
|
||||
public List<TableTriggerDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer documentId,
|
||||
List<Integer> tableIdIn) {
|
||||
Collection<Integer> tableIdIn) {
|
||||
if (tableIdIn == null || tableIdIn.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
Reference in New Issue
Block a user