You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
567 lines
19 KiB
Go
567 lines
19 KiB
Go
1 year ago
|
// Code generated by ent, DO NOT EDIT.
|
||
|
|
||
|
package department
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"entgo.io/ent/dialect/sql"
|
||
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
||
|
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/ent/predicate"
|
||
|
"git.noahlan.cn/noahlan/ntool-biz/core/orm/nent/types"
|
||
|
)
|
||
|
|
||
|
// ID filters vertices based on their ID field.
|
||
|
func ID(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDEQ applies the EQ predicate on the ID field.
|
||
|
func IDEQ(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDNEQ applies the NEQ predicate on the ID field.
|
||
|
func IDNEQ(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDIn applies the In predicate on the ID field.
|
||
|
func IDIn(ids ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldID, ids...))
|
||
|
}
|
||
|
|
||
|
// IDNotIn applies the NotIn predicate on the ID field.
|
||
|
func IDNotIn(ids ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldID, ids...))
|
||
|
}
|
||
|
|
||
|
// IDGT applies the GT predicate on the ID field.
|
||
|
func IDGT(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDGTE applies the GTE predicate on the ID field.
|
||
|
func IDGTE(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDLT applies the LT predicate on the ID field.
|
||
|
func IDLT(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// IDLTE applies the LTE predicate on the ID field.
|
||
|
func IDLTE(id int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldID, id))
|
||
|
}
|
||
|
|
||
|
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||
|
func CreatedAt(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||
|
func UpdatedAt(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// Version applies equality check predicate on the "version" field. It's identical to VersionEQ.
|
||
|
func Version(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||
|
func Name(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// LeaderID applies equality check predicate on the "leader_id" field. It's identical to LeaderIDEQ.
|
||
|
func LeaderID(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldLeaderID, v))
|
||
|
}
|
||
|
|
||
|
// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ.
|
||
|
func Remark(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ.
|
||
|
func ParentID(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldParentID, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||
|
func CreatedAtEQ(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||
|
func CreatedAtNEQ(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||
|
func CreatedAtIn(vs ...time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldCreatedAt, vs...))
|
||
|
}
|
||
|
|
||
|
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||
|
func CreatedAtNotIn(vs ...time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||
|
}
|
||
|
|
||
|
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||
|
func CreatedAtGT(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||
|
func CreatedAtGTE(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||
|
func CreatedAtLT(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||
|
func CreatedAtLTE(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldCreatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||
|
func UpdatedAtEQ(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||
|
func UpdatedAtNEQ(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||
|
func UpdatedAtIn(vs ...time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldUpdatedAt, vs...))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||
|
func UpdatedAtNotIn(vs ...time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||
|
func UpdatedAtGT(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||
|
func UpdatedAtGTE(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||
|
func UpdatedAtLT(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||
|
func UpdatedAtLTE(v time.Time) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldUpdatedAt, v))
|
||
|
}
|
||
|
|
||
|
// StatusEQ applies the EQ predicate on the "status" field.
|
||
|
func StatusEQ(v types.Status) predicate.Department {
|
||
|
vc := v
|
||
|
return predicate.Department(sql.FieldEQ(FieldStatus, vc))
|
||
|
}
|
||
|
|
||
|
// StatusNEQ applies the NEQ predicate on the "status" field.
|
||
|
func StatusNEQ(v types.Status) predicate.Department {
|
||
|
vc := v
|
||
|
return predicate.Department(sql.FieldNEQ(FieldStatus, vc))
|
||
|
}
|
||
|
|
||
|
// StatusIn applies the In predicate on the "status" field.
|
||
|
func StatusIn(vs ...types.Status) predicate.Department {
|
||
|
v := make([]any, len(vs))
|
||
|
for i := range v {
|
||
|
v[i] = vs[i]
|
||
|
}
|
||
|
return predicate.Department(sql.FieldIn(FieldStatus, v...))
|
||
|
}
|
||
|
|
||
|
// StatusNotIn applies the NotIn predicate on the "status" field.
|
||
|
func StatusNotIn(vs ...types.Status) predicate.Department {
|
||
|
v := make([]any, len(vs))
|
||
|
for i := range v {
|
||
|
v[i] = vs[i]
|
||
|
}
|
||
|
return predicate.Department(sql.FieldNotIn(FieldStatus, v...))
|
||
|
}
|
||
|
|
||
|
// VersionEQ applies the EQ predicate on the "version" field.
|
||
|
func VersionEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// VersionNEQ applies the NEQ predicate on the "version" field.
|
||
|
func VersionNEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// VersionIn applies the In predicate on the "version" field.
|
||
|
func VersionIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldVersion, vs...))
|
||
|
}
|
||
|
|
||
|
// VersionNotIn applies the NotIn predicate on the "version" field.
|
||
|
func VersionNotIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldVersion, vs...))
|
||
|
}
|
||
|
|
||
|
// VersionGT applies the GT predicate on the "version" field.
|
||
|
func VersionGT(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// VersionGTE applies the GTE predicate on the "version" field.
|
||
|
func VersionGTE(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// VersionLT applies the LT predicate on the "version" field.
|
||
|
func VersionLT(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// VersionLTE applies the LTE predicate on the "version" field.
|
||
|
func VersionLTE(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldVersion, v))
|
||
|
}
|
||
|
|
||
|
// NameEQ applies the EQ predicate on the "name" field.
|
||
|
func NameEQ(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameNEQ applies the NEQ predicate on the "name" field.
|
||
|
func NameNEQ(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameIn applies the In predicate on the "name" field.
|
||
|
func NameIn(vs ...string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldName, vs...))
|
||
|
}
|
||
|
|
||
|
// NameNotIn applies the NotIn predicate on the "name" field.
|
||
|
func NameNotIn(vs ...string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldName, vs...))
|
||
|
}
|
||
|
|
||
|
// NameGT applies the GT predicate on the "name" field.
|
||
|
func NameGT(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameGTE applies the GTE predicate on the "name" field.
|
||
|
func NameGTE(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameLT applies the LT predicate on the "name" field.
|
||
|
func NameLT(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameLTE applies the LTE predicate on the "name" field.
|
||
|
func NameLTE(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameContains applies the Contains predicate on the "name" field.
|
||
|
func NameContains(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldContains(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
||
|
func NameHasPrefix(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldHasPrefix(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
||
|
func NameHasSuffix(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldHasSuffix(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
||
|
func NameEqualFold(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEqualFold(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
||
|
func NameContainsFold(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldContainsFold(FieldName, v))
|
||
|
}
|
||
|
|
||
|
// LeaderIDEQ applies the EQ predicate on the "leader_id" field.
|
||
|
func LeaderIDEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldLeaderID, v))
|
||
|
}
|
||
|
|
||
|
// LeaderIDNEQ applies the NEQ predicate on the "leader_id" field.
|
||
|
func LeaderIDNEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldLeaderID, v))
|
||
|
}
|
||
|
|
||
|
// LeaderIDIn applies the In predicate on the "leader_id" field.
|
||
|
func LeaderIDIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldLeaderID, vs...))
|
||
|
}
|
||
|
|
||
|
// LeaderIDNotIn applies the NotIn predicate on the "leader_id" field.
|
||
|
func LeaderIDNotIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldLeaderID, vs...))
|
||
|
}
|
||
|
|
||
|
// LeaderIDIsNil applies the IsNil predicate on the "leader_id" field.
|
||
|
func LeaderIDIsNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldIsNull(FieldLeaderID))
|
||
|
}
|
||
|
|
||
|
// LeaderIDNotNil applies the NotNil predicate on the "leader_id" field.
|
||
|
func LeaderIDNotNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotNull(FieldLeaderID))
|
||
|
}
|
||
|
|
||
|
// RemarkEQ applies the EQ predicate on the "remark" field.
|
||
|
func RemarkEQ(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkNEQ applies the NEQ predicate on the "remark" field.
|
||
|
func RemarkNEQ(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkIn applies the In predicate on the "remark" field.
|
||
|
func RemarkIn(vs ...string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldRemark, vs...))
|
||
|
}
|
||
|
|
||
|
// RemarkNotIn applies the NotIn predicate on the "remark" field.
|
||
|
func RemarkNotIn(vs ...string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldRemark, vs...))
|
||
|
}
|
||
|
|
||
|
// RemarkGT applies the GT predicate on the "remark" field.
|
||
|
func RemarkGT(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGT(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkGTE applies the GTE predicate on the "remark" field.
|
||
|
func RemarkGTE(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldGTE(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkLT applies the LT predicate on the "remark" field.
|
||
|
func RemarkLT(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLT(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkLTE applies the LTE predicate on the "remark" field.
|
||
|
func RemarkLTE(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldLTE(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkContains applies the Contains predicate on the "remark" field.
|
||
|
func RemarkContains(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldContains(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkHasPrefix applies the HasPrefix predicate on the "remark" field.
|
||
|
func RemarkHasPrefix(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldHasPrefix(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkHasSuffix applies the HasSuffix predicate on the "remark" field.
|
||
|
func RemarkHasSuffix(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldHasSuffix(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkIsNil applies the IsNil predicate on the "remark" field.
|
||
|
func RemarkIsNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldIsNull(FieldRemark))
|
||
|
}
|
||
|
|
||
|
// RemarkNotNil applies the NotNil predicate on the "remark" field.
|
||
|
func RemarkNotNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotNull(FieldRemark))
|
||
|
}
|
||
|
|
||
|
// RemarkEqualFold applies the EqualFold predicate on the "remark" field.
|
||
|
func RemarkEqualFold(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEqualFold(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// RemarkContainsFold applies the ContainsFold predicate on the "remark" field.
|
||
|
func RemarkContainsFold(v string) predicate.Department {
|
||
|
return predicate.Department(sql.FieldContainsFold(FieldRemark, v))
|
||
|
}
|
||
|
|
||
|
// ParentIDEQ applies the EQ predicate on the "parent_id" field.
|
||
|
func ParentIDEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldEQ(FieldParentID, v))
|
||
|
}
|
||
|
|
||
|
// ParentIDNEQ applies the NEQ predicate on the "parent_id" field.
|
||
|
func ParentIDNEQ(v int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNEQ(FieldParentID, v))
|
||
|
}
|
||
|
|
||
|
// ParentIDIn applies the In predicate on the "parent_id" field.
|
||
|
func ParentIDIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldIn(FieldParentID, vs...))
|
||
|
}
|
||
|
|
||
|
// ParentIDNotIn applies the NotIn predicate on the "parent_id" field.
|
||
|
func ParentIDNotIn(vs ...int64) predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotIn(FieldParentID, vs...))
|
||
|
}
|
||
|
|
||
|
// ParentIDIsNil applies the IsNil predicate on the "parent_id" field.
|
||
|
func ParentIDIsNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldIsNull(FieldParentID))
|
||
|
}
|
||
|
|
||
|
// ParentIDNotNil applies the NotNil predicate on the "parent_id" field.
|
||
|
func ParentIDNotNil() predicate.Department {
|
||
|
return predicate.Department(sql.FieldNotNull(FieldParentID))
|
||
|
}
|
||
|
|
||
|
// HasParent applies the HasEdge predicate on the "parent" edge.
|
||
|
func HasParent() predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := sqlgraph.NewStep(
|
||
|
sqlgraph.From(Table, FieldID),
|
||
|
sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn),
|
||
|
)
|
||
|
sqlgraph.HasNeighbors(s, step)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates).
|
||
|
func HasParentWith(preds ...predicate.Department) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := newParentStep()
|
||
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||
|
for _, p := range preds {
|
||
|
p(s)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasChildren applies the HasEdge predicate on the "children" edge.
|
||
|
func HasChildren() predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := sqlgraph.NewStep(
|
||
|
sqlgraph.From(Table, FieldID),
|
||
|
sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
|
||
|
)
|
||
|
sqlgraph.HasNeighbors(s, step)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates).
|
||
|
func HasChildrenWith(preds ...predicate.Department) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := newChildrenStep()
|
||
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||
|
for _, p := range preds {
|
||
|
p(s)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasUser applies the HasEdge predicate on the "user" edge.
|
||
|
func HasUser() predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := sqlgraph.NewStep(
|
||
|
sqlgraph.From(Table, FieldID),
|
||
|
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
|
||
|
)
|
||
|
sqlgraph.HasNeighbors(s, step)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
|
||
|
func HasUserWith(preds ...predicate.User) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := newUserStep()
|
||
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||
|
for _, p := range preds {
|
||
|
p(s)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasLeader applies the HasEdge predicate on the "leader" edge.
|
||
|
func HasLeader() predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := sqlgraph.NewStep(
|
||
|
sqlgraph.From(Table, FieldID),
|
||
|
sqlgraph.Edge(sqlgraph.M2O, false, LeaderTable, LeaderColumn),
|
||
|
)
|
||
|
sqlgraph.HasNeighbors(s, step)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// HasLeaderWith applies the HasEdge predicate on the "leader" edge with a given conditions (other predicates).
|
||
|
func HasLeaderWith(preds ...predicate.User) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
step := newLeaderStep()
|
||
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||
|
for _, p := range preds {
|
||
|
p(s)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// And groups predicates with the AND operator between them.
|
||
|
func And(predicates ...predicate.Department) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
s1 := s.Clone().SetP(nil)
|
||
|
for _, p := range predicates {
|
||
|
p(s1)
|
||
|
}
|
||
|
s.Where(s1.P())
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Or groups predicates with the OR operator between them.
|
||
|
func Or(predicates ...predicate.Department) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
s1 := s.Clone().SetP(nil)
|
||
|
for i, p := range predicates {
|
||
|
if i > 0 {
|
||
|
s1.Or()
|
||
|
}
|
||
|
p(s1)
|
||
|
}
|
||
|
s.Where(s1.P())
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Not applies the not operator on the given predicate.
|
||
|
func Not(p predicate.Department) predicate.Department {
|
||
|
return predicate.Department(func(s *sql.Selector) {
|
||
|
p(s.Not())
|
||
|
})
|
||
|
}
|