class Session(BaseModel): __tablename__ = 'session' id = db.Column(db.String(64), primary_key=True) usercode = db.Column(db.String(16), nullable=False) expire_at = db.Column(db.DateTime, nullable=False)
class Role(BaseModel): __tablename__ = 'role' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(32), nullable=False, server_default=db.text("''"))
class DepartmentUser(BaseModel): __tablename__ = 'department_user' id = db.Column(db.Integer, primary_key=True) department_id = db.Column(db.Integer) usercode = db.Column(db.String(16)) title = db.Column(db.String(64))
class Permission(BaseModel): __tablename__ = 'permission' id = db.Column(db.Integer, primary_key=True) parent_id = db.Column(db.Integer, nullable=False, server_default=db.text("'0'")) code = db.Column(db.String(32), nullable=False, server_default=db.text("''")) type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) name = db.Column(db.String(32), nullable=False, server_default=db.text("''"))
class Grid(BaseModel): __tablename__ = 'grid' id = db.Column(db.Integer, primary_key=True) code = db.Column(db.String(32), nullable=False, unique=True, server_default=db.text("''")) usercode = db.Column(db.String(16), server_default=db.text("''")) status = db.Column(db.Integer) update_time = db.Column( db.DateTime, nullable=False, server_default=db.text( "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
class RolePermission(BaseModel): __tablename__ = 'role_permission' id = db.Column(db.Integer, primary_key=True) role_id = db.Column(db.ForeignKey('role.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False, index=True) permission_id = db.Column(db.ForeignKey('permission.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False, index=True) role = db.relationship('Role') user = db.relationship('Permission')
class RoleUser(BaseModel): __tablename__ = 'role_user' id = db.Column(db.Integer, primary_key=True) role_id = db.Column(db.ForeignKey('role.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False, index=True) usercode = db.Column(db.ForeignKey('user.usercode', ondelete='CASCADE', onupdate='CASCADE'), nullable=False, index=True, server_default=db.text("''")) role = db.relationship('Role') user = db.relationship('User')
class Category(BaseModel): __tablename__ = 'category' id = db.Column(db.Integer, primary_key=True) type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) parent_id = db.Column(db.Integer, nullable=False, server_default=db.text("'0'")) parent_code = db.Column(db.String(4)) code = db.Column(db.String(4), nullable=False, server_default=db.text("''")) longcode = db.Column(db.String(4), nullable=False, server_default=db.text("''")) name = db.Column(db.String(64), nullable=False, server_default=db.text("''")) description = db.Column(db.String(256)) icon = db.Column(db.String(256)) order = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
class Department(BaseModel): __tablename__ = 'department' id = db.Column(db.Integer, primary_key=True) parent_id = db.Column(db.Integer, nullable=False, server_default=db.text("'0'")) code = db.Column(db.String(32), nullable=False, unique=True, server_default=db.text("''")) type = db.Column(db.Integer) name = db.Column(db.String(64)) region_id = db.Column(db.Integer, nullable=False) description = db.Column(db.String(512)) status = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) create_time = db.Column(db.DateTime, nullable=False, server_default=db.text("CURRENT_TIMESTAMP"))
class Sequence(BaseModel): __tablename__ = 'sequence' id = db.Column(db.String(64), primary_key=True) name = db.Column(db.String(16), nullable=False) current = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) min = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) max = db.Column(db.Integer, nullable=False, server_default=db.text("'99999999'")) step = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) description = db.Column(db.String(256))
class Attachment(BaseModel): __tablename__ = 'attachment' id = db.Column(db.Integer, primary_key=True) attach_type = db.Column(db.Integer) attach_id = db.Column(db.Integer) media_type = db.Column(db.Integer) media_path = db.Column(db.String(256)) create_time = db.Column(db.DateTime, nullable=False, server_default=db.text("CURRENT_TIMESTAMP"))
class Region(BaseModel): __tablename__ = 'region' id = db.Column(db.Integer, primary_key=True) parent_id = db.Column(db.Integer, nullable=False) name = db.Column(db.String(32), nullable=False, server_default=db.text("''")) level = db.Column(db.Integer, nullable=False) code = db.Column(db.String(32), nullable=False, server_default=db.text("''")) longcode = db.Column(db.String(32), nullable=False, server_default=db.text("''")) order = db.Column(db.Integer, nullable=False)
class User(BaseModel): __tablename__ = 'user' usercode = db.Column(db.String(16), nullable=False, primary_key=True, server_default=db.text("''")) user_type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) name = db.Column(db.String(32), nullable=False, server_default=db.text("''")) phone = db.Column(db.String(16)) status = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) update_time = db.Column(db.DateTime) create_time = db.Column(db.DateTime, nullable=False, server_default=db.text("'0000-00-00 00:00:00'"))
class Event(BaseModel): __tablename__ = 'event' id = db.Column(db.Integer, primary_key=True) code = db.Column(db.String(32), nullable=False, unique=True, server_default=db.text("''")) name = db.Column(db.String(64), nullable=False, server_default=db.text("''")) region_id = db.Column(db.Integer, nullable=False) dept_id = db.Column(db.Integer) update_time = db.Column( db.DateTime, nullable=False, server_default=db.text( "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
class Component(BaseModel): __tablename__ = 'component' id = db.Column(db.Integer, primary_key=True) code = db.Column(db.String(32), nullable=False, server_default=db.text("''")) name = db.Column(db.String(64), nullable=False, server_default=db.text("''")) longitude = db.Column(db.String(64)) latitude = db.Column(db.String(64)) address = db.Column(db.String(256)) grid_code = db.Column(db.String(32), nullable=False, server_default=db.text("''")) description = db.Column(db.String(128)) status = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) collect_time = db.Column(db.DateTime) collect_user = db.Column(db.String(32)) collect_dept_id = db.Column(db.Integer) verify_time = db.Column(db.DateTime) verify_user = db.Column(db.String(32)) verify_dept_id = db.Column(db.Integer) manage_dept_id = db.Column(db.Integer) owner_dept_id = db.Column(db.Integer) maintain_dept_id = db.Column(db.Integer) update_time = db.Column(db.DateTime, nullable=False)
class Case(BaseModel): __tablename__ = 'case' id = db.Column(db.Integer, primary_key=True) code = db.Column(db.String(32), nullable=False, unique=True, server_default=db.text("''")) source = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) name = db.Column(db.String(128), nullable=False, server_default=db.text("''")) category_type = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) parent_category_code = db.Column(db.String(4), nullable=False, server_default=db.text("''")) parent_category_name = db.Column(db.String(64), nullable=False, server_default=db.text("''")) category_code = db.Column(db.String(4), nullable=False, server_default=db.text("''")) category_name = db.Column(db.String(64), nullable=False, server_default=db.text("''")) description = db.Column(db.String(512)) address = db.Column(db.String(512)) longitude = db.Column(db.String(64)) latitude = db.Column(db.String(64)) grid_code = db.Column(db.String(64)) obj_code = db.Column(db.String(64)) reporter_usercode = db.Column(db.String(32)) reporter_name = db.Column(db.String(64)) reporter_phone = db.Column(db.String(16)) reporter_address = db.Column(db.String(256)) proc_inst_id = db.Column(db.String(64)) begin_time = db.Column(db.DateTime, default=func.now()) end_time = db.Column(db.DateTime) expect_end_time = db.Column(db.DateTime) status = db.Column(db.Integer, nullable=False, server_default=db.text("'1'")) priority = db.Column(db.Integer, nullable=False, server_default=db.text("'1'"))
class CaseActivity(BaseModel): __tablename__ = 'case_activity' id = db.Column(db.Integer, primary_key=True) case_id = db.Column(db.Integer, nullable=False, index=True) task_id = db.Column(db.String(64), nullable=False, server_default=db.text("''")) name = db.Column(db.String(64)) usercode = db.Column(db.String(32)) status = db.Column(db.Integer) description = db.Column(db.String(512)) begin_time = db.Column(db.DateTime) end_time = db.Column(db.DateTime) expect_end_time = db.Column(db.DateTime) remark = db.Column(db.String(128))