作者 yangfu

feat: CalculateTable support group expr

... ... @@ -76,7 +76,8 @@ type (
DatabaseTableName string `json:"databaseTableName"`
FieldSchema FieldSchema `json:"fieldSchema"`
// 字段新的英文名称(3.汇总集4.计算项中对应的新字段名称)
GroupFieldName string `json:"groupFieldName"`
GroupFieldName string `json:"groupFieldName"`
CalculateExpression string `json:"calculateExpression"`
}
)
... ... @@ -205,9 +206,10 @@ func NewFormulaCalculate(table *domain.Table, queryComponent *domain.QueryCompon
continue
}
res.FormulaGroupFields = append(res.FormulaGroupFields, &FormulaGroupField{
DatabaseTableName: queryComponent.MasterTable.SQLName,
FieldSchema: NewFieldSchemaFromField(f.Field),
GroupFieldName: tableField.SQLName,
DatabaseTableName: queryComponent.MasterTable.SQLName,
FieldSchema: NewFieldSchemaFromField(f.Field),
CalculateExpression: f.Expr.ExprSql,
GroupFieldName: tableField.SQLName,
})
}
}
... ...