feature: support custom table template (#102)

* feat: add table field template field

* feat:update frontend resources
This commit is contained in:
vran
2022-04-17 12:37:10 +08:00
committed by GitHub
parent 89ffd95f8c
commit 6b6a7f4e40
36 changed files with 115 additions and 85 deletions

View File

@@ -2,6 +2,6 @@ package com.databasir.dao.enums;
public enum DocumentTemplatePropertyType {
INDEX_FIELD_NAME, COLUMN_FIELD_NAME, TRIGGER_FIELD_NAME, FOREIGN_KEY_FIELD_NAME;
TABLE_FIELD_NAME, INDEX_FIELD_NAME, COLUMN_FIELD_NAME, TRIGGER_FIELD_NAME, FOREIGN_KEY_FIELD_NAME;
}

View File

@@ -25,22 +25,21 @@ public class DocumentTemplatePropertyDao extends BaseDao<DocumentTemplatePropert
super(DOCUMENT_TEMPLATE_PROPERTY, DocumentTemplatePropertyPojo.class);
}
public void batchInsertOnDuplicateIgnore(Collection<DocumentTemplatePropertyPojo> data) {
public void batchInsertOnDuplicateUpdateDefaultValue(Collection<DocumentTemplatePropertyPojo> data) {
if (data == null || data.isEmpty()) {
return;
}
List<InsertReturningStep<DocumentTemplatePropertyRecord>> query = data.stream()
.map(pojo ->
getDslContext()
.insertInto(DOCUMENT_TEMPLATE_PROPERTY)
.set(getDslContext().newRecord(DOCUMENT_TEMPLATE_PROPERTY, pojo))
.onDuplicateKeyIgnore())
.map(pojo -> getDslContext()
.insertInto(DOCUMENT_TEMPLATE_PROPERTY)
.set(getDslContext().newRecord(DOCUMENT_TEMPLATE_PROPERTY, pojo))
.onDuplicateKeyUpdate()
.set(DOCUMENT_TEMPLATE_PROPERTY.DEFAULT_VALUE, pojo.getDefaultValue()))
.collect(Collectors.toList());
getDslContext().batch(query).execute();
}
public void batchInsertOnDuplicateKeyUpdate(Collection<DocumentTemplatePropertyPojo> data) {
public void batchInsertOnDuplicateKeyUpdateValue(Collection<DocumentTemplatePropertyPojo> data) {
if (data == null || data.isEmpty()) {
return;
}