where.go 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. // Code generated by ent, DO NOT EDIT.
  2. package promocodeusage
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. "github.com/Wei-Shaw/sub2api/ent/predicate"
  8. )
  9. // ID filters vertices based on their ID field.
  10. func ID(id int64) predicate.PromoCodeUsage {
  11. return predicate.PromoCodeUsage(sql.FieldEQ(FieldID, id))
  12. }
  13. // IDEQ applies the EQ predicate on the ID field.
  14. func IDEQ(id int64) predicate.PromoCodeUsage {
  15. return predicate.PromoCodeUsage(sql.FieldEQ(FieldID, id))
  16. }
  17. // IDNEQ applies the NEQ predicate on the ID field.
  18. func IDNEQ(id int64) predicate.PromoCodeUsage {
  19. return predicate.PromoCodeUsage(sql.FieldNEQ(FieldID, id))
  20. }
  21. // IDIn applies the In predicate on the ID field.
  22. func IDIn(ids ...int64) predicate.PromoCodeUsage {
  23. return predicate.PromoCodeUsage(sql.FieldIn(FieldID, ids...))
  24. }
  25. // IDNotIn applies the NotIn predicate on the ID field.
  26. func IDNotIn(ids ...int64) predicate.PromoCodeUsage {
  27. return predicate.PromoCodeUsage(sql.FieldNotIn(FieldID, ids...))
  28. }
  29. // IDGT applies the GT predicate on the ID field.
  30. func IDGT(id int64) predicate.PromoCodeUsage {
  31. return predicate.PromoCodeUsage(sql.FieldGT(FieldID, id))
  32. }
  33. // IDGTE applies the GTE predicate on the ID field.
  34. func IDGTE(id int64) predicate.PromoCodeUsage {
  35. return predicate.PromoCodeUsage(sql.FieldGTE(FieldID, id))
  36. }
  37. // IDLT applies the LT predicate on the ID field.
  38. func IDLT(id int64) predicate.PromoCodeUsage {
  39. return predicate.PromoCodeUsage(sql.FieldLT(FieldID, id))
  40. }
  41. // IDLTE applies the LTE predicate on the ID field.
  42. func IDLTE(id int64) predicate.PromoCodeUsage {
  43. return predicate.PromoCodeUsage(sql.FieldLTE(FieldID, id))
  44. }
  45. // PromoCodeID applies equality check predicate on the "promo_code_id" field. It's identical to PromoCodeIDEQ.
  46. func PromoCodeID(v int64) predicate.PromoCodeUsage {
  47. return predicate.PromoCodeUsage(sql.FieldEQ(FieldPromoCodeID, v))
  48. }
  49. // UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
  50. func UserID(v int64) predicate.PromoCodeUsage {
  51. return predicate.PromoCodeUsage(sql.FieldEQ(FieldUserID, v))
  52. }
  53. // BonusAmount applies equality check predicate on the "bonus_amount" field. It's identical to BonusAmountEQ.
  54. func BonusAmount(v float64) predicate.PromoCodeUsage {
  55. return predicate.PromoCodeUsage(sql.FieldEQ(FieldBonusAmount, v))
  56. }
  57. // UsedAt applies equality check predicate on the "used_at" field. It's identical to UsedAtEQ.
  58. func UsedAt(v time.Time) predicate.PromoCodeUsage {
  59. return predicate.PromoCodeUsage(sql.FieldEQ(FieldUsedAt, v))
  60. }
  61. // PromoCodeIDEQ applies the EQ predicate on the "promo_code_id" field.
  62. func PromoCodeIDEQ(v int64) predicate.PromoCodeUsage {
  63. return predicate.PromoCodeUsage(sql.FieldEQ(FieldPromoCodeID, v))
  64. }
  65. // PromoCodeIDNEQ applies the NEQ predicate on the "promo_code_id" field.
  66. func PromoCodeIDNEQ(v int64) predicate.PromoCodeUsage {
  67. return predicate.PromoCodeUsage(sql.FieldNEQ(FieldPromoCodeID, v))
  68. }
  69. // PromoCodeIDIn applies the In predicate on the "promo_code_id" field.
  70. func PromoCodeIDIn(vs ...int64) predicate.PromoCodeUsage {
  71. return predicate.PromoCodeUsage(sql.FieldIn(FieldPromoCodeID, vs...))
  72. }
  73. // PromoCodeIDNotIn applies the NotIn predicate on the "promo_code_id" field.
  74. func PromoCodeIDNotIn(vs ...int64) predicate.PromoCodeUsage {
  75. return predicate.PromoCodeUsage(sql.FieldNotIn(FieldPromoCodeID, vs...))
  76. }
  77. // UserIDEQ applies the EQ predicate on the "user_id" field.
  78. func UserIDEQ(v int64) predicate.PromoCodeUsage {
  79. return predicate.PromoCodeUsage(sql.FieldEQ(FieldUserID, v))
  80. }
  81. // UserIDNEQ applies the NEQ predicate on the "user_id" field.
  82. func UserIDNEQ(v int64) predicate.PromoCodeUsage {
  83. return predicate.PromoCodeUsage(sql.FieldNEQ(FieldUserID, v))
  84. }
  85. // UserIDIn applies the In predicate on the "user_id" field.
  86. func UserIDIn(vs ...int64) predicate.PromoCodeUsage {
  87. return predicate.PromoCodeUsage(sql.FieldIn(FieldUserID, vs...))
  88. }
  89. // UserIDNotIn applies the NotIn predicate on the "user_id" field.
  90. func UserIDNotIn(vs ...int64) predicate.PromoCodeUsage {
  91. return predicate.PromoCodeUsage(sql.FieldNotIn(FieldUserID, vs...))
  92. }
  93. // BonusAmountEQ applies the EQ predicate on the "bonus_amount" field.
  94. func BonusAmountEQ(v float64) predicate.PromoCodeUsage {
  95. return predicate.PromoCodeUsage(sql.FieldEQ(FieldBonusAmount, v))
  96. }
  97. // BonusAmountNEQ applies the NEQ predicate on the "bonus_amount" field.
  98. func BonusAmountNEQ(v float64) predicate.PromoCodeUsage {
  99. return predicate.PromoCodeUsage(sql.FieldNEQ(FieldBonusAmount, v))
  100. }
  101. // BonusAmountIn applies the In predicate on the "bonus_amount" field.
  102. func BonusAmountIn(vs ...float64) predicate.PromoCodeUsage {
  103. return predicate.PromoCodeUsage(sql.FieldIn(FieldBonusAmount, vs...))
  104. }
  105. // BonusAmountNotIn applies the NotIn predicate on the "bonus_amount" field.
  106. func BonusAmountNotIn(vs ...float64) predicate.PromoCodeUsage {
  107. return predicate.PromoCodeUsage(sql.FieldNotIn(FieldBonusAmount, vs...))
  108. }
  109. // BonusAmountGT applies the GT predicate on the "bonus_amount" field.
  110. func BonusAmountGT(v float64) predicate.PromoCodeUsage {
  111. return predicate.PromoCodeUsage(sql.FieldGT(FieldBonusAmount, v))
  112. }
  113. // BonusAmountGTE applies the GTE predicate on the "bonus_amount" field.
  114. func BonusAmountGTE(v float64) predicate.PromoCodeUsage {
  115. return predicate.PromoCodeUsage(sql.FieldGTE(FieldBonusAmount, v))
  116. }
  117. // BonusAmountLT applies the LT predicate on the "bonus_amount" field.
  118. func BonusAmountLT(v float64) predicate.PromoCodeUsage {
  119. return predicate.PromoCodeUsage(sql.FieldLT(FieldBonusAmount, v))
  120. }
  121. // BonusAmountLTE applies the LTE predicate on the "bonus_amount" field.
  122. func BonusAmountLTE(v float64) predicate.PromoCodeUsage {
  123. return predicate.PromoCodeUsage(sql.FieldLTE(FieldBonusAmount, v))
  124. }
  125. // UsedAtEQ applies the EQ predicate on the "used_at" field.
  126. func UsedAtEQ(v time.Time) predicate.PromoCodeUsage {
  127. return predicate.PromoCodeUsage(sql.FieldEQ(FieldUsedAt, v))
  128. }
  129. // UsedAtNEQ applies the NEQ predicate on the "used_at" field.
  130. func UsedAtNEQ(v time.Time) predicate.PromoCodeUsage {
  131. return predicate.PromoCodeUsage(sql.FieldNEQ(FieldUsedAt, v))
  132. }
  133. // UsedAtIn applies the In predicate on the "used_at" field.
  134. func UsedAtIn(vs ...time.Time) predicate.PromoCodeUsage {
  135. return predicate.PromoCodeUsage(sql.FieldIn(FieldUsedAt, vs...))
  136. }
  137. // UsedAtNotIn applies the NotIn predicate on the "used_at" field.
  138. func UsedAtNotIn(vs ...time.Time) predicate.PromoCodeUsage {
  139. return predicate.PromoCodeUsage(sql.FieldNotIn(FieldUsedAt, vs...))
  140. }
  141. // UsedAtGT applies the GT predicate on the "used_at" field.
  142. func UsedAtGT(v time.Time) predicate.PromoCodeUsage {
  143. return predicate.PromoCodeUsage(sql.FieldGT(FieldUsedAt, v))
  144. }
  145. // UsedAtGTE applies the GTE predicate on the "used_at" field.
  146. func UsedAtGTE(v time.Time) predicate.PromoCodeUsage {
  147. return predicate.PromoCodeUsage(sql.FieldGTE(FieldUsedAt, v))
  148. }
  149. // UsedAtLT applies the LT predicate on the "used_at" field.
  150. func UsedAtLT(v time.Time) predicate.PromoCodeUsage {
  151. return predicate.PromoCodeUsage(sql.FieldLT(FieldUsedAt, v))
  152. }
  153. // UsedAtLTE applies the LTE predicate on the "used_at" field.
  154. func UsedAtLTE(v time.Time) predicate.PromoCodeUsage {
  155. return predicate.PromoCodeUsage(sql.FieldLTE(FieldUsedAt, v))
  156. }
  157. // HasPromoCode applies the HasEdge predicate on the "promo_code" edge.
  158. func HasPromoCode() predicate.PromoCodeUsage {
  159. return predicate.PromoCodeUsage(func(s *sql.Selector) {
  160. step := sqlgraph.NewStep(
  161. sqlgraph.From(Table, FieldID),
  162. sqlgraph.Edge(sqlgraph.M2O, true, PromoCodeTable, PromoCodeColumn),
  163. )
  164. sqlgraph.HasNeighbors(s, step)
  165. })
  166. }
  167. // HasPromoCodeWith applies the HasEdge predicate on the "promo_code" edge with a given conditions (other predicates).
  168. func HasPromoCodeWith(preds ...predicate.PromoCode) predicate.PromoCodeUsage {
  169. return predicate.PromoCodeUsage(func(s *sql.Selector) {
  170. step := newPromoCodeStep()
  171. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  172. for _, p := range preds {
  173. p(s)
  174. }
  175. })
  176. })
  177. }
  178. // HasUser applies the HasEdge predicate on the "user" edge.
  179. func HasUser() predicate.PromoCodeUsage {
  180. return predicate.PromoCodeUsage(func(s *sql.Selector) {
  181. step := sqlgraph.NewStep(
  182. sqlgraph.From(Table, FieldID),
  183. sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
  184. )
  185. sqlgraph.HasNeighbors(s, step)
  186. })
  187. }
  188. // HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
  189. func HasUserWith(preds ...predicate.User) predicate.PromoCodeUsage {
  190. return predicate.PromoCodeUsage(func(s *sql.Selector) {
  191. step := newUserStep()
  192. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  193. for _, p := range preds {
  194. p(s)
  195. }
  196. })
  197. })
  198. }
  199. // And groups predicates with the AND operator between them.
  200. func And(predicates ...predicate.PromoCodeUsage) predicate.PromoCodeUsage {
  201. return predicate.PromoCodeUsage(sql.AndPredicates(predicates...))
  202. }
  203. // Or groups predicates with the OR operator between them.
  204. func Or(predicates ...predicate.PromoCodeUsage) predicate.PromoCodeUsage {
  205. return predicate.PromoCodeUsage(sql.OrPredicates(predicates...))
  206. }
  207. // Not applies the not operator on the given predicate.
  208. func Not(p predicate.PromoCodeUsage) predicate.PromoCodeUsage {
  209. return predicate.PromoCodeUsage(sql.NotPredicates(p))
  210. }