feat: CalculateTable support group expr
正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
| @@ -76,7 +76,8 @@ type ( | @@ -76,7 +76,8 @@ type ( | ||
| 76 | DatabaseTableName string `json:"databaseTableName"` | 76 | DatabaseTableName string `json:"databaseTableName"` |
| 77 | FieldSchema FieldSchema `json:"fieldSchema"` | 77 | FieldSchema FieldSchema `json:"fieldSchema"` |
| 78 | // 字段新的英文名称(3.汇总集4.计算项中对应的新字段名称) | 78 | // 字段新的英文名称(3.汇总集4.计算项中对应的新字段名称) |
| 79 | - GroupFieldName string `json:"groupFieldName"` | 79 | + GroupFieldName string `json:"groupFieldName"` |
| 80 | + CalculateExpression string `json:"calculateExpression"` | ||
| 80 | } | 81 | } |
| 81 | ) | 82 | ) |
| 82 | 83 | ||
| @@ -205,9 +206,10 @@ func NewFormulaCalculate(table *domain.Table, queryComponent *domain.QueryCompon | @@ -205,9 +206,10 @@ func NewFormulaCalculate(table *domain.Table, queryComponent *domain.QueryCompon | ||
| 205 | continue | 206 | continue |
| 206 | } | 207 | } |
| 207 | res.FormulaGroupFields = append(res.FormulaGroupFields, &FormulaGroupField{ | 208 | res.FormulaGroupFields = append(res.FormulaGroupFields, &FormulaGroupField{ |
| 208 | - DatabaseTableName: queryComponent.MasterTable.SQLName, | ||
| 209 | - FieldSchema: NewFieldSchemaFromField(f.Field), | ||
| 210 | - GroupFieldName: tableField.SQLName, | 209 | + DatabaseTableName: queryComponent.MasterTable.SQLName, |
| 210 | + FieldSchema: NewFieldSchemaFromField(f.Field), | ||
| 211 | + CalculateExpression: f.Expr.ExprSql, | ||
| 212 | + GroupFieldName: tableField.SQLName, | ||
| 211 | }) | 213 | }) |
| 212 | } | 214 | } |
| 213 | } | 215 | } |
-
请 注册 或 登录 后发表评论