soptask.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // Code generated by ent, DO NOT EDIT.
  2. package soptask
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. )
  8. const (
  9. // Label holds the string label denoting the soptask type in the database.
  10. Label = "sop_task"
  11. // FieldID holds the string denoting the id field in the database.
  12. FieldID = "id"
  13. // FieldCreatedAt holds the string denoting the created_at field in the database.
  14. FieldCreatedAt = "created_at"
  15. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  16. FieldUpdatedAt = "updated_at"
  17. // FieldStatus holds the string denoting the status field in the database.
  18. FieldStatus = "status"
  19. // FieldName holds the string denoting the name field in the database.
  20. FieldName = "name"
  21. // FieldBotWxidList holds the string denoting the bot_wxid_list field in the database.
  22. FieldBotWxidList = "bot_wxid_list"
  23. // FieldType holds the string denoting the type field in the database.
  24. FieldType = "type"
  25. // FieldPlanStartTime holds the string denoting the plan_start_time field in the database.
  26. FieldPlanStartTime = "plan_start_time"
  27. // FieldPlanEndTime holds the string denoting the plan_end_time field in the database.
  28. FieldPlanEndTime = "plan_end_time"
  29. // FieldCreatorID holds the string denoting the creator_id field in the database.
  30. FieldCreatorID = "creator_id"
  31. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  32. FieldDeletedAt = "deleted_at"
  33. // EdgeTaskStages holds the string denoting the task_stages edge name in mutations.
  34. EdgeTaskStages = "task_stages"
  35. // Table holds the table name of the soptask in the database.
  36. Table = "sop_task"
  37. // TaskStagesTable is the table that holds the task_stages relation/edge.
  38. TaskStagesTable = "sop_stage"
  39. // TaskStagesInverseTable is the table name for the SopStage entity.
  40. // It exists in this package in order to avoid circular dependency with the "sopstage" package.
  41. TaskStagesInverseTable = "sop_stage"
  42. // TaskStagesColumn is the table column denoting the task_stages relation/edge.
  43. TaskStagesColumn = "task_id"
  44. )
  45. // Columns holds all SQL columns for soptask fields.
  46. var Columns = []string{
  47. FieldID,
  48. FieldCreatedAt,
  49. FieldUpdatedAt,
  50. FieldStatus,
  51. FieldName,
  52. FieldBotWxidList,
  53. FieldType,
  54. FieldPlanStartTime,
  55. FieldPlanEndTime,
  56. FieldCreatorID,
  57. FieldDeletedAt,
  58. }
  59. // ValidColumn reports if the column name is valid (part of the table columns).
  60. func ValidColumn(column string) bool {
  61. for i := range Columns {
  62. if column == Columns[i] {
  63. return true
  64. }
  65. }
  66. return false
  67. }
  68. var (
  69. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  70. DefaultCreatedAt func() time.Time
  71. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  72. DefaultUpdatedAt func() time.Time
  73. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  74. UpdateDefaultUpdatedAt func() time.Time
  75. // DefaultStatus holds the default value on creation for the "status" field.
  76. DefaultStatus uint8
  77. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  78. NameValidator func(string) error
  79. // DefaultType holds the default value on creation for the "type" field.
  80. DefaultType int
  81. )
  82. // OrderOption defines the ordering options for the SopTask queries.
  83. type OrderOption func(*sql.Selector)
  84. // ByID orders the results by the id field.
  85. func ByID(opts ...sql.OrderTermOption) OrderOption {
  86. return sql.OrderByField(FieldID, opts...).ToFunc()
  87. }
  88. // ByCreatedAt orders the results by the created_at field.
  89. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  90. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  91. }
  92. // ByUpdatedAt orders the results by the updated_at field.
  93. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  94. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  95. }
  96. // ByStatus orders the results by the status field.
  97. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  98. return sql.OrderByField(FieldStatus, opts...).ToFunc()
  99. }
  100. // ByName orders the results by the name field.
  101. func ByName(opts ...sql.OrderTermOption) OrderOption {
  102. return sql.OrderByField(FieldName, opts...).ToFunc()
  103. }
  104. // ByType orders the results by the type field.
  105. func ByType(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldType, opts...).ToFunc()
  107. }
  108. // ByPlanStartTime orders the results by the plan_start_time field.
  109. func ByPlanStartTime(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldPlanStartTime, opts...).ToFunc()
  111. }
  112. // ByPlanEndTime orders the results by the plan_end_time field.
  113. func ByPlanEndTime(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldPlanEndTime, opts...).ToFunc()
  115. }
  116. // ByCreatorID orders the results by the creator_id field.
  117. func ByCreatorID(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldCreatorID, opts...).ToFunc()
  119. }
  120. // ByDeletedAt orders the results by the deleted_at field.
  121. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
  122. return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
  123. }
  124. // ByTaskStagesCount orders the results by task_stages count.
  125. func ByTaskStagesCount(opts ...sql.OrderTermOption) OrderOption {
  126. return func(s *sql.Selector) {
  127. sqlgraph.OrderByNeighborsCount(s, newTaskStagesStep(), opts...)
  128. }
  129. }
  130. // ByTaskStages orders the results by task_stages terms.
  131. func ByTaskStages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
  132. return func(s *sql.Selector) {
  133. sqlgraph.OrderByNeighborTerms(s, newTaskStagesStep(), append([]sql.OrderTerm{term}, terms...)...)
  134. }
  135. }
  136. func newTaskStagesStep() *sqlgraph.Step {
  137. return sqlgraph.NewStep(
  138. sqlgraph.From(Table, FieldID),
  139. sqlgraph.To(TaskStagesInverseTable, FieldID),
  140. sqlgraph.Edge(sqlgraph.O2M, false, TaskStagesTable, TaskStagesColumn),
  141. )
  142. }