Files
bj_power/bj_power_wms/ent/inventorylock/inventorylock.go
T
2026-08-28 15:06:01 +08:00

131 lines
4.4 KiB
Go

// Code generated by ent, DO NOT EDIT.
package inventorylock
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the inventorylock type in the database.
Label = "inventory_lock"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTargetType holds the string denoting the target_type field in the database.
FieldTargetType = "target_type"
// FieldTargetID holds the string denoting the target_id field in the database.
FieldTargetID = "target_id"
// FieldMaterialCode holds the string denoting the material_code field in the database.
FieldMaterialCode = "material_code"
// FieldLockedQty holds the string denoting the locked_qty field in the database.
FieldLockedQty = "locked_qty"
// FieldOrderNo holds the string denoting the order_no field in the database.
FieldOrderNo = "order_no"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldExpiredAt holds the string denoting the expired_at field in the database.
FieldExpiredAt = "expired_at"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// 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 inventorylock in the database.
Table = "inventory_locks"
)
// Columns holds all SQL columns for inventorylock fields.
var Columns = []string{
FieldID,
FieldTargetType,
FieldTargetID,
FieldMaterialCode,
FieldLockedQty,
FieldOrderNo,
FieldStatus,
FieldExpiredAt,
FieldRemark,
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 (
// DefaultLockedQty holds the default value on creation for the "locked_qty" field.
DefaultLockedQty int
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus 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 InventoryLock 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()
}
// ByTargetType orders the results by the target_type field.
func ByTargetType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTargetType, opts...).ToFunc()
}
// ByTargetID orders the results by the target_id field.
func ByTargetID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTargetID, opts...).ToFunc()
}
// ByMaterialCode orders the results by the material_code field.
func ByMaterialCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaterialCode, opts...).ToFunc()
}
// ByLockedQty orders the results by the locked_qty field.
func ByLockedQty(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLockedQty, opts...).ToFunc()
}
// ByOrderNo orders the results by the order_no field.
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByExpiredAt orders the results by the expired_at field.
func ByExpiredAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldExpiredAt, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, 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()
}