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