Parcourir la source

250906-1代码。

baoyubo il y a 1 semaine
Parent
commit
2a1e0b7b9f
1 fichiers modifiés avec 69 ajouts et 1 suppressions
  1. 69 1
      models/sharedb.py

+ 69 - 1
models/sharedb.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-from sqlalchemy import String, Column, Integer, DateTime,Text,BigInteger,Float,Date
+from sqlalchemy import String, Column, Integer, DateTime,Text,BigInteger,Float,Date,TIMESTAMP
 from sqlalchemy.dialects.mysql import TINYINT
 from sqlalchemy.sql import func
 from database import Base
@@ -180,3 +180,71 @@ class YzyMsgQueueSk(Base):
     class Config:
         orm_mode = True
 
+class MiningCompany(Base):
+    __tablename__ = 'mining_company'
+
+    id = Column(Integer, primary_key=True, comment='id')
+    company_name = Column(String(255), comment='矿山企业名称')
+    usci = Column(String(18), comment='企业统一社会信用代码')
+    province = Column(String(50), comment='省')
+    city = Column(String(50), comment='市')
+    area = Column(String(50), comment='县')
+    production_status = Column(String(50), comment='生产状态')
+    primary_mineral_types = Column(String(50), comment='主要矿种')
+    mining_method = Column(String(50), comment='开采方式')
+    development_method = Column(String(50), comment='开拓方式')
+    scale = Column(String(50), comment='矿山规模')
+    name = Column(String(50), comment='姓名')
+    phone = Column(String(20), comment='联系方式')
+    longitude = Column(Float, comment='经度')
+    latitude = Column(Float, comment='纬度')
+    formatted_address = Column(String(255), comment='地址')
+    safety_mgmt_headcount = Column(Integer, comment='安全管理人数')
+    mining_license_start = Column(Date, comment='采矿证起始日期')
+    mining_license_end = Column(Date, comment='采矿证失效日期')
+    production_capacity = Column(String(100), comment='生产规模')
+    mining_area = Column(Float, comment='矿区面积(km²)')
+    safety_license_start = Column(Date, comment='安全生产许可证起始日期')
+    safety_license_end = Column(Date, comment='安全生产许可证失效日期')
+    safety_license_no = Column(String(50), comment='安全生产许可证证号')
+    license_scope = Column(Text, comment='许可范围')
+    issuing_authority = Column(String(100), comment='发证单位')
+    economic_type = Column(String(50), comment='企业经济类型')
+    business_scope = Column(Text, comment='生产经营范围')
+    seismic_intensity = Column(String(10), comment='地震烈度')
+    net_fixed_assets = Column(Float, comment='固定资产净值(万元)')
+    max_underground_headcount = Column(Integer, comment='设计最大单班下井人数')
+    safety_staff_count = Column(Integer, comment='安全管理人员数量')
+    daily_production_staff = Column(Integer, comment='日常生产人员数量')
+    special_operation_staff = Column(Integer, comment='特种作业人员数量')
+    hydrogeological_condition = Column(String(50), comment='水文地质条件')
+    safety_risk_level = Column(String(20), comment='安全风险等级')
+    remark = Column(Text, comment='备注')
+    s_last_updatetime = Column(TIMESTAMP, server_default=func.current_timestamp(), comment='最后更新时间')
+
+class MiningAccidentDetail(Base):
+    __tablename__ = 'mining_accident_detail'
+
+    id                      = Column(BigInteger, primary_key=True, comment='主键')
+    accident_name           = Column(String(200), comment='事故名称')
+    company_name            = Column(String(200), comment='事发企业')
+    district                = Column(String(100), comment='区县')
+    longitude               = Column(Float, comment='经度')  # 9位小数,可按需调整
+    latitude                = Column(Float, comment='纬度')
+    accident_type           = Column(String(50), comment='事故类别')
+    mgmt_category           = Column(String(50), comment='管理分类')
+    sector                  = Column(String(50), comment='门类')
+    major_category          = Column(String(50), comment='大类')
+    accident_summary        = Column(Text, comment='事故概况')
+    accident_level          = Column(String(20), comment='事故等级')
+    accident_time           = Column(DateTime, comment='事发时间')
+    accident_cause          = Column(Text, comment='事发原因')
+    secondary_accident      = Column(String(50), default='0', comment='次生衍生事故')
+    accident_location       = Column(String(255), comment='事发地点')
+    injured_count           = Column(Integer, default=0, comment='受伤人数')
+    missing_count           = Column(Integer, default=0, comment='失踪人数')
+    death_count             = Column(Integer, default=0, comment='死亡人数')
+    direct_economic_loss    = Column(Float, default=0.00, comment='直接经济损失(万元)')
+    disposal_process        = Column(Text, comment='处置过程')
+    remark                  = Column(Text, comment='备注')
+    s_last_updatetime       = Column(DateTime, server_default=func.current_timestamp(), comment='最后更新时间')