Skip to main content
Version: 3.8

QueryOrderByExpression 查询排序子句

1. 结构声明

class QueryOrderByExpression extends LogicItem {
orderElement: LogicItem;
order: LogicItem;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "QueryOrderByExpression",
"orderElement": {
"concept": "Identifier",
"namespace": "",
"name": "sort"
},
"order": {
"concept": "Identifier",
"namespace": "",
"name": "order"
}
}

对应的代码如下:

sort \$\{order}

(2) 示例

AST 如下:

{
"concept": "QueryOrderByExpression",
"orderElement": {
"concept": "QueryFieldExpression",
"isDotStar": false,
"entityAsName": "Product",
"propertyName": "createdTime",
"asName": ""
},
"order": {
"concept": "StringLiteral",
"value": "DESC"
}
}

对应的代码如下:

Product.createdTime desc

(3) 示例

AST 如下:

{
"concept": "QueryOrderByExpression",
"orderElement": {
"concept": "Identifier",
"namespace": "inner",
"name": "productName"
},
"order": {
"concept": "StringLiteral",
"value": "ASC"
}
}

对应的代码如下:

productName asc