21 lines
990 B
Python
21 lines
990 B
Python
|
|
from sqlalchemy import Column, Integer, String, Float, DateTime, Text, func
|
||
|
|
from app.database import Base
|
||
|
|
|
||
|
|
|
||
|
|
class CostRecord(Base):
|
||
|
|
"""成本/消耗记录(乳化液、盐酸、电、水、蒸汽等)"""
|
||
|
|
__tablename__ = "cost_records"
|
||
|
|
|
||
|
|
id = Column(Integer, primary_key=True, index=True)
|
||
|
|
item = Column(String(30), index=True, nullable=False, comment="成本项编码")
|
||
|
|
item_name = Column(String(50), comment="成本项名称")
|
||
|
|
unit = Column(String(20), comment="计量单位")
|
||
|
|
record_date = Column(DateTime, nullable=False, index=True, comment="记录时间")
|
||
|
|
shift_a = Column(Float, default=0, comment="A班量")
|
||
|
|
shift_b = Column(Float, default=0, comment="B班量")
|
||
|
|
unit_cost = Column(Float, default=0, comment="吨耗量")
|
||
|
|
remark = Column(Text, comment="备注")
|
||
|
|
created_by = Column(String(50))
|
||
|
|
created_at = Column(DateTime, server_default=func.now())
|
||
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|