usagestatisticmonth.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. // Code generated by ent, DO NOT EDIT.
  2. package usagestatisticmonth
  3. import (
  4. "time"
  5. "entgo.io/ent"
  6. "entgo.io/ent/dialect/sql"
  7. )
  8. const (
  9. // Label holds the string label denoting the usagestatisticmonth type in the database.
  10. Label = "usage_statistic_month"
  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. // FieldDeletedAt holds the string denoting the deleted_at field in the database.
  20. FieldDeletedAt = "deleted_at"
  21. // FieldAddtime holds the string denoting the addtime field in the database.
  22. FieldAddtime = "addtime"
  23. // FieldType holds the string denoting the type field in the database.
  24. FieldType = "type"
  25. // FieldBotID holds the string denoting the bot_id field in the database.
  26. FieldBotID = "bot_id"
  27. // FieldOrganizationID holds the string denoting the organization_id field in the database.
  28. FieldOrganizationID = "organization_id"
  29. // FieldAiResponse holds the string denoting the ai_response field in the database.
  30. FieldAiResponse = "ai_response"
  31. // FieldSopRun holds the string denoting the sop_run field in the database.
  32. FieldSopRun = "sop_run"
  33. // FieldTotalFriend holds the string denoting the total_friend field in the database.
  34. FieldTotalFriend = "total_friend"
  35. // FieldTotalGroup holds the string denoting the total_group field in the database.
  36. FieldTotalGroup = "total_group"
  37. // FieldAccountBalance holds the string denoting the account_balance field in the database.
  38. FieldAccountBalance = "account_balance"
  39. // FieldConsumeToken holds the string denoting the consume_token field in the database.
  40. FieldConsumeToken = "consume_token"
  41. // FieldActiveUser holds the string denoting the active_user field in the database.
  42. FieldActiveUser = "active_user"
  43. // FieldNewUser holds the string denoting the new_user field in the database.
  44. FieldNewUser = "new_user"
  45. // FieldLabelDist holds the string denoting the label_dist field in the database.
  46. FieldLabelDist = "label_dist"
  47. // FieldConsumeCoin holds the string denoting the consume_coin field in the database.
  48. FieldConsumeCoin = "consume_coin"
  49. // Table holds the table name of the usagestatisticmonth in the database.
  50. Table = "usage_statistic_month"
  51. )
  52. // Columns holds all SQL columns for usagestatisticmonth fields.
  53. var Columns = []string{
  54. FieldID,
  55. FieldCreatedAt,
  56. FieldUpdatedAt,
  57. FieldStatus,
  58. FieldDeletedAt,
  59. FieldAddtime,
  60. FieldType,
  61. FieldBotID,
  62. FieldOrganizationID,
  63. FieldAiResponse,
  64. FieldSopRun,
  65. FieldTotalFriend,
  66. FieldTotalGroup,
  67. FieldAccountBalance,
  68. FieldConsumeToken,
  69. FieldActiveUser,
  70. FieldNewUser,
  71. FieldLabelDist,
  72. FieldConsumeCoin,
  73. }
  74. // ValidColumn reports if the column name is valid (part of the table columns).
  75. func ValidColumn(column string) bool {
  76. for i := range Columns {
  77. if column == Columns[i] {
  78. return true
  79. }
  80. }
  81. return false
  82. }
  83. // Note that the variables below are initialized by the runtime
  84. // package on the initialization of the application. Therefore,
  85. // it should be imported in the main as follows:
  86. //
  87. // import _ "wechat-api/ent/runtime"
  88. var (
  89. Hooks [1]ent.Hook
  90. Interceptors [1]ent.Interceptor
  91. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  92. DefaultCreatedAt func() time.Time
  93. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  94. DefaultUpdatedAt func() time.Time
  95. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  96. UpdateDefaultUpdatedAt func() time.Time
  97. // DefaultStatus holds the default value on creation for the "status" field.
  98. DefaultStatus uint8
  99. // DefaultConsumeCoin holds the default value on creation for the "consume_coin" field.
  100. DefaultConsumeCoin uint64
  101. )
  102. // OrderOption defines the ordering options for the UsageStatisticMonth queries.
  103. type OrderOption func(*sql.Selector)
  104. // ByID orders the results by the id field.
  105. func ByID(opts ...sql.OrderTermOption) OrderOption {
  106. return sql.OrderByField(FieldID, opts...).ToFunc()
  107. }
  108. // ByCreatedAt orders the results by the created_at field.
  109. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  110. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  111. }
  112. // ByUpdatedAt orders the results by the updated_at field.
  113. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  114. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  115. }
  116. // ByStatus orders the results by the status field.
  117. func ByStatus(opts ...sql.OrderTermOption) OrderOption {
  118. return sql.OrderByField(FieldStatus, 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. // ByAddtime orders the results by the addtime field.
  125. func ByAddtime(opts ...sql.OrderTermOption) OrderOption {
  126. return sql.OrderByField(FieldAddtime, opts...).ToFunc()
  127. }
  128. // ByType orders the results by the type field.
  129. func ByType(opts ...sql.OrderTermOption) OrderOption {
  130. return sql.OrderByField(FieldType, opts...).ToFunc()
  131. }
  132. // ByBotID orders the results by the bot_id field.
  133. func ByBotID(opts ...sql.OrderTermOption) OrderOption {
  134. return sql.OrderByField(FieldBotID, opts...).ToFunc()
  135. }
  136. // ByOrganizationID orders the results by the organization_id field.
  137. func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
  138. return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
  139. }
  140. // ByAiResponse orders the results by the ai_response field.
  141. func ByAiResponse(opts ...sql.OrderTermOption) OrderOption {
  142. return sql.OrderByField(FieldAiResponse, opts...).ToFunc()
  143. }
  144. // BySopRun orders the results by the sop_run field.
  145. func BySopRun(opts ...sql.OrderTermOption) OrderOption {
  146. return sql.OrderByField(FieldSopRun, opts...).ToFunc()
  147. }
  148. // ByTotalFriend orders the results by the total_friend field.
  149. func ByTotalFriend(opts ...sql.OrderTermOption) OrderOption {
  150. return sql.OrderByField(FieldTotalFriend, opts...).ToFunc()
  151. }
  152. // ByTotalGroup orders the results by the total_group field.
  153. func ByTotalGroup(opts ...sql.OrderTermOption) OrderOption {
  154. return sql.OrderByField(FieldTotalGroup, opts...).ToFunc()
  155. }
  156. // ByAccountBalance orders the results by the account_balance field.
  157. func ByAccountBalance(opts ...sql.OrderTermOption) OrderOption {
  158. return sql.OrderByField(FieldAccountBalance, opts...).ToFunc()
  159. }
  160. // ByConsumeToken orders the results by the consume_token field.
  161. func ByConsumeToken(opts ...sql.OrderTermOption) OrderOption {
  162. return sql.OrderByField(FieldConsumeToken, opts...).ToFunc()
  163. }
  164. // ByActiveUser orders the results by the active_user field.
  165. func ByActiveUser(opts ...sql.OrderTermOption) OrderOption {
  166. return sql.OrderByField(FieldActiveUser, opts...).ToFunc()
  167. }
  168. // ByNewUser orders the results by the new_user field.
  169. func ByNewUser(opts ...sql.OrderTermOption) OrderOption {
  170. return sql.OrderByField(FieldNewUser, opts...).ToFunc()
  171. }
  172. // ByConsumeCoin orders the results by the consume_coin field.
  173. func ByConsumeCoin(opts ...sql.OrderTermOption) OrderOption {
  174. return sql.OrderByField(FieldConsumeCoin, opts...).ToFunc()
  175. }