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

157 lines
5.7 KiB
Go
Raw Normal View History

// Code generated by ent, DO NOT EDIT.
package plcmovecmd
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the plcmovecmd type in the database.
Label = "plc_move_cmd"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCmdNo holds the string denoting the cmdno field in the database.
FieldCmdNo = "cmd_no"
// FieldSn holds the string denoting the sn field in the database.
FieldSn = "sn"
// FieldOrderNo holds the string denoting the orderno field in the database.
FieldOrderNo = "order_no"
// FieldFromPoint holds the string denoting the frompoint field in the database.
FieldFromPoint = "from_point"
// FieldToPoint holds the string denoting the topoint field in the database.
FieldToPoint = "to_point"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldMessage holds the string denoting the message field in the database.
FieldMessage = "message"
// 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 plcmovecmd in the database.
Table = "plc_move_cmd"
)
// Columns holds all SQL columns for plcmovecmd fields.
var Columns = []string{
FieldID,
FieldCmdNo,
FieldSn,
FieldOrderNo,
FieldFromPoint,
FieldToPoint,
FieldStatus,
FieldOperator,
FieldMessage,
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 (
// CmdNoValidator is a validator for the "cmdNo" field. It is called by the builders before save.
CmdNoValidator func(string) error
// SnValidator is a validator for the "sn" field. It is called by the builders before save.
SnValidator func(string) error
// DefaultOrderNo holds the default value on creation for the "orderNo" field.
DefaultOrderNo string
// OrderNoValidator is a validator for the "orderNo" field. It is called by the builders before save.
OrderNoValidator func(string) error
// FromPointValidator is a validator for the "fromPoint" field. It is called by the builders before save.
FromPointValidator func(string) error
// ToPointValidator is a validator for the "toPoint" field. It is called by the builders before save.
ToPointValidator func(string) error
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
StatusValidator 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
// DefaultMessage holds the default value on creation for the "message" field.
DefaultMessage string
// MessageValidator is a validator for the "message" field. It is called by the builders before save.
MessageValidator 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 PlcMoveCmd 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()
}
// ByCmdNo orders the results by the cmdNo field.
func ByCmdNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCmdNo, opts...).ToFunc()
}
// BySn orders the results by the sn field.
func BySn(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSn, opts...).ToFunc()
}
// ByOrderNo orders the results by the orderNo field.
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
}
// ByFromPoint orders the results by the fromPoint field.
func ByFromPoint(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFromPoint, opts...).ToFunc()
}
// ByToPoint orders the results by the toPoint field.
func ByToPoint(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldToPoint, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByMessage orders the results by the message field.
func ByMessage(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMessage, 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()
}