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

159 lines
5.6 KiB
Go
Raw Normal View History

2026-08-27 19:50:57 +08:00
// Code generated by ent, DO NOT EDIT.
package material
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the material type in the database.
Label = "material"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCode holds the string denoting the code field in the database.
FieldCode = "code"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldShortName holds the string denoting the short_name field in the database.
FieldShortName = "short_name"
// FieldSpec holds the string denoting the spec field in the database.
FieldSpec = "spec"
// FieldUnit holds the string denoting the unit field in the database.
FieldUnit = "unit"
// FieldDescription holds the string denoting the description field in the database.
FieldDescription = "description"
// FieldManageMode holds the string denoting the manage_mode field in the database.
FieldManageMode = "manage_mode"
// FieldIsBatchManaged holds the string denoting the is_batch_managed field in the database.
FieldIsBatchManaged = "is_batch_managed"
// FieldIsSerialManaged holds the string denoting the is_serial_managed field in the database.
FieldIsSerialManaged = "is_serial_managed"
// FieldMaterialType holds the string denoting the material_type field in the database.
FieldMaterialType = "material_type"
// FieldTemplateCode holds the string denoting the template_code field in the database.
FieldTemplateCode = "template_code"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the material in the database.
Table = "materials"
)
// Columns holds all SQL columns for material fields.
var Columns = []string{
FieldID,
FieldCode,
FieldName,
FieldShortName,
FieldSpec,
FieldUnit,
FieldDescription,
FieldManageMode,
FieldIsBatchManaged,
FieldIsSerialManaged,
FieldMaterialType,
FieldTemplateCode,
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 (
// DefaultManageMode holds the default value on creation for the "manage_mode" field.
DefaultManageMode int
// DefaultIsBatchManaged holds the default value on creation for the "is_batch_managed" field.
DefaultIsBatchManaged bool
// DefaultIsSerialManaged holds the default value on creation for the "is_serial_managed" field.
DefaultIsSerialManaged bool
// DefaultMaterialType holds the default value on creation for the "material_type" field.
DefaultMaterialType string
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() int64
)
// OrderOption defines the ordering options for the Material 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()
}
// ByCode orders the results by the code field.
func ByCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCode, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByShortName orders the results by the short_name field.
func ByShortName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldShortName, opts...).ToFunc()
}
// BySpec orders the results by the spec field.
func BySpec(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSpec, opts...).ToFunc()
}
// ByUnit orders the results by the unit field.
func ByUnit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUnit, opts...).ToFunc()
}
// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
// ByManageMode orders the results by the manage_mode field.
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
}
// ByIsBatchManaged orders the results by the is_batch_managed field.
func ByIsBatchManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsBatchManaged, opts...).ToFunc()
}
// ByIsSerialManaged orders the results by the is_serial_managed field.
func ByIsSerialManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsSerialManaged, opts...).ToFunc()
}
// ByMaterialType orders the results by the material_type field.
func ByMaterialType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaterialType, opts...).ToFunc()
}
// ByTemplateCode orders the results by the template_code field.
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}