Files
bj_power/bj_power_wms/ent/inspectiondisposalitem/inspectiondisposalitem.go
T

97 lines
3.1 KiB
Go
Raw Normal View History

// Code generated by ent, DO NOT EDIT.
package inspectiondisposalitem
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the inspectiondisposalitem type in the database.
Label = "inspection_disposal_item"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldRecordID holds the string denoting the record_id field in the database.
FieldRecordID = "record_id"
// FieldDisposeType holds the string denoting the dispose_type field in the database.
FieldDisposeType = "dispose_type"
// FieldQty holds the string denoting the qty field in the database.
FieldQty = "qty"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the inspectiondisposalitem in the database.
Table = "inspection_disposal_items"
)
// Columns holds all SQL columns for inspectiondisposalitem fields.
var Columns = []string{
FieldID,
FieldRecordID,
FieldDisposeType,
FieldQty,
FieldRemark,
FieldOperator,
FieldCreatedAt,
}
// 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 (
// QtyValidator is a validator for the "qty" field. It is called by the builders before save.
QtyValidator func(int) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
)
// OrderOption defines the ordering options for the InspectionDisposalItem 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()
}
// ByRecordID orders the results by the record_id field.
func ByRecordID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRecordID, opts...).ToFunc()
}
// ByDisposeType orders the results by the dispose_type field.
func ByDisposeType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDisposeType, opts...).ToFunc()
}
// ByQty orders the results by the qty field.
func ByQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldQty, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, 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 created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}