Files
bj_power/bj_power_wms/ent/material/material.go
T
SunYF 4a5e2d7bac feat: 完成多模块迭代更新
- 新增过程巡检按步骤上报、数量不符上报、工位退料功能
- 增加工单工程编号三级归属字段
- 新增物料安全库存与缺货预警
- 新增附件管理、退库单管理模块
- 优化生产看板展示逻辑与前端页面文案
- 清理冗余的工艺路线相关代码与备份文件
2026-09-15 16:37:39 +08:00

187 lines
6.7 KiB
Go

// 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"
// FieldItemType holds the string denoting the item_type field in the database.
FieldItemType = "item_type"
// 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"
// FieldTemplateCode holds the string denoting the template_code field in the database.
FieldTemplateCode = "template_code"
// FieldDrawingNo holds the string denoting the drawing_no field in the database.
FieldDrawingNo = "drawing_no"
// FieldSafetyStock holds the string denoting the safety_stock field in the database.
FieldSafetyStock = "safety_stock"
// FieldIsActive holds the string denoting the is_active field in the database.
FieldIsActive = "is_active"
// 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,
FieldItemType,
FieldManageMode,
FieldIsBatchManaged,
FieldIsSerialManaged,
FieldTemplateCode,
FieldDrawingNo,
FieldSafetyStock,
FieldIsActive,
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 (
// DefaultItemType holds the default value on creation for the "item_type" field.
DefaultItemType int
// 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
// DefaultSafetyStock holds the default value on creation for the "safety_stock" field.
DefaultSafetyStock int
// DefaultIsActive holds the default value on creation for the "is_active" field.
DefaultIsActive bool
// 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()
}
// ByItemType orders the results by the item_type field.
func ByItemType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldItemType, 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()
}
// ByTemplateCode orders the results by the template_code field.
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
}
// ByDrawingNo orders the results by the drawing_no field.
func ByDrawingNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDrawingNo, opts...).ToFunc()
}
// BySafetyStock orders the results by the safety_stock field.
func BySafetyStock(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSafetyStock, opts...).ToFunc()
}
// ByIsActive orders the results by the is_active field.
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsActive, 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()
}