where.go 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. // Code generated by ent, DO NOT EDIT.
  2. package announcementread
  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.AnnouncementRead {
  11. return predicate.AnnouncementRead(sql.FieldEQ(FieldID, id))
  12. }
  13. // IDEQ applies the EQ predicate on the ID field.
  14. func IDEQ(id int64) predicate.AnnouncementRead {
  15. return predicate.AnnouncementRead(sql.FieldEQ(FieldID, id))
  16. }
  17. // IDNEQ applies the NEQ predicate on the ID field.
  18. func IDNEQ(id int64) predicate.AnnouncementRead {
  19. return predicate.AnnouncementRead(sql.FieldNEQ(FieldID, id))
  20. }
  21. // IDIn applies the In predicate on the ID field.
  22. func IDIn(ids ...int64) predicate.AnnouncementRead {
  23. return predicate.AnnouncementRead(sql.FieldIn(FieldID, ids...))
  24. }
  25. // IDNotIn applies the NotIn predicate on the ID field.
  26. func IDNotIn(ids ...int64) predicate.AnnouncementRead {
  27. return predicate.AnnouncementRead(sql.FieldNotIn(FieldID, ids...))
  28. }
  29. // IDGT applies the GT predicate on the ID field.
  30. func IDGT(id int64) predicate.AnnouncementRead {
  31. return predicate.AnnouncementRead(sql.FieldGT(FieldID, id))
  32. }
  33. // IDGTE applies the GTE predicate on the ID field.
  34. func IDGTE(id int64) predicate.AnnouncementRead {
  35. return predicate.AnnouncementRead(sql.FieldGTE(FieldID, id))
  36. }
  37. // IDLT applies the LT predicate on the ID field.
  38. func IDLT(id int64) predicate.AnnouncementRead {
  39. return predicate.AnnouncementRead(sql.FieldLT(FieldID, id))
  40. }
  41. // IDLTE applies the LTE predicate on the ID field.
  42. func IDLTE(id int64) predicate.AnnouncementRead {
  43. return predicate.AnnouncementRead(sql.FieldLTE(FieldID, id))
  44. }
  45. // AnnouncementID applies equality check predicate on the "announcement_id" field. It's identical to AnnouncementIDEQ.
  46. func AnnouncementID(v int64) predicate.AnnouncementRead {
  47. return predicate.AnnouncementRead(sql.FieldEQ(FieldAnnouncementID, v))
  48. }
  49. // UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
  50. func UserID(v int64) predicate.AnnouncementRead {
  51. return predicate.AnnouncementRead(sql.FieldEQ(FieldUserID, v))
  52. }
  53. // ReadAt applies equality check predicate on the "read_at" field. It's identical to ReadAtEQ.
  54. func ReadAt(v time.Time) predicate.AnnouncementRead {
  55. return predicate.AnnouncementRead(sql.FieldEQ(FieldReadAt, v))
  56. }
  57. // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
  58. func CreatedAt(v time.Time) predicate.AnnouncementRead {
  59. return predicate.AnnouncementRead(sql.FieldEQ(FieldCreatedAt, v))
  60. }
  61. // AnnouncementIDEQ applies the EQ predicate on the "announcement_id" field.
  62. func AnnouncementIDEQ(v int64) predicate.AnnouncementRead {
  63. return predicate.AnnouncementRead(sql.FieldEQ(FieldAnnouncementID, v))
  64. }
  65. // AnnouncementIDNEQ applies the NEQ predicate on the "announcement_id" field.
  66. func AnnouncementIDNEQ(v int64) predicate.AnnouncementRead {
  67. return predicate.AnnouncementRead(sql.FieldNEQ(FieldAnnouncementID, v))
  68. }
  69. // AnnouncementIDIn applies the In predicate on the "announcement_id" field.
  70. func AnnouncementIDIn(vs ...int64) predicate.AnnouncementRead {
  71. return predicate.AnnouncementRead(sql.FieldIn(FieldAnnouncementID, vs...))
  72. }
  73. // AnnouncementIDNotIn applies the NotIn predicate on the "announcement_id" field.
  74. func AnnouncementIDNotIn(vs ...int64) predicate.AnnouncementRead {
  75. return predicate.AnnouncementRead(sql.FieldNotIn(FieldAnnouncementID, vs...))
  76. }
  77. // UserIDEQ applies the EQ predicate on the "user_id" field.
  78. func UserIDEQ(v int64) predicate.AnnouncementRead {
  79. return predicate.AnnouncementRead(sql.FieldEQ(FieldUserID, v))
  80. }
  81. // UserIDNEQ applies the NEQ predicate on the "user_id" field.
  82. func UserIDNEQ(v int64) predicate.AnnouncementRead {
  83. return predicate.AnnouncementRead(sql.FieldNEQ(FieldUserID, v))
  84. }
  85. // UserIDIn applies the In predicate on the "user_id" field.
  86. func UserIDIn(vs ...int64) predicate.AnnouncementRead {
  87. return predicate.AnnouncementRead(sql.FieldIn(FieldUserID, vs...))
  88. }
  89. // UserIDNotIn applies the NotIn predicate on the "user_id" field.
  90. func UserIDNotIn(vs ...int64) predicate.AnnouncementRead {
  91. return predicate.AnnouncementRead(sql.FieldNotIn(FieldUserID, vs...))
  92. }
  93. // ReadAtEQ applies the EQ predicate on the "read_at" field.
  94. func ReadAtEQ(v time.Time) predicate.AnnouncementRead {
  95. return predicate.AnnouncementRead(sql.FieldEQ(FieldReadAt, v))
  96. }
  97. // ReadAtNEQ applies the NEQ predicate on the "read_at" field.
  98. func ReadAtNEQ(v time.Time) predicate.AnnouncementRead {
  99. return predicate.AnnouncementRead(sql.FieldNEQ(FieldReadAt, v))
  100. }
  101. // ReadAtIn applies the In predicate on the "read_at" field.
  102. func ReadAtIn(vs ...time.Time) predicate.AnnouncementRead {
  103. return predicate.AnnouncementRead(sql.FieldIn(FieldReadAt, vs...))
  104. }
  105. // ReadAtNotIn applies the NotIn predicate on the "read_at" field.
  106. func ReadAtNotIn(vs ...time.Time) predicate.AnnouncementRead {
  107. return predicate.AnnouncementRead(sql.FieldNotIn(FieldReadAt, vs...))
  108. }
  109. // ReadAtGT applies the GT predicate on the "read_at" field.
  110. func ReadAtGT(v time.Time) predicate.AnnouncementRead {
  111. return predicate.AnnouncementRead(sql.FieldGT(FieldReadAt, v))
  112. }
  113. // ReadAtGTE applies the GTE predicate on the "read_at" field.
  114. func ReadAtGTE(v time.Time) predicate.AnnouncementRead {
  115. return predicate.AnnouncementRead(sql.FieldGTE(FieldReadAt, v))
  116. }
  117. // ReadAtLT applies the LT predicate on the "read_at" field.
  118. func ReadAtLT(v time.Time) predicate.AnnouncementRead {
  119. return predicate.AnnouncementRead(sql.FieldLT(FieldReadAt, v))
  120. }
  121. // ReadAtLTE applies the LTE predicate on the "read_at" field.
  122. func ReadAtLTE(v time.Time) predicate.AnnouncementRead {
  123. return predicate.AnnouncementRead(sql.FieldLTE(FieldReadAt, v))
  124. }
  125. // CreatedAtEQ applies the EQ predicate on the "created_at" field.
  126. func CreatedAtEQ(v time.Time) predicate.AnnouncementRead {
  127. return predicate.AnnouncementRead(sql.FieldEQ(FieldCreatedAt, v))
  128. }
  129. // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
  130. func CreatedAtNEQ(v time.Time) predicate.AnnouncementRead {
  131. return predicate.AnnouncementRead(sql.FieldNEQ(FieldCreatedAt, v))
  132. }
  133. // CreatedAtIn applies the In predicate on the "created_at" field.
  134. func CreatedAtIn(vs ...time.Time) predicate.AnnouncementRead {
  135. return predicate.AnnouncementRead(sql.FieldIn(FieldCreatedAt, vs...))
  136. }
  137. // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
  138. func CreatedAtNotIn(vs ...time.Time) predicate.AnnouncementRead {
  139. return predicate.AnnouncementRead(sql.FieldNotIn(FieldCreatedAt, vs...))
  140. }
  141. // CreatedAtGT applies the GT predicate on the "created_at" field.
  142. func CreatedAtGT(v time.Time) predicate.AnnouncementRead {
  143. return predicate.AnnouncementRead(sql.FieldGT(FieldCreatedAt, v))
  144. }
  145. // CreatedAtGTE applies the GTE predicate on the "created_at" field.
  146. func CreatedAtGTE(v time.Time) predicate.AnnouncementRead {
  147. return predicate.AnnouncementRead(sql.FieldGTE(FieldCreatedAt, v))
  148. }
  149. // CreatedAtLT applies the LT predicate on the "created_at" field.
  150. func CreatedAtLT(v time.Time) predicate.AnnouncementRead {
  151. return predicate.AnnouncementRead(sql.FieldLT(FieldCreatedAt, v))
  152. }
  153. // CreatedAtLTE applies the LTE predicate on the "created_at" field.
  154. func CreatedAtLTE(v time.Time) predicate.AnnouncementRead {
  155. return predicate.AnnouncementRead(sql.FieldLTE(FieldCreatedAt, v))
  156. }
  157. // HasAnnouncement applies the HasEdge predicate on the "announcement" edge.
  158. func HasAnnouncement() predicate.AnnouncementRead {
  159. return predicate.AnnouncementRead(func(s *sql.Selector) {
  160. step := sqlgraph.NewStep(
  161. sqlgraph.From(Table, FieldID),
  162. sqlgraph.Edge(sqlgraph.M2O, true, AnnouncementTable, AnnouncementColumn),
  163. )
  164. sqlgraph.HasNeighbors(s, step)
  165. })
  166. }
  167. // HasAnnouncementWith applies the HasEdge predicate on the "announcement" edge with a given conditions (other predicates).
  168. func HasAnnouncementWith(preds ...predicate.Announcement) predicate.AnnouncementRead {
  169. return predicate.AnnouncementRead(func(s *sql.Selector) {
  170. step := newAnnouncementStep()
  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.AnnouncementRead {
  180. return predicate.AnnouncementRead(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.AnnouncementRead {
  190. return predicate.AnnouncementRead(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.AnnouncementRead) predicate.AnnouncementRead {
  201. return predicate.AnnouncementRead(sql.AndPredicates(predicates...))
  202. }
  203. // Or groups predicates with the OR operator between them.
  204. func Or(predicates ...predicate.AnnouncementRead) predicate.AnnouncementRead {
  205. return predicate.AnnouncementRead(sql.OrPredicates(predicates...))
  206. }
  207. // Not applies the not operator on the given predicate.
  208. func Not(p predicate.AnnouncementRead) predicate.AnnouncementRead {
  209. return predicate.AnnouncementRead(sql.NotPredicates(p))
  210. }