from sqlalchemy import Column, Integer, String, JSON, create_engine,DateTime,BigInteger from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from database import Base from datetime import datetime class TpPatternList(Base): __tablename__ = 'tp_pattern_list' id = Column(String(255), primary_key=True) pattern_name = Column(String(255), nullable=True, comment='图案名称') content = Column(JSON, nullable=True, comment='图案json') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') class Config: orm_mode = True class TpPatternWSList(Base): __tablename__ = 'tp_pattern_ws_list' id = Column(String(255), primary_key=True) name = Column(String(255), comment='图案id') pattern_id = Column(String(255), nullable=True, comment='图案id') content = Column(JSON, nullable=True, comment='图案json') visible = Column(String(10), default=None, comment='是否显示') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') class Config: orm_mode = True class TpPatternWSUserList(Base): __tablename__ = 'tp_pattern_ws_user_list' id = Column(String(255), primary_key=True) pattern_id = Column(String(255), nullable=True, comment='图案id') pattern_name = Column(String(255), nullable=True, comment='图案名称') user_id = Column(BigInteger, nullable=True, comment='用户id') ws_flag = Column(String(255), default='true', comment='协同标志') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') class Config: orm_mode = True class TpPatternWSGroupList(Base): __tablename__ = 'tp_pattern_ws_group_list' group_id = Column(String(255), primary_key=True) group_name = Column(String(255), nullable=True, comment='分组名称') pattern_id = Column(String(255), nullable=True, comment='图案id') pattern_name = Column(String(255), comment='图案名称') visible = Column(String(10), default='0', comment='是否显示') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') class Config: orm_mode = True class TpPatternTemplate(Base): __tablename__ = 'tp_pattern_template' template_id = Column(String(255), primary_key=True, comment='模板ID') name = Column(String(255), nullable=False, comment='模板名称') value = Column(String(255), nullable=False, comment='值') order_num = Column(Integer, nullable=True, comment='显示顺序') visible = Column(String(10), default='1', comment='是否显示') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') remark = Column(String(500), default='', comment='备注') class Config: orm_mode = True class TpPatternClassification(Base): __tablename__ = 'tp_pattern_classification' classification_id = Column(String(255), primary_key=True, comment='ID') template_id = Column(String(255), nullable=False, comment='模板ID') name = Column(String(255), nullable=False, comment='分类名称') value = Column(String(255), nullable=False, comment='值') order_num = Column(Integer, nullable=True, comment='显示顺序') visible = Column(String(255), default='1', comment='是否显示') image = Column(String(255), nullable=False, comment='图像文件名') icon = Column(String(255), nullable=False, comment='图标名称') size = Column(JSON, nullable=False, comment='大小,存储为JSON格式') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') remark = Column(String(500), default='', comment='备注') class Config: orm_mode = True