Files
bj_power/bj_power_mes/ent/stationstate/stationstate.go
T

121 lines
4.1 KiB
Go
Raw Normal View History

// Code generated by ent, DO NOT EDIT.
package stationstate
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the stationstate type in the database.
Label = "station_state"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldStationNo holds the string denoting the stationno field in the database.
FieldStationNo = "station_no"
// FieldDate holds the string denoting the date field in the database.
FieldDate = "date"
// FieldPaused holds the string denoting the paused field in the database.
FieldPaused = "paused"
// FieldReason holds the string denoting the reason field in the database.
FieldReason = "reason"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updatedat field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the stationstate in the database.
Table = "station_state"
)
// Columns holds all SQL columns for stationstate fields.
var Columns = []string{
FieldID,
FieldStationNo,
FieldDate,
FieldPaused,
FieldReason,
FieldOperator,
FieldCreatedAt,
FieldUpdatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// DateValidator is a validator for the "date" field. It is called by the builders before save.
DateValidator func(string) error
// DefaultPaused holds the default value on creation for the "paused" field.
DefaultPaused bool
// DefaultReason holds the default value on creation for the "reason" field.
DefaultReason string
// ReasonValidator is a validator for the "reason" field. It is called by the builders before save.
ReasonValidator func(string) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
OperatorValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updatedAt" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updatedAt" field.
UpdateDefaultUpdatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
IDValidator func(int) error
)
// OrderOption defines the ordering options for the StationState queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByStationNo orders the results by the stationNo field.
func ByStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStationNo, opts...).ToFunc()
}
// ByDate orders the results by the date field.
func ByDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDate, opts...).ToFunc()
}
// ByPaused orders the results by the paused field.
func ByPaused(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPaused, opts...).ToFunc()
}
// ByReason orders the results by the reason field.
func ByReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReason, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updatedAt field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}