mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-09 04:21:48 +08:00
feature: support custom table template (#102)
* feat: add table field template field * feat:update frontend resources
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user