123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- package sopstage
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "sop_stage"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldStatus = "status"
-
- FieldDeletedAt = "deleted_at"
-
- FieldTaskID = "task_id"
-
- FieldName = "name"
-
- FieldConditionType = "condition_type"
-
- FieldConditionOperator = "condition_operator"
-
- FieldConditionList = "condition_list"
-
- FieldActionMessage = "action_message"
-
- FieldActionLabelAdd = "action_label_add"
-
- FieldActionLabelDel = "action_label_del"
-
- FieldActionForward = "action_forward"
-
- FieldIndexSort = "index_sort"
-
- EdgeSopTask = "sop_task"
-
- EdgeStageNodes = "stage_nodes"
-
- EdgeStageMessages = "stage_messages"
-
- Table = "sop_stage"
-
- SopTaskTable = "sop_stage"
-
-
- SopTaskInverseTable = "sop_task"
-
- SopTaskColumn = "task_id"
-
- StageNodesTable = "sop_node"
-
-
- StageNodesInverseTable = "sop_node"
-
- StageNodesColumn = "stage_id"
-
- StageMessagesTable = "message_records"
-
-
- StageMessagesInverseTable = "message_records"
-
- StageMessagesColumn = "source_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldDeletedAt,
- FieldTaskID,
- FieldName,
- FieldConditionType,
- FieldConditionOperator,
- FieldConditionList,
- FieldActionMessage,
- FieldActionLabelAdd,
- FieldActionLabelDel,
- FieldActionForward,
- FieldIndexSort,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- DefaultStatus uint8
-
- DefaultName string
-
- DefaultConditionType int
-
- DefaultConditionOperator int
-
- DefaultIndexSort int
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByTaskID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTaskID, opts...).ToFunc()
- }
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- func ByConditionType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldConditionType, opts...).ToFunc()
- }
- func ByConditionOperator(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldConditionOperator, opts...).ToFunc()
- }
- func ByIndexSort(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldIndexSort, opts...).ToFunc()
- }
- func BySopTaskField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newSopTaskStep(), sql.OrderByField(field, opts...))
- }
- }
- func ByStageNodesCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newStageNodesStep(), opts...)
- }
- }
- func ByStageNodes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newStageNodesStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func ByStageMessagesCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newStageMessagesStep(), opts...)
- }
- }
- func ByStageMessages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newStageMessagesStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func newSopTaskStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(SopTaskInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, SopTaskTable, SopTaskColumn),
- )
- }
- func newStageNodesStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(StageNodesInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, StageNodesTable, StageNodesColumn),
- )
- }
- func newStageMessagesStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(StageMessagesInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, StageMessagesTable, StageMessagesColumn),
- )
- }
|