mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-23 22:25:48 +08:00
feat: sql解析器替换、工单统一由‘我的流程’发起、流程定义支持自定义条件触发审批、资源隐藏编号、model支持物理删除等
This commit is contained in:
135
server/internal/db/dbm/sqlparser/sqlstmt/select.go
Normal file
135
server/internal/db/dbm/sqlparser/sqlstmt/select.go
Normal file
@@ -0,0 +1,135 @@
|
||||
package sqlstmt
|
||||
|
||||
type (
|
||||
ISelectStmt interface {
|
||||
INode
|
||||
|
||||
isSelect()
|
||||
}
|
||||
|
||||
SelectStmt struct {
|
||||
*Node
|
||||
}
|
||||
|
||||
QuerySpecification struct {
|
||||
*Node
|
||||
|
||||
SelectElements *SelectElements
|
||||
From *TableSources
|
||||
Where IExpr
|
||||
Limit *Limit
|
||||
}
|
||||
|
||||
SimpleSelectStmt struct {
|
||||
SelectStmt
|
||||
|
||||
QuerySpecification *QuerySpecification
|
||||
}
|
||||
|
||||
UnionSelectStmt struct {
|
||||
SelectStmt
|
||||
|
||||
UnionType string
|
||||
QuerySpecification *QuerySpecification
|
||||
QueryExpr *QueryExpr
|
||||
UnionStmts []*UnionStmt
|
||||
Limit *Limit
|
||||
}
|
||||
|
||||
// 圆括号查询
|
||||
ParenthesisSelect struct {
|
||||
SelectStmt
|
||||
|
||||
QueryExpr *QueryExpr
|
||||
}
|
||||
|
||||
QueryExpr struct {
|
||||
*Node
|
||||
|
||||
QuerySpecification *QuerySpecification
|
||||
QueryExpr *QueryExpr
|
||||
}
|
||||
)
|
||||
|
||||
func (*SelectStmt) isSelect() {}
|
||||
|
||||
// var _ (ISelectStmt) = (*SimpleSelectStmt)(nil)
|
||||
// var _ (ISelectStmt) = (*SelectStmt)(nil)
|
||||
// var _ (ISelectStmt) = (*ParenthesisSelect)(nil)
|
||||
|
||||
type (
|
||||
SelectElements struct {
|
||||
*Node
|
||||
|
||||
Star string // 查询所有
|
||||
Elements []ISelectElement
|
||||
}
|
||||
|
||||
ISelectElement interface {
|
||||
INode
|
||||
}
|
||||
|
||||
SelectStarElement struct {
|
||||
*Node
|
||||
|
||||
FullId string
|
||||
}
|
||||
|
||||
SelectColumnElement struct {
|
||||
*Node
|
||||
|
||||
FullColumnName *ColumnName
|
||||
Alias string
|
||||
}
|
||||
|
||||
SelectFunctionElement struct {
|
||||
*Node
|
||||
|
||||
Alias string
|
||||
}
|
||||
)
|
||||
|
||||
type From struct {
|
||||
TableSource *ITableSource
|
||||
}
|
||||
|
||||
type Limit struct {
|
||||
*Node
|
||||
|
||||
RowCount int
|
||||
Offset int
|
||||
}
|
||||
|
||||
type (
|
||||
IJoinPart interface {
|
||||
INode
|
||||
}
|
||||
|
||||
JoinPart struct {
|
||||
*Node
|
||||
|
||||
TableSourceItem ITableSourceItem
|
||||
}
|
||||
|
||||
InnerJoin struct {
|
||||
JoinPart
|
||||
}
|
||||
|
||||
OuterJoin struct {
|
||||
JoinPart
|
||||
}
|
||||
|
||||
NaturalJoin struct {
|
||||
JoinPart
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
UnionStmt struct {
|
||||
*Node
|
||||
|
||||
UnionType string
|
||||
QuerySpecification *QuerySpecification
|
||||
QueryExpr *QueryExpr
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user