#!D:/IDE/anaconda3/envs/Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
@FileName：DBModels.py
@Description：
@Author：XSH
@Time：2025/11/11 10:12
@Department：研发部
@Copyright：©2025 乐辰生物
"""
from sqlalchemy.orm import declarative_base, mapper, sessionmaker, Session
from sqlalchemy.orm import (declarative_base, Mapped, mapped_column, relationship, mapper, sessionmaker)
from sqlalchemy import Table, Engine, create_engine, Column, ForeignKey, and_, or_, insert, delete, update, select, func, ColumnElement,distinct
from AppInterfaces.AppDBInterface       import DBManager, dbController, DBInterface
from AppCore.AppDBModels.CoreModel import CoreModel
from AppCore.AppDBModels.Permissions.UserModel                      import UserModel                                    #
from AppCore.AppDBModels.Permissions.GroupModel                     import GroupModel                                   #
from AppCore.AppDBModels.Permissions.RoleModel                      import RoleModel                                    #
from AppCore.AppDBModels.WeightModels.WeightModelInterface          import WeightModelInterface                         #
from AppCore.AppDBModels.WeightModels.PreviewClassifierModel        import PreviewClassifierModel                       #
from AppCore.AppDBModels.WeightModels.PreferredClassifierModel      import PreferredClassifierModel                     #
from AppCore.AppDBModels.WeightModels.CollectClassifierModel        import CollectClassifierModel                       #
from AppCore.AppDBModels.StateModels.OperatingStatusModel           import OperatingStatusModel                         #
from AppCore.AppDBModels.StateModels.ScanStatusModel                import ScanStatusModel                              #
from AppCore.AppDBModels.StateModels.CustomScanningModel            import CustomScanningModel                          #
from AppCore.AppDBModels.ConfigModels.AnointingModel                import AnointingModel                               #
from AppCore.AppDBModels.ConfigModels.AxisVelocityModel             import AxisVelocityModel                            #
from AppCore.AppDBModels.ConfigModels.FocusingConfigModel           import FocusingConfigModel                          #
from AppCore.AppDBModels.ConfigModels.GripperConfigModel            import GripperConfigModel                           #
from AppCore.AppDBModels.ConfigModels.ImageAnalysisModel            import ImageAnalysisModel                           #
from AppCore.AppDBModels.ConfigModels.ImageConfigModel              import ImageConfigModel                             #
from AppCore.AppDBModels.ConfigModels.ChamberConfigModel            import ChamberConfigModel                           #
from AppCore.AppDBModels.ConfigModels.IntegrationExposureTimes      import IntegrationExposureTimes                     #
from AppCore.AppDBModels.ConfigModels.ObjectiveModel                import ObjectiveModel                               #
from AppCore.AppDBModels.ConfigModels.SystemConfigModel             import SystemConfigModel                            #
from AppCore.AppDBModels.ConfigModels.HitBotConfigModel             import HitBotConfigModel                            #
from AppCore.AppDBModels.ConfigModels.TrayConfigModel               import TrayConfigModel                              #
from AppCore.AppDBModels.CameraModels.CameraInterface               import CameraInterface                              #
from AppCore.AppDBModels.CameraModels.CameraModel                   import CameraModel                                  #
from AppCore.AppDBModels.CameraModels.CameraColorModel              import CameraColorModel                             #
from AppCore.AppDBModels.CameraModels.ColorAdjustmentSelector       import ColorAdjustmentSelector                      #
from AppCore.AppDBModels.SlideModels.SlideModelInterface            import SlideModelInterface                          #
from AppCore.AppDBModels.SlideModels.AllCellModel                   import AllCellModel                                 #
from AppCore.AppDBModels.SlideModels.AlreadyScannedModel            import AlreadyScannedModel                          #
from AppCore.AppDBModels.SlideModels.CellModel                      import CellModel                                    #
from AppCore.AppDBModels.SlideModels.CellFocusingModel              import CellFocusingModel                            #
from AppCore.AppDBModels.SlideModels.ChamberStatusModel             import ChamberStatusModel                           #
from AppCore.AppDBModels.SlideModels.SlideCaseModel                 import SlideCaseModel                               #
from AppCore.AppDBModels.SlideModels.SlideFocusingModel             import SlideFocusingModel                           #
from AppCore.AppDBModels.SlideModels.SlideScanningModel             import SlideScanningModel                           #
from AppCore.AppDBModels.SlideModels.SlideLoggerModel               import SlideLoggerModel                             #
from AppCore.AppDBModels.SlideModels.SlideModel                     import SlideModel                                   #
from AppCore.AppDBModels.SlideModels.TraySlideModel                 import TraySlideModel                               #
from AppCore.AppDBModels.ConfigModels.ObjectiveOffsetModel          import ObjectiveOffsetModel                         #
from AppCore.AppDBModels.SlideModels.SpecimenCountModel             import SpecimenCountModel                           #
from AppCore.AppDBModels.SlideModels.HigObjectiveCellModel          import HigObjectiveCellModel                        #
from AppCore.AppDBModels.TemplateModels.ScanTemplate                import ScanTemplate                                 #
from AppCore.AppDBModels.TemplateModels.Collectsettings             import Collectsettings                              #
from AppCore.AppDBModels.TemplateModels.Previewsettings             import Previewsettings                              #
from AppCore.AppDBModels.TrayModels.TrayModelInterface              import TrayModelInterface                           #
from AppCore.AppDBModels.TrayModels.TrayModel                       import TrayModel                                    #